Concept: For what the bank module does and when to use it, see Bank module.
Abstract
Thex/bank module in Stable SDK only provides basic token management features.
You can transfer any token to any account without restriction, but you cannot delegate another account to transfer your tokens.
For these reasons, the bank precompiled contract offers additional authorization and delegation features on top of the existing x/bank module in Stable SDK.
Contents
Concepts
This precompiled contract provides ERC-20 standard methods - such astransfer and balanceOf for transfer and transferFrom, approve and allowance for delegation. You can call these methods directly without registering the contract address.
However, the x/precompile module must whitelist and register the contract address before you can use the mint and burn methods.
x/precompile module whitelist, you must submit a governance proposal.
Configuration
The contract address and gas cost are predefined.Contract address
0x0000000000000000000000000000000000001003for STABLE (governance token)
Methods
mint
Mints requested amount of new tokens and transfer to the account.
The amount of tokens to be minted must be greater than zero.
PrecompiledBankMint is emitted when the tokens are successfully minted and transferred to the account.
NOTE:
- Governance token minting is prohibited.
- Caller contracts calling the mint method must be registered in x/precompile module.
Inputs
Outputs
burn
Burns requested amount of tokens from the account.
The amount of tokens to be burned must be greater than zero.
PrecompiledBankBurn is emitted when the tokens are successfully burned.
NOTE:
- Burning governance token is prohibited.
- Caller contracts calling the burn method must be registered in x/precompile module.
Inputs
Outputs
transfer
Transfers requested amount of tokens from sender to the recipient.
Token must be set sendable. The amount of tokens to be transferred must be greater than zero.
PrecompiledBankTransfer is emitted when the tokens are successfully transferred.
Inputs
Outputs
transferFrom
Transfers requested amount of tokens from owner to recipient by authorized spender within the limits of the allowance.
Token must be set sendable.
The amount of tokens to be transferred must be greater than zero and less than or equal to the current allowance.
PrecompiledBankTransfer is emitted when the tokens are successfully transferred.
Inputs
Outputs
multiTransfer
Transfers tokens from single account to multiple accounts.
Token must be set sendable.
The amount of tokens to be transferred to each recipient must be greater than zero.
PrecompiledBankTransfer is emitted per each recipient when the tokens are successfully transferred.
Inputs
Outputs
approve
Authorizes a spender to transfer tokens from the owner’s account.
The amount of tokens to be authorized must be greater than zero.
PrecompiledBankApproval is emitted when the authorization is successfully set.
Inputs
Outputs
revoke
Revokes the authorization of spender for transferring tokens from owner.
PrecompiledBankRevoke is emitted when the authorization is successfully revoked.
Inputs
Outputs
balanceOf
Returns balance of tokens from the account.
Inputs
Outputs
totalSupply
Returns total supply of tokens.
Inputs
noneOutputs
allowance
Returns the amount which spender is still allowed to withdraw from owner.
Inputs
Outputs
Events
All events emitted from this precompiled contract are prefixed withPrecompiledBank.
To avoid ambiguity, token contract calling this precompiled contract should avoid using event names with the same prefix.

