TransWikia.com

Open Zeppelin TokenTimeLock - gas required exceeds allowance (10000000) or always failing transaction

Ethereum Asked by Barney Chambers on December 11, 2020

I am creating an ERC20 contract using OpenZeppelin, to lock up my ERC20 tokens for a specific period of time. I am trying to deploy this contract onto the Rinkeby test network through remix.ethereum.org. When I try to deploy this contract, I receive an error message.

gas required exceeds allowance (10000000) or always failing transaction

Does my contract have an error in it? What would cause this error? Here is my code:

pragma solidity ^0.6.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/IERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/TokenTimelock.sol";

contract MyTokenTimelock is TokenTimelock {
    constructor () public TokenTimelock(
        IERC20(0x974338b5d2F8924eeB4169ab19cFbc7266e46254), // token
        0x002FaCf5B2e8441c7ECb4eb6dCfD9C7b46320c97, // beneficiary
        1599557854) {
    }
}

The TokenTimelock.sol code can be found here

One Answer

Have a look at the code you shared. There's only one line with a revert. And this is also the cause for your revert. The releaseTime you send of 1599557854 is already in the past, you can use https://www.unixtimestamp.com/ for conversions.

Correct answer by Markus - soliditydeveloper.com on December 11, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP