1

Hi I am new community member and learning smart contract and trying to develop a forked project.

When I try to migrate my contract to kovan network, I have this error. I am not sure what I am missing or what is wrong but need some assistance about that.

> 5_rewarddistribution.js
> ======================= kovan setting distributor
> 
> Error: Transaction has been reverted by the EVM: {   "blockHash":
> "0x98a6eb0ccf967e5954204d954af81be6b6b633d753f68c1e3adbf56adffce17c", 
> "blockNumber": 23512584,   "contractAddress": null,  
> "cumulativeGasUsed": 267759,   "from":
> "0x45157cf4fe9b85fc7e44ce549f290741db7ffa54",   "gasUsed": 22712,  
> "logsBloom":
> "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
> "status": false,   "to": "0x71644a2946cf3f19c63368ea239590fc602d83d5",
> "transactionHash":
> "0x82eae9d51b76471973ad7cd04ed476d3d16ed7866a1ae15828281e0f59f98e12", 
> "transactionIndex": 2,   "events": {} }
>     at Object.TransactionError (C:\Users\bruno\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\web3-core-helpers\src\errors.js:93:1)
>     at Object.TransactionRevertedWithoutReasonError (C:\Users\bruno\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\web3-core-helpers\src\errors.js:105:1)
>     at C:\Users\bruno\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\web3-eth\node_modules\web3-core-method\src\index.js:482:1
>     at runMicrotasks (<anonymous>)
>     at processTicksAndRejections (internal/process/task_queues.js:93:5) 
> Truffle v5.1.66 (core: 5.1.66)
> Node v14.15.4
    console.log("setting distributor");
    await Promise.all([
        eth_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
                    yfi_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
        ycrv_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
                    mkr_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
        snx_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
        comp_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
        link_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
        yfii_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
                    ycrv_pool.methods.setRewardDistribution("0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      ]);

    let twenty = web3.utils.toBN(10**3).mul(web3.utils.toBN(10**18)).mul(web3.utils.toBN(200));
    let one_five = web3.utils.toBN(10**3).mul(web3.utils.toBN(10**18)).mul(web3.utils.toBN(1500));

    console.log("transfering and notifying");
    console.log("eth");
    await Promise.all([
      oliv.transfer(OLIV_ETHPool.address, twenty.toString()),
      //oliv.transfer(OLIV_uAMPLPool.address, twenty.toString()),
      oliv.transfer(OLIV_YFIPool.address, twenty.toString()),
      //oliv.transfer(OLIV_LENDPool.address, twenty.toString()),
      oliv.transfer(OLIV_MKRPool.address, twenty.toString()),
      oliv.transfer(OLIV_SNXPool.address, twenty.toString()),
      oliv.transfer(OLIV_COMPPool.address, twenty.toString()),
      oliv.transfer(OLIV_LINKPool.address, twenty.toString()),
      oliv.transfer(OLIV_YFIIPool.address, twenty.toString()),
      //oliv.transfer(OLIV_KNCPool.address, twenty.toString()),
      oliv._setIncentivizer(OLIVIncentivizer.address),
    ]);

    await Promise.all([
      eth_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
                yfi_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
                mkr_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
      snx_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
      comp_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
      link_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
      yfii_pool.methods.notifyRewardAmount(twenty.toString()).send({from:"0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54"}),
          
      // incentives is a minter and prepopulates itself.
      ycrv_pool.methods.notifyRewardAmount("0").send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 500000}),
    ]);

    await Promise.all([
      eth_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      //ampl_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      yfi_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      //lend_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      mkr_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      snx_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      comp_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      link_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      yfii_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      //knc_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      ycrv_pool.methods.setRewardDistribution(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
    ]);
    await Promise.all([
      eth_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      yfi_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      mkr_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      snx_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      comp_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      link_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      yfii_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
      ycrv_pool.methods.transferOwnership(Timelock.address).send({from: "0x45157cf4FE9B85Fc7e44ce549f290741Db7FFa54", gas: 100000}),
    ]);
  }

  await Promise.all([
    oliv._setPendingGov(Timelock.address),
    yReserves._setPendingGov(Timelock.address),
    yRebaser._setPendingGov(Timelock.address),
  ]);

  await Promise.all([
      tl.executeTransaction(
        OLIVProxy.address,
        0,
        "_acceptGov()",
        "0x",
        0
      ),

      tl.executeTransaction(
        OLIVReserves.address,
        0,
        "_acceptGov()",
        "0x",
        0
      ),

      tl.executeTransaction(
        OLIVRebaser.address,
        0,
        "_acceptGov()",
        "0x",
        0
      ),
  ]);
  await tl.setPendingAdmin(Gov.address);
  await gov.__acceptAdmin();
  await gov.__abdicate();
}

1 Answer 1

1

Check your smart contract "owner" property. I believe it's 0x0000...000 which meant you have to use upgradable contract in a right way.

Here is a discussion about this

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.