New answers tagged

0

To update an artifact, you can simply recompile the contract. But deployed smart contracts are immutable. That's their beauty. If you don't want to redeploy the contract, why you want to recompile it? You cannot simply update the artifact (recompile) and expect the deployed contract to update. Edit: The artifacts (also called ABI) are results of compilation ...


0

This is the code syntax I always use in JS for HDWallet Provider. Works fine every time. provider: () => new HDWalletProvider(secret, "http://IP_address:Port"), Note: I use http, not http(s)


0

We have to send a tx object which contains a from parameter like so: const WETH = artifacts.require("WETH") const USDC = artifacts.require("USDC") module.exports = function (deployer, network, accounts) { deployer.deploy(WETH, 2000000000000000000n, {from : accounts[0]}) deployer.deploy(USDC, 50000000000000000000n, {from : ...


1

from truffle develop you could try something like let c = await MyContract.deployed() await c.goalScored('a','b') let events = await c.getPastEvents('Score',{ fromBlock:0, toBlock:'latest'}) events furthermore, if you need ALL events, you could use c.getPastEvents('allEvents',{ fromBlock:0, toBlock:'latest'}) full truffle develop input: migrate let c = ...


0

Here is what I did to solve my problem: Change dependency of hdwallet-provider from 1.0.17 to 1.4.0. Relace the following line in package.json: "truffle-hdwallet-provider": "1.0.17" To "@truffle/hdwallet-provider": "^1.4.0" You won't get the error anymore if you have the same issue! David


1

15000000000000000000 is well within uint256 boundaries, what type did you set for it? If its uint32 or less the overflow is normal. Also please when your code throws an error include it directly in your question, it makes answering you way easier.


0

I had the very same problem. 1.5 hours later, I realized that I had copied and pasted let DappToken = artifacts.require('./DappTokenSale.sol'); let DappTokenSale = artifacts.require('./DappTokenSale.sol'); The error was then hidden in the error stack and was something along the lines of "tokenInstance.transfer() is not a function." I corrected the ...


Top 50 recent answers are included