FSM Wrapper
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 consecutiverenumerateCaller
callsfsm
- the FSM contract that's being wrapped; this contract is the only allowed caller forrenumerateCaller
Functions
modifyParameters
- modify contract parametersrenumerateCaller(feeReceiver: address)
- called by thefsm
in order to send stability fees from the StabilityFeeTreasury to thefeeReceiver
stopped() public view returns (uint256)
- read and returnstopped
from thefsm
priceSource() public view returns (address)
- read and returnpriceSource
from thefsm
updateDelay() public view returns (uint16)
- read and returnupdateDelay
from thefsm
lastUpdateTime() public view returns (uint64)
- read and returnlastUpdateTime
from thefsm
newPriceDeviation() public view returns (uint256)
- read and return thenewPriceDeviation
from thefsm
passedDelay() public view returns (bool)
- read and returnpassedDelay
from thefsm
getNextBoundedPrice() public view returns (uint128)
- read and return the value calculated bygetNextBoundedPrice
from thefsm
getNextPriceLowerBound() public view returns (uint128)
- read and return the value calculated bygetNextPriceLowerBound
from thefsm
getNextPriceUpperBound() public view returns (uint128)
- read and return the value calculated bygetNextPriceUpperBound
from thefsm
getResultWithValidity() external view returns (uint256, bool)
- read and return the current result and its validity from thefsm
getNextResultWithValidity() external view returns (uint256, bool)
- read and return the next result and its validity from thefsm
read() 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.