New answers tagged

2

There is an issue in a way you use HDWalletProvider when configuring development network in truffle-config.js. You should add it like: provider: () => new HDWalletProvider('your mnemonic', 'http://127.0.0.1:7545') For me, it helped. Additional info can be found here.


0

You must put single quotes around it. '0x0000000000000000000000000000000000000000' worked for me Been hunting down that bug for some time ...


1

token.transfer(accounts[3], amount, { 'from': accounts[2], nonce: await web3.eth.getTransactionCount(accounts[2]) }); add the nonce parameter will fixed the problem, it work for me


1

As said by @shane you can run the command with the networkId flag or alternatively you can change your config to '*' to match any id provided by ganache.


1

You can set the ganache-cli network ID by using a flag when running it: ganache-cli --networkId 4447


0

some changes of mine worked, like if need to change storage variable, need to call function without call() and if with call() I felt that perhaps truffle runs the function as just local and temporary only and hence doesn't affects storage variable, that's why returning value was different in subject question. and whenever you felt that the returning value ...


0

Truffle has a debug command that lets you move through your source code. It is not quite easy to use, but still, it is a debug option. See https://www.trufflesuite.com/docs/truffle/getting-started/debugging-your-contracts


0

It seems truffle has lost control over his project, and there are too many conflict between version to version of truffle, used compiler, network type, script adjustment and many conflict, even in latest version, it throws error simply while compiling or deploying, I was forced to degrade version, but with 5.0.10 also there are too many conflict. So in a ...


0

Dear Friend actually truffle developer team has lost control over his project, patching one side creating problem on other side. ( even on their official forum 80% questions are not addressed and in most cases question is for X and reply is for Y ) Now I think they have only one way to start new project with similar goal with fresh and restructured ...


0

Actually many similar questions of mine not answered yet (even at official forum of truffle 80% questions not addressed ), which clearly indicates that either truffle developers have lost control over project means patching one side creating problem on other side, or they leave this project as Orphan, so don't expect any logical clear answer for your ...


1

Function onlyOwnerSetBurningRate is not constant (neither pure nor view). As such, you cannot fetch its return-value from an off-chain call (i.e., the return-value is useful only when you call this function inside a contract). So your usage of .call() here is wrong to begin with. After you remove it, token.onlyOwnerSetBurningRate(1234) will return the ...


0

I'm not sure the version of web3 used in the previous answer by ivicaa. On web3 "v1.0.0-beta.37", multiple values are actually returned in an Object, not an Array. However, since the returned object has properties named with numbers {0: 'value1', 1:'value2'}, the original answer is completely valid, so one can still access the returned values using the ...


1

It bears noticing that web3.utils.keccak256 and web3.utils.sha3 are synonyms, so no point using both. You should use keccak256, if given a choice, because the function it implements is not actually Sha3 as defined in the NIST standard, but rather a different function (an early implemementation of Keccak256, before it was modified for the SHA3 standard). I've ...


Top 50 recent answers are included