decimalsparams. In client side you must call the function with both payer account signature, token account signature, and receiver account signature which is very important.
ownerfield. 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::AccountContructorto the program.
transferFromin 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.
delegatefield 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,
amountis the amount of token that the owner allows the delegate to legally spent.
Accountwhen we used to call
Constructorto initialize these account types, we want to maintain the identical API as ERC20. Therefore, we will use
approvefunction to represent the meaning of
decimalsis indispensable in data field.
total_supplywill be transferred to the receiver.