sagargopale

Hello,
I was following the ethereum staking app project in Certified Blockchain Developer training.
I am getting the following error. The details are below.

Error: Returned error: VM Exception while processing transaction: revert -- Reason given: Panic: Arithmetic overflow.

I am getting this error at line no 15 in below code. This is 2_deploy_contracts.js. How to pass the number with 18 zeros to the transfer function?

const Tether = artifacts.require("Tether");
const DummyToken = artifacts.require("DummyToken");
const StakingDapp = artifacts.require("StakingDapp");
module.exports = async (deployer, network, accounts) => {
    await deployer.deploy(Tether);
    const tetherToken = await Tether.deployed();
    await deployer.deploy(DummyToken);
    const dummyToken = await DummyToken.deployed();
    await deployer.deploy(StakingDapp, dummyToken.address, tetherToken.address);
    const stakingDapp = await StakingDapp.deployed();
    await dummyToken.transfer(stakingDapp.address, '1000000000000000000000000');
    await tetherToken.transfer(accounts[1], '100000000000000000000');
};

 

Reply 0 0
sagargopale

Update in post as it was not allowing me to edit:

By line no 15, I mean the below line.

wait dummyToken.transfer(stakingDapp.address, '1000000000000000000000000');
Reply 0 0
Reply