Categories
Cryptocurrency Ethereum Mastering Development

go-ethereum: Return data from contract function

I have a smart contract written in solidity. I deployed the contract to my Ganache network and I can interact with it via go-ethereum using stubs generated by abigen. My function returns a uint256, what I want to do is see this contract return data via the stubs I have generated with abigen. I can […]

Categories
Cryptocurrency Ethereum Mastering Development

problem help me gas * price + value

i see all topic , but yet not slove my problem . please help me <pre> var EthereumTx=require(‘ethereumjs-tx’).Transaction const Web3=require(‘web3’) const web3 = new Web3(‘https://rinkeby.infura.io/v3/85xxxxxxxxxxx2af25e829b8d9df‘) const account1=’0xbd77caf08fe49d3f5aef6f83fc23b8d2129b468f’ const main = async () => { const count = await web3.eth.getTransactionCount(‘0xxxxxxxxxxxxxxxf5aef6f83fc23b8d2129b468f’); const nonce = web3.utils.toHex(count); const block = await web3.eth.getBlock(‘latest’); const gasLimit = web3.utils.toHex(3000000) const gasPrice = […]

Categories
Cryptocurrency Development Ethereum

accceptOwnership Tx “Returned error: nonce too low”, though getTransactionCount(account) gives a nonce that looks ok

Could anyone let me know what is wrong with the code below? Before executing the below code, transferOwnership(newOwner) went through successfully. And then, I execute the below code, “Error: Returned error: nonce too low. getTransactionCount(newOwner) returns ‘0x7’. Metamask account has been also altered to the new owner. myContract.methods.newOwner().call() .then((newOwner)=>{ var txAcceptOwnership=myContract.methods.acceptOwnership(); var encodedTx = txAcceptOwnership.encodeABI(); […]