0

I'm using the following contract with all the dependencies.

MasteringEthereum/code/auction_dapp/backend/contracts/ERC721/ERC721Token.sol

When deployed in remix the contract functions work fine, all of them execute and the data is stored in the correct places (i.e arrays and mappings) Although when I deploy to a local geth --dev console the following functions execute but the state of the contract does not change

erc721token.mint(acct1, 9000 {from: acct1})

erc721token.totalSupply()

erc721token.tokenByIndex([0])

erc721token.balanceOf(acct1)

erc721token.exists(9000) 

erc721token.ownerOf(9000)

???

Any help would be fantastic.

1
  • 1
    Did you check the transaction receipt to verify the execution status? Remix does calculate the transaction gas estimation, but geth console does not and it will use a default gas that might not be enough to execute the transaction. Try setting an explicit gas limit { gas: 1000000, from: acc1 }.
    – Ismael
    Jun 1, 2018 at 18:03

1 Answer 1

0

Thanks Ismael. The problem is fixed with your suggestion.

Problem was

erc721token.mint(acct1, 9000 {from: acct1})

transaction was not minting a new token, even though a transaction was mined.

gasUsed: 100000,

deedrepository.mint(eth.accounts[0], 1000, {gas: 1000000, from: eth.accounts[0]})

gasUsed: 157938,

calling the same function with a higher gas limit as a transaction parameter solved to problem because the function needs a higher gas price for the computation be run complete by the EVM.

NOTE: "0x0" in transaction receipt indicates transaction failure. "0x1" in transaction receipt in transaction success.

1
  • 1
    For people who come across this answer, I think you mean "higher gas limit" rather than "higher gas price". Jun 3, 2018 at 3:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.