Governance Functions
Sets the buffer rate percentage that determines how much of each reward goes to the buffer.
function setBuffer(uint256 _buffer) external;
Parameters
The buffer percentage (must be less than BUFFER_DENOMINATOR)
Access Control: only Owner (Keeper)
Updates the token symbol.
function setSymbol(string memory _symbol) external;
Parameters
Access Control: only Owner (Keeper)
withdrawBuffer
Withdraw _amount from Buffer and mint SPAToken shares to _to
function withdrawBuffer(address _to, uint256 _amount) external;
Parameters
Recipient address that will receive newly-minted shares
Access: only Owner (via Keeper)
transferShares
Moves _sharesAmount token shares from the caller's account to the _recipient account.
Note: The _sharesAmount argument is the amount of shares, not tokens.
Parameters
The address to receive the shares
The amount of shares to transfer (not tokens)
Returns
The amount of tokens transferred
transferSharesFrom
Moves _sharesAmount token shares from the _sender account to the _recipient account using the allowance mechanism.
Parameters
The address to transfer shares from
The address to receive the shares
The amount of shares to transfer
Returns
The amount of tokens transferred
Requirements: The caller must have sufficient allowance for the sender's tokens.
mintShares
Mints shares for the specified account and transfers them to that account.
Parameters
The address to mint shares to
The token amount to mint (converted to shares internally)
Access Control: Only callable by the pool contract.
burnShares
Burns shares from the caller's account.
Parameters
The token amount to burn (converted to shares internally)
burnSharesFrom
Burns shares from the specified account using the allowance mechanism.
Parameters
The address to burn shares from
Requirements: The caller must have sufficient allowance for the account's tokens.
Supply Management
addTotalSupply
Increases the total supply of SPAToken by staking rewards and swap fees, with automatic buffer allocation.
Parameters
The amount to add to total supply
Access Control: Only callable by the pool contract.
Behavior:
payFirst pays down any existing buffer bad debt
Allocates a percentage to the buffer based on bufferPercent
Remainder increases the actual total supply
removeTotalSupply
Decreases the total supply of SPAToken due to losses, with options for buffer usage and debt tracking.
Parameters
The amount to remove from total supply
Whether to use buffer funds instead of total supply
Whether to add the amount to buffer bad debt
Access Control: Only callable by the pool contract.
addBuffer
Directly increases the buffer amount without affecting total supply.
Parameters
The amount to add to the buffer
Access Control: Only callable by the pool contract.
sharesOf
Returns the amount of shares owned by an account.
Parameters
The account to query shares for
Returns
The amount of shares owned by the account
getPeggedTokenByShares
Converts a share amount to the corresponding token amount.
Parameters
The amount of shares to convert
Returns
The corresponding token amount
getSharesByPeggedToken
Converts a token amount to the corresponding share amount.
Parameters
The token amount to convert
Returns
The corresponding share amount
Last updated