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

1 Answer 1


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.

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.