iost-official / go-iost

Official Go implementation of the IOST blockchain
https://developers.iost.io/
GNU Lesser General Public License v3.0
565 stars 112 forks source link

error: token iost exceed amountLimit in ab #1102

Closed tvrc4m closed 5 years ago

tvrc4m commented 5 years ago

call deposit in contract. blockchain.deposit(player, _betAmount, "bet")

Transaction has been sent. The transaction hash is: 2aHJ4FDGPa7vZA1XYKi6hMgF5mSGwHgeaL84hZphhQaP Checking transaction receipt... Transaction receipt: { "txHash": "2aHJ4FDGPa7vZA1XYKi6hMgF5mSGwHgeaL84hZphhQaP", "gasUsage": 56841, "ramUsage": { }, "statusCode": "RUNTIME_ERROR", "message": "running action Action{Contract: ContractCVxupPS8NQTrNZ97kT71gGvCZU4F5edkdYjoSPgcfeV2, ActionName: bet, Data: [\"game... error: token iost exceed amountLimit in abi. need 10", "returns": [ ], "receipts": [ ] } Transaction executed err

ziranliu commented 5 years ago

If a function of contract takes user's token, you have to declare amount limit in the abi, just like: https://github.com/iost-official/go-iost/blob/master/config/genesis/contract/vote_producer.js.abi#L108

tvrc4m commented 5 years ago

@ziranliu thanks you. it's ok how auto generate it ? "amountLimit": [{ "token": "iost", "val": "unlimited" }],

ziranliu commented 5 years ago

@ziranliu thanks you. it's ok how auto generate it ? "amountLimit": [{ "token": "iost", "val": "unlimited" }],

You have to add it in abi manually

tvrc4m commented 5 years ago

ok. and iost support delay transaction?

ziranliu commented 5 years ago

ok. and iost support delay transaction?

no