Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x64385E73ffFf752FE8aB710CE38ce38795Bc3F12
Balance 0 ETH
Nonce 1
Code Size 3784 bytes
Indexed Transactions 0 (1 on-chain, 0.7% indexed)
External Etherscan · Sourcify

Contract Bytecode

3784 bytes
0x608060405234801561001057600080fd5b5060043610610107576000357c010000000000000000000000000000000000000000000000000000000090048063766e33f4116100a9578063b2001e1811610083578063b2001e18146101d2578063c4d66de8146101f8578063d82ce19a1461021e578063f2fde38b1461022657610107565b8063766e33f41461018a5780638da5cb5b146101925780638f32d59b146101b657610107565b80632f8ae83a116100e55780632f8ae83a1461016a5780634451d89f1461017257806347dedcdd1461017a578063715018a61461018257610107565b8063019e27291461010c5780630d92e3e8146101485780631f8db26814610162575b600080fd5b6101466004803603608081101561012257600080fd5b50803590602081013590600160a060020a036040820135811691606001351661024c565b005b610150610339565b60408051918252519081900360200190f35b61015061033f565b610150610345565b61014661034b565b61015061060a565b610146610610565b6101506106c3565b61019a6106c9565b60408051600160a060020a039092168252519081900360200190f35b6101be6106d9565b604080519115158252519081900360200190f35b610146600480360360208110156101e857600080fd5b5035600160a060020a03166106ff565b6101466004803603602081101561020e57600080fd5b5035600160a060020a031661093c565b610150610a3e565b6101466004803603602081101561023c57600080fd5b5035600160a060020a0316610a8e565b600054610100900460ff16806102655750610265610af6565b80610273575060005460ff16155b6102b15760405160e560020a62461bcd02815260040180806020018281038252602e815260200180610e66602e913960400191505060405180910390fd5b600054610100900460ff161580156102dc576000805460ff1961ff0019909116610100171660011790555b60668590556068849055606b805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790556103173361093c565b61032083610afc565b8015610332576000805461ff00191690555b5050505050565b606a5481565b60665481565b60695481565b6067541580159061035d575060675442115b6103b1576040805160e560020a62461bcd02815260206004820152601460248201527f486173206e6f742079657420737461727465642e000000000000000000000000604482015290519081900360640190fd5b606754610408576040805160e560020a62461bcd02815260206004820152601460248201527f486173206e6f742079657420737461727465642e000000000000000000000000604482015290519081900360640190fd5b6000610412610a3e565b9050600061043d610430606854606954610bad90919063ffffffff16565b839063ffffffff610bdb16565b90506000610456606a5483610c3790919063ffffffff16565b606b546040805160e060020a6370a0823102815230600482015290519293508392600160a060020a03909216916370a0823191602480820192602092909190829003018186803b1580156104a957600080fd5b505afa1580156104bd573d6000803e3d6000fd5b505050506040513d60208110156104d357600080fd5b5051101561055857606b546040805160e060020a6370a082310281523060048201529051600160a060020a03909216916370a0823191602480820192602092909190829003018186803b15801561052957600080fd5b505afa15801561053d573d6000803e3d6000fd5b505050506040513d602081101561055357600080fd5b505190505b606a5461056b908263ffffffff610c7916565b606a55606b54606c54604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b1580156105e057600080fd5b505af11580156105f4573d6000803e3d6000fd5b505050506040513d602081101561033257600080fd5b60685481565b6106186106d9565b61066c576040805160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b603354604051600091600160a060020a0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36033805473ffffffffffffffffffffffffffffffffffffffff19169055565b60675481565b603354600160a060020a03165b90565b603354600090600160a060020a03166106f0610cd6565b600160a060020a031614905090565b6107076106d9565b61075b576040805160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754156107b3576040805160e560020a62461bcd02815260206004820152601460248201527f48617320616c726561647920737461727465642e000000000000000000000000604482015290519081900360640190fd5b606b546040805160e060020a6370a082310281523060048201529051600160a060020a03909216916370a0823191602480820192602092909190829003018186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d602081101561082b57600080fd5b5051610881576040805160e560020a62461bcd02815260206004820152601d60248201527f4d757374206861766520736f6d65206c6964206465706f73697465642e000000604482015290519081900360640190fd5b606c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117909155606b546040805160e060020a6370a08231028152306004820152905191909216916370a08231916024808301926020929190829003018186803b1580156108f457600080fd5b505afa158015610908573d6000803e3d6000fd5b505050506040513d602081101561091e57600080fd5b5051606955610936426201518063ffffffff610c7916565b60675550565b600054610100900460ff16806109555750610955610af6565b80610963575060005460ff16155b6109a15760405160e560020a62461bcd02815260040180806020018281038252602e815260200180610e66602e913960400191505060405180910390fd5b600054610100900460ff161580156109cc576000805460ff1961ff0019909116610100171660011790555b6033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384811691909117918290556040519116906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015610a3a576000805461ff00191690555b5050565b60006067544211610a51575060006106d6565b610a896001610a7d606654610a7160675442610c3790919063ffffffff16565b9063ffffffff610cda16565b9063ffffffff610c7916565b905090565b610a966106d9565b610aea576040805160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610af381610afc565b50565b303b1590565b600160a060020a038116610b445760405160e560020a62461bcd028152600401808060200182810382526026815260200180610e1f6026913960400191505060405180910390fd5b603354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36033805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082610bbc57506000610bd5565b610bd2612710610a71858563ffffffff610bdb16565b90505b92915050565b600082610bea57506000610bd5565b82820282848281610bf757fe5b0414610bd25760405160e560020a62461bcd028152600401808060200182810382526021815260200180610e456021913960400191505060405180910390fd5b6000610bd283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d1c565b600082820183811015610bd2576040805160e560020a62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b6000610bd283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610db6565b60008184841115610dae5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d73578181015183820152602001610d5b565b50505050905090810190601f168015610da05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610e085760405160e560020a62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610d73578181015183820152602001610d5b565b506000838581610e1457fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a265627a7a72315820ea345d2eb9ac3525d206790428751c08852d496138dbe60cb881d9823e771ba564736f6c63430005100032

