FSM Wrapper
Wrapper for FSM-like contracts
1. Summary
The FSMWrapper is meant to act as a funding source for FSM-like contracts as well as an interface that allows other contracts to read data from the FSM integrated with the wrapper.
2. Contract Variables & Functions
Variables
authorizedAccounts[usr: address]-addAuthorization/removeAuthorization- auth mechanismslastReimburseTime- last timestamp when the wrapper sent stability fee rewards to the address that calledfsm.updateResult()reimburseDelay- enforced delay between consecutiverenumerateCallercallsfsm- the FSM contract that's being wrapped; this contract is the only allowed caller forrenumerateCaller
Functions
modifyParameters- modify contract parametersrenumerateCaller(feeReceiver: address)- called by thefsmin order to send stability fees from the StabilityFeeTreasury to thefeeReceiverstopped() public view returns (uint256)- read and returnstoppedfrom thefsmpriceSource() public view returns (address)- read and returnpriceSourcefrom thefsmupdateDelay() public view returns (uint16)- read and returnupdateDelayfrom thefsmlastUpdateTime() public view returns (uint64)- read and returnlastUpdateTimefrom thefsmnewPriceDeviation() public view returns (uint256)- read and return thenewPriceDeviationfrom thefsmpassedDelay() public view returns (bool)- read and returnpassedDelayfrom thefsmgetNextBoundedPrice() public view returns (uint128)- read and return the value calculated bygetNextBoundedPricefrom thefsmgetNextPriceLowerBound() public view returns (uint128)- read and return the value calculated bygetNextPriceLowerBoundfrom thefsmgetNextPriceUpperBound() public view returns (uint128)- read and return the value calculated bygetNextPriceUpperBoundfrom thefsmgetResultWithValidity() external view returns (uint256, bool)- read and return the current result and its validity from thefsmgetNextResultWithValidity() external view returns (uint256, bool)- read and return the next result and its validity from thefsmread() external view returns (uint256)- read and return (or revert) the current result from thefsm
3. Walkthrough
Anyone can read values from the fsm contract by calling the wrapper view functions. The fsm contract is allowed to call renumerateCaller and thus send stability fee rewards to an address.
Last updated
Was this helpful?