Mandatory Fixed Treasury Reimbursement
1. Summary
The MandatoryFixedTreasuryReimbursement
is a contract meant to be inherited from and used as a way to offer a fixed stability fee reward (pulled from the SF treasury) to any address.
2. Contract Variables & Functions
Variables
authorizedAccounts[usr: address]
-addAuthorization
/removeAuthorization
- auth mechanismsfixedReward
- the fixed reward sent by thetreasury
to a fee receivertreasury
- stability fee treasury contract
Functions
treasuryAllowance() public view returns (uint256)
- return the amount of SF that the treasury can transfer in one transaction when called by the reimbursement contractgetCallerReward() public view returns (uint256 reward)
- get the actual reward that can be pulled from the SF treasury by taking the minimum value between thefixedReward
and the total amount that can be sent by thetreasury
in one blockrewardCaller(proposedFeeReceiver: address) internal
- internal function to send a SF reward to a fee receiver by calling thetreasury
Modifiers
isAuthorized
**** - checks whether an address is part ofauthorizedAddresses
(and thus can call authed functions)
Events
AddAuthorization
- emitted when a new address becomes authorized. Contains:account
- the new authorized account
RemoveAuthorization
- emitted when an address is de-authorized. Contains:account
- the address that was de-authorized
ModifyParameters
- emitted when a parameter is updated.RewardCaller
- emitted when the contract rewards an address with SF coming from thetreasury
. Contains:finalFeeReceiver
- the address that got the rewardfixedReward
- the reward that was sent
3. Walkthrough
rewardCaller
is the most important function in this contract. It takes care of pulling a fixed SF reward from the treasury and then sending it to a proposedFeeReceiver
.
getCallerReward
can be used to retrieve the current SF fee that can be pulled from the treasury.