Verified Source Code Partial Match

Compiler: v0.5.16+commit.9c3226ce EVM: byzantium Optimization: Yes (200 runs)
LidTimeLock.sol 490 lines
pragma solidity 0.5.16;


/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


/**
 * @title Initializable
 *
 * @dev Helper contract to support initializer functions. To use it, replace
 * the constructor with a function that has the `initializer` modifier.
 * WARNING: Unlike constructors, initializer functions must be manually
 * invoked. This applies both to deploying an Initializable contract, as well
 * as extending an Initializable contract via inheritance.
 * WARNING: When used with inheritance, manual care must be taken to not invoke
 * a parent initializer twice, or ensure that all initializers are idempotent,
 * because this is not dealt with automatically as with constructors.
 */
contract Initializable {

  /**
   * @dev Indicates that the contract has been initialized.
   */
  bool private initialized;

  /**
   * @dev Indicates that the contract is in the process of being initialized.
   */
  bool private initializing;

  /**
   * @dev Modifier to use in the initializer function of a contract.
   */
  modifier initializer() {
    require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");

    bool isTopLevelCall = !initializing;
    if (isTopLevelCall) {
      initializing = true;
      initialized = true;
    }

    _;

    if (isTopLevelCall) {
      initializing = false;
    }
  }

  /// @dev Returns true if and only if the function is running in the constructor
  function isConstructor() private view returns (bool) {
    // extcodesize checks the size of the code stored in an address, and
    // address returns the current address. Since the code is still not
    // deployed when running a constructor, any checks on its code size will
    // yield zero, making it an effective way to detect if a contract is
    // under construction or not.
    address self = address(this);
    uint256 cs;
    assembly { cs := extcodesize(self) }
    return cs == 0;
  }

  // Reserved storage space to allow for layout changes in the future.
  uint256[50] private ______gap;
}


