This is the technical reference related to the interface for Super Tokens.
Super Token deployments work in a proxy pattern with the original implementation being comon between all super tokens for each chain. The implementation address for the SuperToken is different for each network and can be found in the SuperTokenFactory at the method getSuperTokenLogic.
To get the addresses of all the SuperTokenFactory contracts, you can use the Tagomi Explorer, section Protocol.
In order to interact with any contract satistying the ISuperToken interface, you can use the following ABI:
chevron-right Click here to show ISuperToken ABIhashtag
Copy function initialize(
contract IERC20 underlyingToken,
uint8 underlyingDecimals,
string n,
string s
)
external Initialize the contract
Parameters arrow-up-right
Initialize the contract with an admin
Parameters arrow-up-right
Only the current admin can call this function if admin is address(0), it is implicitly the host address
Parameters arrow-up-right
Changes the admin for the SuperToken
Returns the admin address for the SuperToken
Returns the name of the token.
Returns the symbol of the token, usually a shorter version of the name.
_Returns the number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).
Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value ERC20 uses, unless setupDecimals is called.
Note arrow-up-right
SuperToken always uses 18 decimals.
This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including IBEP20-balanceOf and IBEP20-transfer.
See IBEP20-totalSupply.
Returns the amount of tokens owned by an account ( owner ).
Parameters arrow-up-right
Moves amount tokens from the caller's account to recipient .
Parameters arrow-up-right
Return Values arrow-up-right
Returns Success a boolean value indicating whether the operation succeeded.
Emits arrow-up-right
a BEP20 Transfer event.
Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom. This is zero by default.
Parameters arrow-up-right
This value changes when approve or transferFrom are called.
Sets amount as the allowance of spender over the caller's tokens.
Parameters arrow-up-right
Return Values arrow-up-right
Returns Success a boolean value indicating whether the operation succeeded.
Note arrow-up-right
Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards
Emits arrow-up-right
an Approval event.
Moves amount tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller's allowance.
Parameters arrow-up-right
Return Values arrow-up-right
Returns Success a boolean value indicating whether the operation succeeded.
Emits arrow-up-right
a Transfer event.
_Atomically increases the allowance granted to spender by the caller.
This is an alternative to approve that can be used as a mitigation for problems described in IBEP20-approve._
Parameters arrow-up-right
Emits arrow-up-right
an Approval event indicating the updated allowance.
@custom:requirements
`spender` cannot be the zero address.
_Atomically decreases the allowance granted to spender by the caller.
This is an alternative to approve that can be used as a mitigation for problems described in IBEP20-approve._
Parameters arrow-up-right
Emits arrow-up-right
an Approval event indicating the updated allowance.
@custom:requirements
`spender` cannot be the zero address.
`spender` must have allowance for the caller of at least `subtractedValue`.
Returns the smallest part of the token that is not divisible. This means all token operations (creation, movement and destruction) must have amounts that are a multiple of this number.
Note arrow-up-right
For super token contracts, this value is always 1
_Moves amount tokens from the caller's account to recipient.
If send or receive hooks are registered for the caller and recipient, the corresponding functions will be called with userData and empty operatorData. See IERC777Senderarrow-up-right and IERC777Recipientarrow-up-right ._
Parameters arrow-up-right
Emits arrow-up-right
a Sent event.
@custom:requirements
the caller must have at least `amount` tokens.
`recipient` cannot be the zero address.
if `recipient` is a contract, it must implement the IERC777Recipient interface.
_Destroys amount tokens from the caller's account, reducing the total supply and transfers the underlying token to the caller's account.
If a send hook is registered for the caller, the corresponding function will be called with userData and empty operatorData. See IERC777Sender._
Parameters arrow-up-right
Emits arrow-up-right
a Burned event.
@custom:requirements
the caller must have at least `amount` tokens.
_Returns true if an account is an operator of tokenHolder. Operators can send and burn tokens on behalf of their owners. All accounts are their own operator.
See operatorSend and operatorBurn._
Parameters arrow-up-right
_Make an account an operator of the caller.
See isOperatorFor._
Parameters arrow-up-right
Emits arrow-up-right
an AuthorizedOperator event.
@custom:requirements
`operator` cannot be calling address.
_Revoke an account's operator status for the caller.
See isOperatorFor and defaultOperators._
Parameters arrow-up-right
Emits arrow-up-right
a RevokedOperator event.
@custom:requirements
`operator` cannot be calling address.
_Returns the list of default operators. These accounts are operators for all token holders, even if authorizeOperator was never called on them.
This list is immutable, but individual holders may revoke these via revokeOperator, in which case isOperatorFor will return false._
_Moves amount tokens from sender to recipient. The caller must be an operator of sender.
If send or receive hooks are registered for sender and recipient, the corresponding functions will be called with userData and operatorData. See IERC777Sender and IERC777Recipient._
Parameters arrow-up-right
Emits arrow-up-right
a Sent event.
@custom:requirements
`sender` cannot be the zero address.
`sender` must have at least `amount` tokens.
the caller must be an operator for `sender`.
`recipient` cannot be the zero address.
if `recipient` is a contract, it must implement the IERC777Recipient interface.
_Destroys amount tokens from account, reducing the total supply. The caller must be an operator of account.
If a send hook is registered for account, the corresponding function will be called with userData and operatorData. See IERC777Sender._
Parameters arrow-up-right
Emits arrow-up-right
a Burned event.
@custom:requirements
`account` cannot be the zero address.
`account` must have at least `amount` tokens.
the caller must be an operator for `account`.
_Mint new tokens for the account If userData is not empty, the tokensReceived hook is invoked according to ERC777 semantics.
@custom:modifiers
Parameters arrow-up-right
_Burn existing tokens for the account If userData is not empty, the tokensToSend hook is invoked according to ERC777 semantics.
@custom:modifiers
Parameters arrow-up-right
_Transfer amount tokens from the sender to recipient. If spender isn't the same as sender, checks if spender has allowance to spend tokens of sender.
@custom:modifiers
Parameters arrow-up-right
_Give spender, amount allowance to spend the tokens of account.
@custom:modifiers
Parameters arrow-up-right
Transfer all available balance from msg.sender to recipient
Parameters arrow-up-right
Return the underlying token contract
Return Values arrow-up-right
Return the underlying token decimals
Return Values arrow-up-right
Underlying token decimals
Return the underlying token conversion rate
Parameters arrow-up-right
Number of tokens to be upgraded (in 18 decimals)
Return Values arrow-up-right
The underlying token amount after scaling
The super token amount after scaling
Upgrade ERC20 to SuperToken.
Parameters arrow-up-right
Number of tokens to be upgraded (in 18 decimals)
Note arrow-up-right
It will use `transferFrom` to get tokens. Before calling this function you should `approve` this contract
Upgrade BEP20 to SuperToken and transfer immediately
Parameters arrow-up-right
The account to receive upgraded tokens
Number of tokens to be upgraded (in 18 decimals)
User data for the TokensRecipient callback
Note arrow-up-right
It will use `transferFrom` to get tokens. Before calling this function you should `approve` this contract
@custom:warning
there is potential of reentrancy IF the "to" account is a registered ERC777 recipient. @custom:requirements
if `userData` is NOT empty AND `to` is a contract, it MUST be a registered ERC777 recipient otherwise it reverts.
Downgrade SuperToken to ERC20. It will call transfer to send tokens
Parameters arrow-up-right
Number of tokens to be downgraded
Downgrade SuperToken to BEP20 and transfer immediately
Parameters arrow-up-right
The account to receive downgraded tokens
Number of tokens to be downgraded (in 18 decimals)
Perform BEP20 approve by host contract.
Parameters arrow-up-right
The account owner to be approved.
The spender of account owner's funds.
Number of tokens to be approved.
@custom:modifiers
Parameters arrow-up-right
Parameters arrow-up-right
Perform ERC20 transferFrom by host contract.
Parameters arrow-up-right
The account to spend sender's funds.
The account where the funds is sent from.
The recipient of the funds.
Number of tokens to be transferred.
@custom:modifiers
Perform ERC777 send by host contract.
Parameters arrow-up-right
The account where the funds is sent from.
The recipient of the funds.
Number of tokens to be transferred.
Arbitrary user inputted data
@custom:modifiers
Upgrade ERC20 to SuperToken by host contract.
Parameters arrow-up-right
The account to be changed.
Number of tokens to be upgraded (in 18 decimals)
@custom:modifiers
Downgrade ERC20 to SuperToken by host contract.
Parameters arrow-up-right
The account to be changed.
Number of tokens to be downgraded (in 18 decimals)
@custom:modifiers
Parameters arrow-up-right
Token upgrade event
Parameters arrow-up-right
Account where tokens are upgraded to
Amount of tokens upgraded (in 18 decimals)
Token downgrade event
Parameters arrow-up-right
Account whose tokens are downgraded
Amount of tokens downgraded
Constant Outflow NFT proxy created event
Parameters arrow-up-right
contract IConstantOutflowNFT
constant outflow nft address
Constant Inflow NFT proxy created event
Parameters arrow-up-right
contract IConstantInflowNFT
constant inflow nft address
Pool Admin NFT proxy created event
Parameters arrow-up-right
Pool Member NFT proxy created event
Parameters arrow-up-right
SUPER_TOKEN_CALLER_IS_NOT_OPERATOR_FOR_HOLDER
arrow-up-right SUPER_TOKEN_INFLATIONARY_DEFLATIONARY_NOT_SUPPORTED
arrow-up-right