⚖️AgToken - Stablecoin Contracts
Angle's Protocol Stablecoins
Last updated
Angle's Protocol Stablecoins
Last updated
Contract Name: AgToken
ABI:
agTokens are Angle's protocol stablecoins. Depending on the stablecoin, different smart contracts may have minting rights on agTokens.
For some tokens, the FlashLoan
contract may have minting right on the token, just like some VaultManager
contracts associated to the Borrowing Module.
The implementation described here is specific to Ethereum mainnet. agToken implementations on sidechains have a different implementation, such that the ABI of their corresponding contract is the following:
Implements IAgToken
and ERC20PermitUpgradeable
. This contract is upgradeable.
Depending on the implementation deployed, here are some of the usual parameters found in AgToken
contracts
stableMaster
: Reference to the StableMaster
contract associated to this agToken. This is no longer used and was useful when the protocol's Core module was still being used.
treasury
: Reference to the Treasury
contract associated to this agToken. This concerns AgTokens which can be minted from Angle Borrowing Module
isMinter
: In the Borrowing Module, maps an address to whether it has the minting right on the AgToken
.
All standard EIP20 methods are implemented, such as balanceOf()
, transfer()
, transferFrom()
, approve()
, totalSupply()
, etc.
The implementation of these methods is derived from OpenZeppelin's library.
Burns the amount of agToken on behalf of another account without redeeming collateral back anywhere
Parameters
amount
: Amount to burn
The following functions can only be called by approved minter contracts.
Lets a VaultManager
, if initialized the FlashLoan
contract or a whitelisted address mint agTokens
Parameters:
account
: Address to mint to
amount
: Amount to mint
Burns amount
tokens from a burner
address. This method is to be called by any contract with a minting right on the AgToken
after being requested to do so by an address willing to burn tokens from its address
Parameters:
amount
: Amount of tokens to burn
burner
: Address to burn from
Burns amount
tokens from a burner
address after being asked to by sender
. This method is to be called by any contract with a minting right on the token after being requested to do so by a msg.sender
address willing to burn tokens from another sender
address
The method checks the allowance between the sender
and the burner
.
Parameters:
amount
: Amount of tokens to burn
burner
: Address to burn from
sender
: Address which requested the burn from burner
Allows a user to permit another account (or contract) to use their funds using a signed message. This enables gas-less transactions and single approval/transfer transactions.
Parameters:
owner
: The owner of the funds
spender
: The spender of the funds
value
: The amount the spender
is permitted to use
deadline
: The deadline timestamp that the permit is valid. Use type(uint256).max
for no deadline
v
: Signature Parameter
r
: Signature Parameter
s
: Signature Parameter
There are some functions which are available to the Treasury
contract to perform some governance actions. Generally, the Treasury
will do so after being requested by governance.
addMinter
: to grant the minter right to an address.
removeMinter
: to remove the minter right to an address. A minter can self-revoke itself.
setTreasury
: to change the reference to the treasury contract