/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}


/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context is Initializable {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be aplied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Initializable, Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function initialize(address sender) public initializer {
        _owner = sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * > Note: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    uint256[50] private ______gap;
}


library BasisPoints {
    using SafeMath for uint;

    uint constant private BASIS_POINTS = 10000;

    function mulBP(uint amt, uint bp) internal pure returns (uint) {
        if (amt == 0) return 0;
        return amt.mul(bp).div(BASIS_POINTS);
    }

    function divBP(uint amt, uint bp) internal pure returns (uint) {
        require(bp > 0, "Cannot divide by zero.");
        if (amt == 0) return 0;
        return amt.mul(BASIS_POINTS).div(bp);
    }

    function addBP(uint amt, uint bp) internal pure returns (uint) {
        if (amt == 0) return 0;
        if (bp == 0) return amt;
        return amt.add(mulBP(amt, bp));
    }

    function subBP(uint amt, uint bp) internal pure returns (uint) {
        if (amt == 0) return 0;
        if (bp == 0) return amt;
        return amt.sub(mulBP(amt, bp));
    }
}


contract LidTimeLock is Initializable, Ownable {
    using BasisPoints for uint;
    using SafeMath for uint;

    uint public releaseInterval;
    uint public releaseStart;
    uint public releaseBP;

    uint public startingTokens;
    uint public claimedTokens;

    IERC20 private token;

    address releaseWallet;

    modifier onlyAfterStart {
        require(releaseStart != 0 && now > releaseStart, "Has not yet started.");
        _;
    }

    function initialize(
        uint _releaseInterval,
        uint _releaseBP,
        address owner,
        IERC20 _token
    ) external initializer {
        releaseInterval = _releaseInterval;
        releaseBP = _releaseBP;
        token = _token;

        Ownable.initialize(msg.sender);

        //Due to issue in oz testing suite, the msg.sender might not be owner
        _transferOwnership(owner);
    }

    function claimToken() external onlyAfterStart {
        require(releaseStart != 0, "Has not yet started.");
        uint cycle = getCurrentCycleCount();
        uint totalClaimAmount = cycle.mul(startingTokens.mulBP(releaseBP));
        uint toClaim = totalClaimAmount.sub(claimedTokens);
        if (token.balanceOf(address(this)) < toClaim) toClaim = token.balanceOf(address(this));
        claimedTokens = claimedTokens.add(toClaim);
        token.transfer(releaseWallet, toClaim);
    }

    function startRelease(address _releaseWallet) external onlyOwner {
        require(releaseStart == 0, "Has already started.");
        require(token.balanceOf(address(this)) != 0, "Must have some lid deposited.");
        releaseWallet = _releaseWallet;
        startingTokens = token.balanceOf(address(this));
        releaseStart = now.add(24 hours);
    }

    function getCurrentCycleCount() public view returns (uint) {
        if (now <= releaseStart) return 0;
        return now.sub(releaseStart).div(releaseInterval).add(1);
    }

}

Read Contract

claimedTokens 0x0d92e3e8 → uint256
getCurrentCycleCount 0xd82ce19a → uint256
isOwner 0x8f32d59b → bool
owner 0x8da5cb5b → address
releaseBP 0x47dedcdd → uint256
releaseInterval 0x1f8db268 → uint256
releaseStart 0x766e33f4 → uint256
startingTokens 0x2f8ae83a → uint256

Write Contract 6 functions

These functions modify contract state and require a wallet transaction to execute.

claimToken 0x4451d89f
No parameters
initialize 0x019e2729
uint256 _releaseInterval
uint256 _releaseBP
address owner
address _token
initialize 0xc4d66de8
address sender
renounceOwnership 0x715018a6
No parameters
startRelease 0xb2001e18
address _releaseWallet
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

This address has 1 on-chain transactions, but only 0.7% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →