StableMastercontract and specifying a collateral. The
StableMastercontract then calls the
SanTokencontract corresponding to the collateral to issue or burn the sanTokens.
sanRate(sanToken exchange rate that is how much of collateral one sanToken is worth) begins at 1 (
BASE_TOKENS), and increases at a rate depending on the transaction fees accumulated and the yield obtained from reserves given to SLPs. For example, after one year the exchange rate might equal 1.1. Each SLP has the same
sanRateand can thus get more collateral out of the same number of sanTokens.
ERC20PermitUpgradeableand on the
SanTokencontract is never interacted directly with by SLPs for mint operations.
SanTokencontract is very similar to the
ERC20BurnableUpgradeable. The contract is upgradeable.
SanTokencontract in another contract will never change even though the code in the contract may change.
stableMaster: Reference to the
StableMastercontract associated to this sanToken
poolManager: Address of the corresponding
PoolManagercontract. Although it is not used in the functions of the contract, this address is stored in order to make sure that there cannot be a shared sanToken for multiple
decimal: Number of decimals used for this ERC20. The number of decimals of sanTokens is equal to the number of decimals of the collateral token that corresponds to it
onlyStableMastermodifier was defined to protect functions which can only be called by the
ERC20BurnableUpgradeablelibrary, owners of sanTokens have the power to completely burn their tokens without getting anything in return.
StableMastercontract. Note that they are not pausable as the functions in the
StableMasterwhich trigger calls to these contracts can be paused.
StableMastercontract mint sanTokens. Only the
StableMastercontract can issue sanTokens, it will typically do so after being requested by a collateral manager receiving collateral through the function
deposit()reserved to SLPs.
account: Address to mint to
amount: Amount to mint
StableMasterwhich performs all the security checks to see for instance if the
burnerwas the initial
amount: Amount of sanTokens to burn from caller
burner: Address to burn from
StableMastercan call this function.
burner: Address to burn from and to redeem collateral to
sender: Address which requested the burn from
amount: Amount of sanTokens to burn