AppInstruction::TokenConstructor
with symbol
, total_supply
and decimals
params. In client side you must call the function with both payer account signature, token account signature, and receiver account signature which is very important.owner
field. Instead of using the pair of secret and public key of "on-chain" account to do a thing like transferring token, now manager one "off-chain" account is enough to show the permission of multiple accounts in multiple types of token.AppInstruction::AccountContructor
to the program.approve
, transferFrom
in ERC20, we need Delegation account to realize these. Every time, a holder would like to delegate, or approve, an amount of token to another guy, the holder must create a new Delegation account.delegate
field is quite confused. You should assign to the value of "off-chain" account public key instead of "on-chain" one. The reason for that is for identical API and code style. We want to use "off-chain" accounts to manager all token communication, then delegate being a "off-chain" account public key is reasonable. Finally, amount
is the amount of token that the owner allows the delegate to legally spent.Token
and Account
when we used to call Constructor
to initialize these account types, we want to maintain the identical API as ERC20. Therefore, we will use approve
function to represent the meaning of DelegationConstructor
.total_supply
and decimals
is indispensable in data field.total_supply
will be transferred to the receiver.