scrtlabs / snip20-reference-impl

This is a reference implementation of the SNIP-20 standard.
Apache License 2.0
55 stars 36 forks source link

Proper way of uploading the contract to the testnet #27

Closed MarkH1994 closed 2 years ago

MarkH1994 commented 2 years ago

Hi everyone,

Currently I'm in the works of running this contract and am having an issue instantiating the contract.

I ran the following commands: make

and next optimize the contract using: docker run --rm -v "$(pwd)":/contract \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ enigmampc/secret-contract-optimizer

Having done this, I start the local testnet: docker run -it --rm \ -p 26657:26657 -p 26656:26656 -p 1337:1337 \ -v $(pwd):/root/code \ --name localsecret ghcr.io/scrtlabs/localsecret

Then, inside the docker (docker exec -it localsecret /bin/bash and run cd code after), I store the contract: secretd tx compute store contract.wasm.gz --from a --gas 1000000 -y --keyring-backend test

Running secretd query compute list-code, no output is obtained. So maybe something goes wrong here.

Nonetheless, trying to instantiate the contract, I run the following command: secretd tx compute instantiate 1 '{"name": "test", "symbol":"TTT", "decimals":10, "prng_seed":"VGVzdA=="}' --label test --from a

This returns the following error: Error: unexpected end of JSON input

Do you know how to resolve this error?

assafmo commented 2 years ago

Are you sure that the store tx succeeded? Maybe you need to increase the gas limit

MarkH1994 commented 2 years ago

Thank you for your fast reply. Indeed, increasing the gas limit resolved this problem.