Contract 0x0aafdB19021a3a87A510dD4db7dce62318b49Cd1

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0xf4c430ceb8f78ee38fe8806d61a49fa2d0b5720ae49783e9a0dcbb9f9d0f1821Get Reward113816022022-09-14 23:49:0715 days 23 hrs ago0x23cab94b3e3409b8b2e75b95f434d36242755ce3 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00006675 1.5
0xbbe7e409827cf83844e1218a2eb2b0a9de6627ae7997b62c5385961cee65d4cfGet Reward112459072022-08-22 7:46:1539 days 15 hrs ago0x23cab94b3e3409b8b2e75b95f434d36242755ce3 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00006931 1.55734098
0xb4ad08e405831c71e071719dca6de5e96516a38b85e4c2a96714212db8e54837Create Delegator111414332022-08-04 3:36:1057 days 19 hrs ago0x07459ac5608c8f5e81666dc9647f444889a75662 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087992 1.50000001
0x92aa8a432e7c3318d6d84c2ffde5143b98eca6e7b0ff547b6974bd7fabf52373Create Delegator111405892022-08-04 0:04:4357 days 23 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087992 1.5
0xff7b967942a5861106a4a82147f107bb34519f6d73c89fcb6150d66a0496ba1bCreate Delegator111400212022-08-03 21:42:3358 days 1 hr ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00090166 1.5370498
0x9f4969c13b7c46ea05cdf0a20298f9f2c45739db3a37d61c8d8ea8bec133c35dCreate Delegator105378492022-04-20 15:13:24163 days 8 hrs ago0x07459ac5608c8f5e81666dc9647f444889a75662 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087993 1.50000383
0x31fe8cb7a0a58e1186a697873ab8b428a69bd3384e4dd3a9b03d0232c2198704Create Delegator105044282022-04-14 19:23:02169 days 3 hrs ago0x8540f80fab2afcae8d8fd6b1557b1cf943a0999b IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00058661 1.00000004
0x60310ec11db678eedfa786aa433ee0af799345baf5eb7f081802653831c0c559Get Reward104458272022-04-04 13:15:21179 days 10 hrs ago0xf161e1ad51fccd598e5c44a536f6659f33d6e0f4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00010154 2.28168258
0xd4b41dfc70616c31cda7b501b9c34d331d085631d066f4e3bbb5d6c1f17eaa06Get Reward104367582022-04-02 23:23:36180 days 23 hrs ago0xf161e1ad51fccd598e5c44a536f6659f33d6e0f4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00006675 1.5
0x42813c8abcf3227af609f566414e9f1f2c20c80639ddbd7a1d2eb6236fd8b6f0Stake100318302022-01-21 21:03:08252 days 2 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00025413 1.50000001
0xcaa6c306b77b71453cbfef9a920bd843b5f9c5f5d44aef14a4d633ff8c1a5f63Withdraw100318252022-01-21 21:01:53252 days 2 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00017634 1.50000001
0xcf1af63e30cf7541ecae3f8492ce737f5df816ade180407bb1e36ea56042b27fStake99794192022-01-12 16:15:52261 days 7 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00030155 1.50000001
0x7014204dba376042a9b8464e9bb786b89fe8286a3e11118df4d8f825f57af254Withdraw99794162022-01-12 16:15:07261 days 7 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00016916 1.50000001
0xf22d68f768166944053f50b1312dcbd466971bf1f056dbf97cd8fdeae49d54d1Create Delegator99396682022-01-05 18:33:16268 days 4 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087989 1.50000004
0x2267f913b543920d78413538fdd2f5b1a3c53f25afef0a67e17484e8af44c28fStake99387962022-01-05 14:55:10268 days 8 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00030155 1.50000001
0x45f3d3c26b9c031d5de84bd1393a2f771056cb596bb24f60ea85b47ba57f3014Create Delegator99387712022-01-05 14:48:55268 days 8 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087992 1.50000001
0x4044d8188b95139a78c772a90037e15d038c0f068ae854048f637bab264386dbCreate Delegator99386092022-01-05 14:08:25268 days 9 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00087992 1.50000002
0x6bd42facb47b361b0bf43507627e1277c88c04a826d92d18e9ed74a3ed40205fStake94525312021-10-12 14:02:29353 days 9 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00020283 1.50000009
0xfba962c57821c0e809ed93eb052378d509eb026154a3efab9a37b9f0fa26b942Stake94494662021-10-12 1:14:29353 days 22 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00020283 1.5
0xa20b42ff547261ffa9d15c5c54ff13e4fa5cacf6588512a26eebf98ca7ac20adWithdraw94493712021-10-12 0:50:40353 days 22 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00016916 1.5
0x06d2b9fa3ee9a88d956338ead0d2d3de4577472d9cc981009cc2d973ac9543d2Stake94493472021-10-12 0:44:39353 days 22 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00020283 1.5
0x4e64a2d69c4900ecdd3a272df5c8e876ef03603c82f7abc80e8015518055bd4aStake94492172021-10-12 0:12:06353 days 23 hrs ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00020283 1.5
0x5b8facd6e4c05541145a0e8bd24d7b3d8cf7fa5c000278a434a463e71f2a512fWithdraw94489092021-10-11 22:55:01354 days 27 mins ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00021878 1.94
0x1f71b23b46d7fd21419226be8bf9c1cb4fd7290b0e30bb26886ce980f86148dbWithdraw94489012021-10-11 22:53:01354 days 29 mins ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00018354 1.50000001
0x9073ff3ca6467f69f47bbdd3b28f20073a105b6e58f17feb1e1972bd43d2d6eeStake94488932021-10-11 22:51:01354 days 31 mins ago0xf6a16a48099497c59e8abeaa37bb37b2f9b793d4 IN  0x0aafdb19021a3a87a510dd4db7dce62318b49cd10 Ether0.00020283 1.50000001
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xb4ad08e405831c71e071719dca6de5e96516a38b85e4c2a96714212db8e54837111414332022-08-04 3:36:1057 days 19 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x92aa8a432e7c3318d6d84c2ffde5143b98eca6e7b0ff547b6974bd7fabf52373111405892022-08-04 0:04:4357 days 23 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0xff7b967942a5861106a4a82147f107bb34519f6d73c89fcb6150d66a0496ba1b111400212022-08-03 21:42:3358 days 1 hr ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x9f4969c13b7c46ea05cdf0a20298f9f2c45739db3a37d61c8d8ea8bec133c35d105378492022-04-20 15:13:24163 days 8 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x31fe8cb7a0a58e1186a697873ab8b428a69bd3384e4dd3a9b03d0232c2198704105044282022-04-14 19:23:02169 days 3 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x42813c8abcf3227af609f566414e9f1f2c20c80639ddbd7a1d2eb6236fd8b6f0100318302022-01-21 21:03:08252 days 2 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0x42813c8abcf3227af609f566414e9f1f2c20c80639ddbd7a1d2eb6236fd8b6f0100318302022-01-21 21:03:08252 days 2 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
0xcaa6c306b77b71453cbfef9a920bd843b5f9c5f5d44aef14a4d633ff8c1a5f63100318252022-01-21 21:01:53252 days 2 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0x315dfdd4f0f9d27e969e7d1f681acd431674d3dd0 Ether
0xcf1af63e30cf7541ecae3f8492ce737f5df816ade180407bb1e36ea56042b27f99794192022-01-12 16:15:52261 days 7 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0xcf1af63e30cf7541ecae3f8492ce737f5df816ade180407bb1e36ea56042b27f99794192022-01-12 16:15:52261 days 7 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0x0be79d72f2ec3952d368db9b567e9d7b29b562c70 Ether
0x7014204dba376042a9b8464e9bb786b89fe8286a3e11118df4d8f825f57af25499794162022-01-12 16:15:07261 days 7 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
0xf22d68f768166944053f50b1312dcbd466971bf1f056dbf97cd8fdeae49d54d199396682022-01-05 18:33:16268 days 4 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x2267f913b543920d78413538fdd2f5b1a3c53f25afef0a67e17484e8af44c28f99387962022-01-05 14:55:10268 days 8 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0x2267f913b543920d78413538fdd2f5b1a3c53f25afef0a67e17484e8af44c28f99387962022-01-05 14:55:10268 days 8 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0x61dd8043851d6c3e5381ddd0540d37d481a29fd30 Ether
0x45f3d3c26b9c031d5de84bd1393a2f771056cb596bb24f60ea85b47ba57f301499387712022-01-05 14:48:55268 days 8 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x4044d8188b95139a78c772a90037e15d038c0f068ae854048f637bab264386db99386092022-01-05 14:08:25268 days 9 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1  Contract Creation0 Ether
0x6bd42facb47b361b0bf43507627e1277c88c04a826d92d18e9ed74a3ed40205f94525312021-10-12 14:02:29353 days 9 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0x6bd42facb47b361b0bf43507627e1277c88c04a826d92d18e9ed74a3ed40205f94525312021-10-12 14:02:29353 days 9 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
0xfba962c57821c0e809ed93eb052378d509eb026154a3efab9a37b9f0fa26b94294494662021-10-12 1:14:29353 days 22 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0xfba962c57821c0e809ed93eb052378d509eb026154a3efab9a37b9f0fa26b94294494662021-10-12 1:14:29353 days 22 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
0xa20b42ff547261ffa9d15c5c54ff13e4fa5cacf6588512a26eebf98ca7ac20ad94493712021-10-12 0:50:40353 days 22 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0x3cd1bbcc35f73e7df2da467b46a9463e6a4e0a940 Ether
0x06d2b9fa3ee9a88d956338ead0d2d3de4577472d9cc981009cc2d973ac9543d294493472021-10-12 0:44:39353 days 22 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0x06d2b9fa3ee9a88d956338ead0d2d3de4577472d9cc981009cc2d973ac9543d294493472021-10-12 0:44:39353 days 22 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
0x4e64a2d69c4900ecdd3a272df5c8e876ef03603c82f7abc80e8015518055bd4a94492172021-10-12 0:12:06353 days 23 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xaa715dbd2ed909b7b7727dc864f3b78276d14a190 Ether
0x4e64a2d69c4900ecdd3a272df5c8e876ef03603c82f7abc80e8015518055bd4a94492172021-10-12 0:12:06353 days 23 hrs ago 0x0aafdb19021a3a87a510dd4db7dce62318b49cd1 0xd1c2896f8dc079329c2c9261afa214dc57c4bdd60 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DelegatorFactory

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the 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 virtual onlyOwner {
        _setOwner(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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 7 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 3 of 7 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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 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.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 4 of 7 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // 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 (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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) {
        return a + b;
    }

    /**
     * @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 a - b;
    }

    /**
     * @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) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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 a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting 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.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 7 : Delegator.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "./interfaces/IGovernanceToken.sol";
import "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";

/**
 * @title Delegator Contract
 * @author Cryptex.Finance
 * @notice Contract in charge of handling delegations.
 */

contract Delegator is Ownable {
   /* ========== STATE VARIABLES ========== */

   /// @notice Address of the staking governance token
   address public immutable token;

   /// @notice Tracks the amount of staked tokens per user
   mapping(address => uint256) public stakerBalance;

   /* ========== CONSTRUCTOR ========== */

   /**
    * @notice Constructor
    * @param delegatee_ address
    * @param token_ address
    * @dev when created delegates all it's power to delegatee_ and can't be changed later
    * @dev sets delegator factory as owner
    */
   constructor(address delegatee_, address token_) {
      token = token_;
      IGovernanceToken(token_).delegate(delegatee_);
   }

   /* ========== MUTATIVE FUNCTIONS ========== */

   /**
    * @notice Increases the balance of the staker
    * @param staker_ caller of the stake function
    * @param amount_ uint to be staked and delegated
    * @dev Only delegatorFactory can call it
    * @dev after the balance is updated the amount is transferred from the user to this contract
    */
   function stake(address staker_, uint256 amount_) external onlyOwner {
      stakerBalance[staker_] += amount_;
   }

   /**
    * @notice Decreases the balance of the staker
    * @param staker_ caller of the stake function
    * @param amount_ uint to be withdrawn and undelegated
    * @dev Only delegatorFactory can call it
    * @dev after the balance is updated the amount is transferred back to the user from this contract
    */
   function removeStake(address staker_, uint256 amount_) external onlyOwner {
      stakerBalance[staker_] -= amount_;
      IGovernanceToken(token).transfer(staker_, amount_);
   }

   /* ========== VIEWS ========== */

   /// @notice returns the delegatee of this contract
   function delegatee() external returns (address) {
      return IGovernanceToken(token).delegates(address(this));
   }
}

File 6 of 7 : DelegatorFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "./interfaces/IGovernanceToken.sol";
import "./Delegator.sol";
import "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import "../lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol";
import "../lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol";

/**
 * @title Delegator Contract Factory
 * @author Cryptex.Finance
 * @notice Contract in charge of generating Delegator contracts, handling delegations and CTX balance map, rewards.
 */

contract DelegatorFactory is Ownable, ReentrancyGuard {
   /// @notice Using open zeppelin libraries
   using SafeMath for uint256;

   /* ========== STATE VARIABLES ========== */

   /// @notice Address of the staking governance token
   address public immutable stakingToken;

   /// @notice Address of the reward token
   address public immutable rewardsToken;

   /// @notice Minimum wait time before removing stake
   uint256 public waitTime;

   /// @notice Tracks the period where users stop earning rewards
   uint256 public periodFinish = 0;
   uint256 public rewardRate = 0;

   /// @notice How long the rewards lasts, it updates when more rewards are added
   uint256 public rewardsDuration = 186 days; //TODO: update to real value

   /// @notice Last time rewards were updated
   uint256 public lastUpdateTime;

   /// @notice Amount of reward calculated per token stored
   uint256 public rewardPerTokenStored;

   /// @notice Track the rewards paid to users
   mapping(address => uint256) public userRewardPerTokenPaid;

   /// @notice Tracks the user rewards
   mapping(address => uint256) public rewards;

   /// @notice Tracks the address of a delegatee with a delegator contract address
   mapping(address => address) public delegatorToDelegatee;

   /// @notice Tracks the delegator contract address from delegatee address
   mapping(address => address) public delegateeToDelegator;

   /// @notice Tracks if address is an official delegator
   mapping(address => bool) public delegators;

   /// @notice Tracks minimum wait time the account has to wait before removing stake
   mapping(address => mapping(address => uint256)) public stakerWaitTime;

   /// @dev Tracks the total supply of staked tokens
   uint256 private _totalSupply;

   /// @dev Tracks the amount of staked tokens per user
   mapping(address => uint256) private _balances;

   /* ========== EVENTS ========== */

   /// @notice An event emitted when a Delegator is created
   event DelegatorCreated(address indexed delegator, address indexed delegatee);

   /// @notice An event emitted when an user has staked and delegated
   event Staked(
      address indexed delegator,
      address indexed delegatee,
      uint256 amount
   );

   /// @notice An event emitted when an user removes stake and undelegated
   event Withdrawn(
      address indexed delegator,
      address indexed delegatee,
      uint256 amount
   );

   /// @notice An event emitted when the minimum wait time is updated
   event WaitTimeUpdated(uint256 waitTime);

   /// @notice An event emitted when a reward is added
   event RewardAdded(uint256 reward);

   /// @notice An event emitted when reward is paid to a user
   event RewardPaid(address indexed user, uint256 reward);

   /// @notice An event emitted when the rewards duration is updated
   event RewardsDurationUpdated(uint256 newDuration);

   /* ========== CONSTRUCTOR ========== */

   /**
    * @notice Constructor
    * @param stakingToken_ address
    * @param rewardsToken_ address
    * @param waitTime_ uint256
    * @param timelock_ address
    * @dev transfers ownership to timelock
    */
   constructor(
      address stakingToken_,
      address rewardsToken_,
      uint256 waitTime_,
      address timelock_
   ) {
      stakingToken = stakingToken_;
      rewardsToken = rewardsToken_;
      waitTime = waitTime_;
      transferOwnership(timelock_);
   }

   /* ========== MODIFIERS ========== */

   /**
    * @notice Updates the reward and time on call.
    * @param account_ address
    */
   modifier updateReward(address account_) {
      rewardPerTokenStored = rewardPerToken();
      lastUpdateTime = lastTimeRewardApplicable();

      if (account_ != address(0)) {
         rewards[account_] = earned(account_);
         userRewardPerTokenPaid[account_] = rewardPerTokenStored;
      }
      _;
   }

   /* ========== MUTATIVE FUNCTIONS ========== */

   /**
    * @notice Notifies the contract that reward has been added to be given.
    * @param reward_ uint
    * @dev Only owner  can call it
    * @dev Increases duration of rewards
    */
   function notifyRewardAmount(uint256 reward_)
      external
      onlyOwner
      updateReward(address(0))
   {
      if (block.timestamp >= periodFinish) {
         rewardRate = reward_.div(rewardsDuration);
      } else {
         uint256 remaining = periodFinish.sub(block.timestamp);
         uint256 leftover = remaining.mul(rewardRate);
         rewardRate = reward_.add(leftover).div(rewardsDuration);
      }

      // Ensure the provided reward amount is not more than the balance in the contract.
      // This keeps the reward rate in the right range, preventing overflows due to
      // very high values of rewardRate in the earned and rewardsPerToken functions;
      // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
      uint256 balance = IGovernanceToken(rewardsToken).balanceOf(address(this));
      require(
         rewardRate <= balance.div(rewardsDuration),
         "Provided reward too high"
      );

      lastUpdateTime = block.timestamp;
      periodFinish = block.timestamp.add(rewardsDuration);
      emit RewardAdded(reward_);
   }

   /**
    * @notice  Updates the reward duration
    * @param rewardsDuration_ uint
    * @dev Only owner can call it
    * @dev Previous rewards must be complete
    */
   function setRewardsDuration(uint256 rewardsDuration_) external onlyOwner {
      require(
         block.timestamp > periodFinish,
         "Previous rewards period must be complete before changing the duration for the new period"
      );
      rewardsDuration = rewardsDuration_;
      emit RewardsDurationUpdated(rewardsDuration);
   }

   /**
    * @notice Transfers to the caller the current amount of rewards tokens earned.
    * @dev updates rewards on call
    * @dev from the total reward a vestingRatio amount is locked into vesting and the rest is transferred
    * @dev if vesting period has passed transfer all rewards
    */
   function getReward() external nonReentrant updateReward(msg.sender) {
      uint256 reward = rewards[msg.sender];
      if (reward > 0) {
         rewards[msg.sender] = 0;
         IGovernanceToken(rewardsToken).transfer(msg.sender, reward);
         emit RewardPaid(msg.sender, reward);
      }
   }

   /**
    * @notice Creates a new delegator contract that delegates all votes to delegatee_
    * @param delegatee_ address that will be receiving all votes
    * @dev only one delegator contract pointing to the same delegatee can exist
    */
   function createDelegator(address delegatee_) external {
      require(delegatee_ != address(0), "Delegatee can't be 0");
      require(
         delegateeToDelegator[delegatee_] == address(0),
         "Delegator already created"
      );
      Delegator delegator = new Delegator(delegatee_, stakingToken);
      delegateeToDelegator[delegatee_] = address(delegator);
      delegatorToDelegatee[address(delegator)] = delegatee_;
      delegators[address(delegator)] = true;
      emit DelegatorCreated(address(delegator), delegatee_);
   }

   /**
    * @notice Stakes to delegator_ the amount_ specified
    * @param delegator_ contract address where to send the amount_
    * @param amount_ uint to be staked and delegated
    * @dev Delegator must be valid and amount has to be greater than 0
    * @dev amount_ is transferred to the delegator contract and staker starts earning rewards if active
    * @dev updates rewards on call
    */
   function stake(address delegator_, uint256 amount_)
      external
      nonReentrant
      updateReward(msg.sender)
   {
      require(delegators[delegator_], "Not a valid delegator");
      require(amount_ > 0, "Amount must be greater than 0");
      _totalSupply = _totalSupply.add(amount_);
      _balances[msg.sender] = _balances[msg.sender].add(amount_);
      Delegator d = Delegator(delegator_);
      d.stake(msg.sender, amount_);
      stakerWaitTime[msg.sender][delegator_] = block.timestamp + waitTime;
      IGovernanceToken(stakingToken).transferFrom(
         msg.sender,
         delegator_,
         amount_
      );
      emit Staked(delegator_, msg.sender, amount_);
   }

   /**
    * @notice Removes amount_ from delegator_
    * @param delegator_ contract address where to remove the stake from
    * @param amount_ uint to be removed from stake and undelegated
    * @dev Delegator must be valid and amount has to be greater than 0
    * @dev amount_ must be <= that current user stake
    * @dev amount_ is transferred from the  delegator contract to the staker
    * @dev updates rewards on call
    * @dev requires that at least waitTime has passed since delegation to unDelegate
    */
   function withdraw(address delegator_, uint256 amount_)
      external
      nonReentrant
      updateReward(msg.sender)
   {
      require(delegators[delegator_], "Not a valid delegator");
      require(amount_ > 0, "Amount must be greater than 0");
      require(
         block.timestamp >= stakerWaitTime[msg.sender][delegator_],
         "Need to wait the minimum staking period"
      );
      _totalSupply = _totalSupply.sub(amount_);
      _balances[msg.sender] = _balances[msg.sender].sub(amount_);
      Delegator d = Delegator(delegator_);
      d.removeStake(msg.sender, amount_);
      emit Withdrawn(delegator_, msg.sender, amount_);
   }

   /**
    * @notice updates the min wait time between delegation and unDelegation
    * @param waitTime_ uint new wait time
    * @dev only the owner can call it
    */
   function updateWaitTime(uint256 waitTime_) external onlyOwner {
      waitTime = waitTime_;
      emit WaitTimeUpdated(waitTime_);
   }

   /* ========== VIEWS ========== */

   /// @notice Returns the total amount of staked tokens.
   function totalSupply() external view returns (uint256) {
      return _totalSupply;
   }

   /**
    * @notice Returns the amount of staked tokens from specific user
    * @param account_ address
    */
   function balanceOf(address account_) external view returns (uint256) {
      return _balances[account_];
   }

   /// @notice Returns reward rate for a duration
   function getRewardForDuration() external view returns (uint256) {
      return rewardRate.mul(rewardsDuration);
   }

   /// @notice Returns the minimum between current block timestamp or the finish period of rewards.
   function lastTimeRewardApplicable() public view returns (uint256) {
      return min(block.timestamp, periodFinish);
   }

   /// @notice Returns the calculated reward per token deposited.
   function rewardPerToken() public view returns (uint256) {
      if (_totalSupply == 0) {
         return rewardPerTokenStored;
      }

      return
         rewardPerTokenStored.add(
            lastTimeRewardApplicable()
               .sub(lastUpdateTime)
               .mul(rewardRate)
               .mul(1e18)
               .div(_totalSupply)
         );
   }

   /**
    * @notice Returns the amount of reward tokens a user has earned.
    * @param account_ address
    */
   function earned(address account_) public view returns (uint256) {
      return
         _balances[account_]
            .mul(rewardPerToken().sub(userRewardPerTokenPaid[account_]))
            .div(1e18)
            .add(rewards[account_]);
   }

   /**
    * @notice Returns the minimum between two variables
    * @param a_ uint
    * @param b_ uint
    */
   function min(uint256 a_, uint256 b_) public pure returns (uint256) {
      return a_ < b_ ? a_ : b_;
   }
}

File 7 of 7 : IGovernanceToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface IGovernanceToken {
   function delegate(address delegatee) external;

   function delegates(address delegator) external returns (address);

   function transfer(address dst, uint256 rawAmount) external returns (bool);

   function transferFrom(
      address src,
      address dst,
      uint256 rawAmount
   ) external returns (bool);

   function balanceOf(address src) external returns (uint256);
}

Settings
{
  "evmVersion": "berlin",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"stakingToken_","type":"address"},{"internalType":"address","name":"rewardsToken_","type":"address"},{"internalType":"uint256","name":"waitTime_","type":"uint256"},{"internalType":"address","name":"timelock_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"}],"name":"DelegatorCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"waitTime","type":"uint256"}],"name":"WaitTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee_","type":"address"}],"name":"createDelegator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegateeToDelegator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegatorToDelegatee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"a_","type":"uint256"},{"internalType":"uint256","name":"b_","type":"uint256"}],"name":"min","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward_","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardsDuration_","type":"uint256"}],"name":"setRewardsDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"stakerWaitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"waitTime_","type":"uint256"}],"name":"updateWaitTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"waitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegator_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040526000600355600060045562f537006005553480156200002257600080fd5b50604051620028c7380380620028c78339810160408190526200004591620001ca565b620000503362000088565b600180556001600160601b0319606085811b821660805284901b1660a05260028290556200007e81620000d8565b505050506200021e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620001385760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0381166200019f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200012f565b620001aa8162000088565b50565b80516001600160a01b0381168114620001c557600080fd5b919050565b60008060008060808587031215620001e157600080fd5b620001ec85620001ad565b9350620001fc60208601620001ad565b9250604085015191506200021360608601620001ad565b905092959194509250565b60805160601c60a05160601c612661620002666000396000818161048c01528181610a090152610cd901526000818161037401528181610712015261125101526126616000f3fe60806040523480156200001157600080fd5b50600436106200020c5760003560e01c806380faa57d1162000125578063cd3daf9d11620000af578063df136d65116200007a578063df136d651462000515578063ebe2b12b146200051f578063f2fde38b1462000529578063f3fef3a3146200054057600080fd5b8063cd3daf9d146200047c578063d1af0c7d1462000486578063d4f8faa714620004ae578063d7f5c90014620004e757600080fd5b8063adc9772e11620000f0578063adc9772e146200043a578063c8f33c911462000451578063cc1a378f146200045b578063ccca123b146200047257600080fd5b806380faa57d14620003b75780638b87634714620003c15780638d23fc6114620003e45780638da5cb5b146200041b57600080fd5b80633c6b16ab11620001a7578063715018a61162000172578063715018a6146200036457806372f702f3146200036e5780637ae2b5c714620003965780637b0a47ee14620003ad57600080fd5b80633c6b16ab14620002f35780633d18b912146200030a5780636e372ef8146200031457806370a08231146200032b57600080fd5b806318160ddd11620001e857806318160ddd14620002775780631c1f78eb14620002805780632d8dea94146200028a578063386a952514620002e957600080fd5b80628cc26214620002115780630700037d146200023b57806307d97918146200025e575b600080fd5b620002286200022236600462001ad7565b62000557565b6040519081526020015b60405180910390f35b620002286200024c36600462001ad7565b60096020526000908152604090205481565b620002756200026f36600462001ad7565b620005f9565b005b600e5462000228565b620002286200084b565b620002c36200029b36600462001ad7565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200162000232565b6200022860055481565b620002756200030436600462001b7e565b6200086b565b6200027562000b74565b620002756200032536600462001b7e565b62000d98565b620002286200033c36600462001ad7565b73ffffffffffffffffffffffffffffffffffffffff166000908152600f602052604090205490565b6200027562000e57565b620002c37f000000000000000000000000000000000000000000000000000000000000000081565b62000228620003a736600462001bb2565b62000ee8565b6200022860045481565b6200022862000f02565b62000228620003d236600462001ad7565b60086020526000908152604090205481565b6200040a620003f536600462001ad7565b600c6020526000908152604090205460ff1681565b604051901515815260200162000232565b60005473ffffffffffffffffffffffffffffffffffffffff16620002c3565b620002756200044b36600462001b2d565b62000f12565b6200022860065481565b620002756200046c36600462001b7e565b6200132c565b6200022860025481565b620002286200149e565b620002c37f000000000000000000000000000000000000000000000000000000000000000081565b620002c3620004bf36600462001ad7565b600a6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b62000228620004f836600462001af5565b600d60209081526000928352604080842090915290825290205481565b6200022860075481565b6200022860035481565b620002756200053a36600462001ad7565b620014f4565b620002756200055136600462001b2d565b6200162a565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600960209081526040808320546008909252822054620005f39190620005ec90670de0b6b3a764000090620005e590620005b890620005b16200149e565b90620019f2565b73ffffffffffffffffffffffffffffffffffffffff88166000908152600f60205260409020549062001a00565b9062001a0e565b9062001a1c565b92915050565b73ffffffffffffffffffffffffffffffffffffffff81166200067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f44656c6567617465652063616e2774206265203000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8181166000908152600b602052604090205416156200070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f44656c656761746f7220616c7265616479206372656174656400000000000000604482015260640162000673565b6000817f00000000000000000000000000000000000000000000000000000000000000006040516200073f9062001a9f565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f08015801562000780573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff8084166000818152600b6020908152604080832080549587167fffffffffffffffffffffffff00000000000000000000000000000000000000009687168117909155808452600a835281842080549096168517909555600c90915280822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555193945090927f0976a62688d14faa8e35e63a7ada50f147ba1a0357f99182a596f9afea2502f49190a35050565b60006200086660055460045462001a0090919063ffffffff16565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314620008ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000673565b6000620008fa6200149e565b6007556200090762000f02565b60065573ffffffffffffffffffffffffffffffffffffffff8116156200096b57620009328162000557565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960209081526040808320939093556007546008909152919020555b60035442106200098e576005546200098590839062001a0e565b600455620009d8565b600354600090620009a09042620019f2565b90506000620009bb6004548362001a0090919063ffffffff16565b600554909150620009d290620005e5868462001a1c565b60045550505b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381600087803b15801562000a6357600080fd5b505af115801562000a78573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a9e919062001b98565b905062000ab76005548262001a0e90919063ffffffff16565b600454111562000b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015260640162000673565b42600681905560055462000b39919062001a1c565b6003556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b6002600154141562000be3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000673565b60026001553362000bf36200149e565b60075562000c0062000f02565b60065573ffffffffffffffffffffffffffffffffffffffff81161562000c645762000c2b8162000557565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960209081526040808320939093556007546008909152919020555b33600090815260096020526040902054801562000d90573360008181526009602052604080822091909155517fa9059cbb00000000000000000000000000000000000000000000000000000000815260048101919091526024810182905273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801562000d1e57600080fd5b505af115801562000d33573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d59919062001b5a565b5060405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b505060018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331462000e1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000673565b60028190556040518181527fd7a3703f78487664fd138129246eed2d18e2fbbe550ea6839eb8717034543a52906020015b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff16331462000eda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000673565b62000ee6600062001a2a565b565b600081831062000ef9578162000efb565b825b9392505050565b6000620008664260035462000ee8565b6002600154141562000f81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000673565b60026001553362000f916200149e565b60075562000f9e62000f02565b60065573ffffffffffffffffffffffffffffffffffffffff811615620010025762000fc98162000557565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960209081526040808320939093556007546008909152919020555b73ffffffffffffffffffffffffffffffffffffffff83166000908152600c602052604090205460ff1662001093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f7420612076616c69642064656c656761746f720000000000000000000000604482015260640162000673565b60008211620010ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640162000673565b600e546200110e908362001a1c565b600e55336000908152600f60205260409020546200112d908362001a1c565b336000818152600f6020526040908190209290925590517fadc9772e000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052839073ffffffffffffffffffffffffffffffffffffffff82169063adc9772e90604401600060405180830381600087803b158015620011b457600080fd5b505af1158015620011c9573d6000803e3d6000fd5b5050505060025442620011dd919062001bd5565b336000818152600d6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a811680865291909352928190209490945592517f23b872dd00000000000000000000000000000000000000000000000000000000815260048101929092526024820152604481018590527f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401602060405180830381600087803b1580156200129857600080fd5b505af1158015620012ad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620012d3919062001b5a565b50604051838152339073ffffffffffffffffffffffffffffffffffffffff8616907f5dac0c1b1112564a045ba943c9d50270893e8e826c49be8e7073adc713ab7bd7906020015b60405180910390a35050600180555050565b60005473ffffffffffffffffffffffffffffffffffffffff163314620013af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000673565b600354421162001468576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605860248201527f50726576696f7573207265776172647320706572696f64206d7573742062652060448201527f636f6d706c657465206265666f7265206368616e67696e67207468652064757260648201527f6174696f6e20666f7220746865206e657720706572696f640000000000000000608482015260a40162000673565b60058190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d39060200162000e4c565b6000600e5460001415620014b3575060075490565b62000866620014ea600e54620005e5670de0b6b3a7640000620014e3600454620014e3600654620005b162000f02565b9062001a00565b6007549062001a1c565b60005473ffffffffffffffffffffffffffffffffffffffff16331462001577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000673565b73ffffffffffffffffffffffffffffffffffffffff81166200161c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840162000673565b620016278162001a2a565b50565b6002600154141562001699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000673565b600260015533620016a96200149e565b600755620016b662000f02565b60065573ffffffffffffffffffffffffffffffffffffffff8116156200171a57620016e18162000557565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960209081526040808320939093556007546008909152919020555b73ffffffffffffffffffffffffffffffffffffffff83166000908152600c602052604090205460ff16620017ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f7420612076616c69642064656c656761746f720000000000000000000000604482015260640162000673565b6000821162001817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640162000673565b336000908152600d6020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902054421015620018d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4e65656420746f207761697420746865206d696e696d756d207374616b696e6760448201527f20706572696f6400000000000000000000000000000000000000000000000000606482015260840162000673565b600e54620018e89083620019f2565b600e55336000908152600f6020526040902054620019079083620019f2565b336000818152600f6020526040908190209290925590517f68ce7d8a000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052839073ffffffffffffffffffffffffffffffffffffffff8216906368ce7d8a90604401600060405180830381600087803b1580156200198e57600080fd5b505af1158015620019a3573d6000803e3d6000fd5b505060405185815233925073ffffffffffffffffffffffffffffffffffffffff871691507fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb906020016200131a565b600062000efb828462001c6c565b600062000efb828462001c2c565b600062000efb828462001bf0565b600062000efb828462001bd5565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6109768062001cb683390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811462001ad257600080fd5b919050565b60006020828403121562001aea57600080fd5b62000efb8262001aad565b6000806040838503121562001b0957600080fd5b62001b148362001aad565b915062001b246020840162001aad565b90509250929050565b6000806040838503121562001b4157600080fd5b62001b4c8362001aad565b946020939093013593505050565b60006020828403121562001b6d57600080fd5b8151801515811462000efb57600080fd5b60006020828403121562001b9157600080fd5b5035919050565b60006020828403121562001bab57600080fd5b5051919050565b6000806040838503121562001bc657600080fd5b50508035926020909101359150565b6000821982111562001beb5762001beb62001c86565b500190565b60008262001c27577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161562001c675762001c6762001c86565b500290565b60008282101562001c815762001c8162001c86565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfe60a060405234801561001057600080fd5b5060405161097638038061097683398101604081905261002f91610118565b610038336100ac565b606081901b6001600160601b0319166080526040516317066a5760e21b81526001600160a01b038381166004830152821690635c19a95c90602401600060405180830381600087803b15801561008d57600080fd5b505af11580156100a1573d6000803e3d6000fd5b50505050505061014b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461011357600080fd5b919050565b6000806040838503121561012b57600080fd5b610134836100fc565b9150610142602084016100fc565b90509250929050565b60805160601c6107ff61017760003960008181610153015281816101a6015261034801526107ff6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063adc9772e1161005b578063adc9772e146100fa578063eca5b8d31461010d578063f2fde38b1461013b578063fc0c546a1461014e57600080fd5b80631e31d0531461008d57806368ce7d8a146100bf578063715018a6146100d45780638da5cb5b146100dc575b600080fd5b610095610175565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d26100cd3660046106fb565b61023c565b005b6100d26103c9565b60005473ffffffffffffffffffffffffffffffffffffffff16610095565b6100d26101083660046106fb565b610456565b61012d61011b3660046106ba565b60016020526000908152604090205481565b6040519081526020016100b6565b6100d26101493660046106ba565b610515565b6100957f000000000000000000000000000000000000000000000000000000000000000081565b6040517f587cde1e0000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063587cde1e90602401602060405180830381600087803b1580156101ff57600080fd5b505af1158015610213573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023791906106de565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040812080548392906102f7908490610761565b90915550506040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c49190610727565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461044a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b9565b6104546000610645565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b9565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260408120805483929061050c908490610749565b90915550505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b9565b73ffffffffffffffffffffffffffffffffffffffff8116610639576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102b9565b61064281610645565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156106cc57600080fd5b81356106d7816107a7565b9392505050565b6000602082840312156106f057600080fd5b81516106d7816107a7565b6000806040838503121561070e57600080fd5b8235610719816107a7565b946020939093013593505050565b60006020828403121561073957600080fd5b815180151581146106d757600080fd5b6000821982111561075c5761075c610778565b500190565b60008282101561077357610773610778565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461064257600080fdfea26469706673582212203d6f9193b1a6aad45f2464922ab48377293df2d7f740f69e3e26bdd453cc84ef64736f6c63430008060033a264697066735822122071b47bc39e07f3902cd17d0013636698caac50e76d33be19e154505cf5bbf19764736f6c63430008060033000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a19000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a190000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000f77e8426ecef4a44d5ec8986fb525127bad32fd1

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a19000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a190000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000f77e8426ecef4a44d5ec8986fb525127bad32fd1

-----Decoded View---------------
Arg [0] : stakingToken_ (address): 0xAa715DbD2ED909B7B7727dC864F3B78276D14A19
Arg [1] : rewardsToken_ (address): 0xAa715DbD2ED909B7B7727dC864F3B78276D14A19
Arg [2] : waitTime_ (uint256): 604800
Arg [3] : timelock_ (address): 0xf77E8426EceF4A44D5Ec8986FB525127BaD32Fd1

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a19
Arg [1] : 000000000000000000000000aa715dbd2ed909b7b7727dc864f3b78276d14a19
Arg [2] : 0000000000000000000000000000000000000000000000000000000000093a80
Arg [3] : 000000000000000000000000f77e8426ecef4a44d5ec8986fb525127bad32fd1


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.