nebulasio / wiki

This repository is out of date, please check the new wiki:
http://wiki.nebulas.io/en/latest/
GNU General Public License v3.0
421 stars 154 forks source link

contract check failed #132

Closed puncleV closed 6 years ago

puncleV commented 6 years ago

Hello! Created contract, just for test:

class aaa {init(){const a =5; this.a=a}b(zzz){console.log('zzz' + zzz)}};module.exports=aaa;

and get next error: {"error":"contract check failed"}

What is wrong?

yupnano commented 6 years ago

What do you mean by saying "created contract "?with which command or which tool? Please provide more detailed information.

puncleV commented 6 years ago

@yupnano ty for answer!

I used curl request like here, from 'Example of deploying a smart contract using curl'

Just replace source with mine.

Received answer after deploy:

{"result":{"txhash":"dca3f0fd846bb6dd037eafc4ba569cf737c9f255d3b880c9dcff881fb0db2995","contract_address":"n1gNRTMZggEJa1zJ4dkRF5fsa8EC78vB2zn"}}
yupnano commented 6 years ago

Sure,you have got your contract deployed. But how did you got the error of "contract check failed"?

puncleV commented 6 years ago

From 'For example, execute save() method of the smart contract:' Just change "save" for my function name.

yupnano commented 6 years ago

You should use the contract addrrss that you have just deployed. "contract_address":"n1gNRTMZggEJa1zJ4dkRF5fsa8EC78vB2zn"}

puncleV commented 6 years ago

Ofc, yeah, i changed it too...

But now, after reboot it works fine, ty!

Problem was in bad nonce; I sent it much bigger than needed