SanToken.sol
deposit()
or withdraw()
in a StableMaster
contract and specifying a collateral. The StableMaster
contract then calls the SanToken
contract 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 sanRate
and can thus get more collateral out of the same number of sanTokens.ERC20PermitUpgradeable
and on the ERC20BurnableUpgradeable
code.SanToken
contract is never interacted directly with by SLPs for mint operations.SanToken
contract is very similar to the AgToken
contract.ISanToken
, ERC20PermitUpgradeable
, ERC20BurnableUpgradeable
. The contract is upgradeable.SanToken
contract in another contract will never change even though the code in the contract may change.stableMaster
: Reference to the StableMaster
contract associated to this sanTokenpoolManager
: Address of the corresponding PoolManager
contract. 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 PoolManager
contractsdecimal
: 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 itonlyStableMaster
modifier was defined to protect functions which can only be called by the StableMaster
.balanceOf()
, transfer()
, transferFrom()
, approve()
, totalSupply()
, etc.ERC20BurnableUpgradeable
library, owners of sanTokens have the power to completely burn their tokens without getting anything in return.StableMaster
contract. Note that they are not pausable as the functions in the StableMaster
which trigger calls to these contracts can be paused.StableMaster
contract mint sanTokens. Only the StableMaster
contract 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 toamount
: Amount to mintStableMaster
which performs all the security checks to see for instance if the burner
was the initial msg.sender
amount
: Amount of sanTokens to burn from callerburner
: Address to burn fromStableMaster
can call this function.burner
: Address to burn from and to redeem collateral tosender
: Address which requested the burn from burner
amount
: Amount of sanTokens to burn