MATIC Price: $0.606518 (+0.95%)
Gas: 30 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Renounce Role331478372022-09-15 19:04:26639 days ago1663268666IN
0x5cd67Daa...B823eA7bF
0 MATIC0.0007420230.21999999
Grant Role331478272022-09-15 19:04:06639 days ago1663268646IN
0x5cd67Daa...B823eA7bF
0 MATIC0.0015296730.00000001
0x60a06040331477692022-09-15 19:02:06639 days ago1663268526IN
 Create: TwoPeriodsRewardCalculator
0 MATIC0.0339822630.00000001

Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TwoPeriodsRewardCalculator

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 9 : TwoPeriodsRewardCalculator.sol
//SPDX-License-Identifier: MIT

pragma solidity 0.8.2;

import {Math} from "@openzeppelin/contracts-0.8/utils/math/Math.sol";
import {AccessControl} from "@openzeppelin/contracts-0.8/access/AccessControl.sol";
import {IRewardCalculator} from "../interfaces/IRewardCalculator.sol";

contract TwoPeriodsRewardCalculator is IRewardCalculator, AccessControl {
    event InitialCampaign(
        uint256 reward,
        uint256 duration,
        uint256 finish1,
        uint256 rate1,
        uint256 finish2,
        uint256 rate2
    );
    event NextCampaign(
        uint256 reward,
        uint256 duration,
        uint256 finish1,
        uint256 rate1,
        uint256 finish2,
        uint256 rate2
    );
    event UpdateCampaign(
        uint256 reward,
        uint256 duration,
        uint256 finish1,
        uint256 rate1,
        uint256 finish2,
        uint256 rate2
    );

    // This role is in charge of configuring reward distribution
    bytes32 public constant REWARD_DISTRIBUTION = keccak256("REWARD_DISTRIBUTION");
    // Each time a parameter that affects the reward distribution is changed the rewards are distributed by the reward
    // pool contract this is the restart time.
    uint256 public lastUpdateTime;
    // This variable is only used when a new campaign starts (notifyRewardAmount is called)
    // We need to save the rewards accumulated between the last call to restartRewards and the call to notifyRewardAmount
    uint256 public savedRewards;
    // The reward distribution is divided in two periods with two different rated
    //                   |            |            |************|*
    //                   |            |          **|            |*
    //                   |            |        **  |            |*
    //                   |            |      **    |            |*
    //                   |            |    **      |            |*
    //                   |            |  **        |            |*
    //                   |            |**          |            |*
    //                   |        ****|            |            |*
    //                   |    ****    |            |            |*
    //                   |****        |            |            |*
    // zero -> **********|            |            |            |********************
    //                   |<-perido1-> |<-period2-> |<-restart-> |
    uint256 public finish1;
    uint256 public rate1;
    uint256 public finish2;
    uint256 public rate2;

    // The address of the reward pool, the only one authorized to restart rewards
    address public immutable rewardPool;

    constructor(address rewardPool_) {
        rewardPool = rewardPool_;
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    // For the UI
    function getRate() external view returns (uint256) {
        return rate1;
    }

    // For the UI
    function getFinish() external view returns (uint256) {
        return finish1;
    }

    // At any point in time this function must return the accumulated rewards from last call to restartRewards
    function getRewards() external view override returns (uint256) {
        return savedRewards + _getRewards();
    }

    // The main contract has distributed the rewards until this point, this must start from scratch => getRewards() == 0
    function restartRewards() external override {
        require(msg.sender == rewardPool, "not reward pool");
        lastUpdateTime = block.timestamp;
        savedRewards = 0;
    }

    // Useful when switching reward calculators to set an initial reward.
    function setSavedRewards(uint256 reward) external {
        require(hasRole(REWARD_DISTRIBUTION, _msgSender()), "not reward distribution");
        savedRewards = reward;
        lastUpdateTime = block.timestamp;
    }

    // This is a helper function, it is better to call setInitialCampaign or updateNextCampaign directly
    function runCampaign(uint256 reward, uint256 duration) external {
        require(hasRole(REWARD_DISTRIBUTION, _msgSender()), "not reward distribution");
        if (block.timestamp >= finish2) {
            _initialCampaign(reward, duration);
        } else {
            _updateNextCampaign(reward, duration);
        }
    }

    // Start an initial campaign, set the period1 of reward distribution, period2 rate is zero
    function setInitialCampaign(uint256 reward, uint256 duration) external {
        require(hasRole(REWARD_DISTRIBUTION, _msgSender()), "not reward distribution");
        require(block.timestamp >= finish2, "initial campaign running");
        _initialCampaign(reward, duration);
    }

    // Update the period2 of rate distribution, must be called after an initial campaign is set
    // If period1 is running, period2 is set with the rate reward/duration.
    // If period1 is finished it is updated with the values of period2 and period2 is set with the rate reward/duration.
    function updateNextCampaign(uint256 reward, uint256 duration) external {
        require(hasRole(REWARD_DISTRIBUTION, _msgSender()), "not reward distribution");
        require(block.timestamp < finish2, "initial campaign not running");
        _updateNextCampaign(reward, duration);
    }

    function updateCurrentCampaign(uint256 reward, uint256 duration) external {
        require(hasRole(REWARD_DISTRIBUTION, _msgSender()), "not reward distribution");
        require(block.timestamp < finish2, "initial campaign not running");
        _updateCurrentCampaign(reward, duration);
    }

    // Check if both periods already ended => campaign is finished
    function isCampaignFinished() external view returns (bool) {
        return (block.timestamp >= finish2);
    }

    // Check if some of the periods are still running
    function isCampaignRunning() external view returns (bool) {
        return (block.timestamp < finish2);
    }

    function _initialCampaign(uint256 reward, uint256 duration) internal {
        // block.timestamp >= finish2
        _saveRewards();
        finish1 = block.timestamp + duration;
        rate1 = reward / duration;
        finish2 = block.timestamp + duration;
        rate2 = 0;
        emit InitialCampaign(reward, duration, finish1, rate1, finish2, rate2);
    }

    function _updateNextCampaign(uint256 reward, uint256 duration) internal {
        // block.timestamp < finish2
        _saveRewards();
        if (block.timestamp >= finish1) {
            // The next campaign is new.
            finish1 = finish2;
            rate1 = rate2;
        }
        finish2 = finish1 + duration;
        rate2 = reward / duration;
        emit NextCampaign(reward, duration, finish1, rate1, finish2, rate2);
    }

    // TODO: we need to check the logic for this one, what to do with the remainder rewards and the next campaign duration ?
    // TODO: Right now we restart the current campaign forgetting the old values and leaving next one untouched.
    function _updateCurrentCampaign(uint256 reward, uint256 duration) internal {
        _saveRewards();
        if (block.timestamp >= finish1) {
            // The next campaign is new.
            finish1 = finish2;
            rate1 = rate2;
            rate2 = 0;
        }
        assert(finish1 <= finish2);
        uint256 duration2 = finish2 - finish1;
        finish1 = block.timestamp + duration;
        finish2 = finish1 + duration2;
        rate1 = reward / duration;
        emit UpdateCampaign(reward, duration, finish1, rate1, finish2, rate2);
    }

    function _saveRewards() internal {
        savedRewards = savedRewards + _getRewards();
        lastUpdateTime = block.timestamp;
    }

    function _getRewards() internal view returns (uint256) {
        assert(lastUpdateTime <= block.timestamp);
        assert(finish1 <= finish2);
        if (lastUpdateTime >= finish2) {
            return 0;
        }
        if (block.timestamp <= finish1) {
            return (block.timestamp - lastUpdateTime) * rate1;
        }
        // block.timestamp > finish1
        uint256 rewards2 = (Math.min(block.timestamp, finish2) - Math.max(lastUpdateTime, finish1)) * rate2;
        if (lastUpdateTime < finish1) {
            // add reward1 + reward2
            return (finish1 - lastUpdateTime) * rate1 + rewards2;
        }
        return rewards2;
    }
}

File 2 of 9 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 3 of 9 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 9 : IRewardCalculator.sol
//SPDX-License-Identifier: MIT

pragma solidity 0.8.2;

/// @title Plugins for Reward Pools that calculate the rewards must implement this interface
interface IRewardCalculator {
    /// @dev At any point in time this function must return the accumulated rewards from the last call to restartRewards
    function getRewards() external view returns (uint256);

    /// @dev The main contract has distributed the rewards (getRewards()) until this point, this must start
    /// @dev from scratch => getRewards() == 0
    function restartRewards() external;
}

File 5 of 9 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 6 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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 7 of 9 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 8 of 9 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 9 of 9 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"rewardPool_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate2","type":"uint256"}],"name":"InitialCampaign","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate2","type":"uint256"}],"name":"NextCampaign","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate2","type":"uint256"}],"name":"UpdateCampaign","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_DISTRIBUTION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finish1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finish2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isCampaignFinished","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isCampaignRunning","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rate1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rate2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"restartRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"runCampaign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"savedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setInitialCampaign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"setSavedRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"updateCurrentCampaign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"updateNextCampaign","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051620014643803806200146483398101604081905261003191610100565b606081901b6001600160601b03191660805261004e600033610054565b5061012e565b61005e8282610062565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661005e576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556100bc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600060208284031215610111578081fd5b81516001600160a01b0381168114610127578182fd5b9392505050565b60805160601c6113106200015460003960008181610296015261069301526113106000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80637da73d18116100ee578063cf85496911610097578063db63233d11610071578063db63233d14610388578063e9fcdd101461039b578063f555b815146103a4578063fbfe5bd3146103ad576101ae565b8063cf85496914610359578063d4bd8fed14610362578063d547741f14610375576101ae565b8063b0165840116100c8578063b016584014610335578063b073f3421461033d578063c8f33c9114610350576101ae565b80637da73d18146102e357806391d14854146102f6578063a217fddf1461032d576101ae565b8063360f60b11161015b5780634df98bfc116101355780634df98bfc1461026a57806366666aa914610291578063679aefce146102d057806376eb43e9146102d8576101ae565b8063360f60b11461024557806336568abe1461024f5780633ec8ec5a14610262576101ae565b80632ddc40f71161018c5780632ddc40f7146102145780632ede53a3146102295780632f2ff15d14610232576101ae565b806301ffc9a7146101b35780630572b0cc146101db578063248a9ca3146101f1575b600080fd5b6101c66101c13660046110fa565b6103b6565b60405190151581526020015b60405180910390f35b6101e361044f565b6040519081526020016101d2565b6101e36101ff3660046110a8565b60009081526020819052604090206001015490565b61022761022236600461113a565b61046c565b005b6101e360035481565b6102276102403660046110c0565b61050d565b60055442106101c6565b61022761025d3660046110c0565b610539565b6003546101e3565b6101e37f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b81565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d2565b6004546101e3565b6005544210156101c6565b6102276102f136600461113a565b6105c1565b6101c66103043660046110c0565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6101e3600081565b610227610688565b61022761034b3660046110a8565b61070b565b6101e360015481565b6101e360045481565b61022761037036600461113a565b61078a565b6102276103833660046110c0565b61085c565b61022761039636600461113a565b610882565b6101e360025481565b6101e360065481565b6101e360055481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061044957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000610459610953565b600254610466919061120f565b90505b90565b6104967f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6104e75760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064015b60405180910390fd5b60055442106104ff576104fa8282610a45565b610509565b6105098282610adc565b5050565b60008281526020819052604090206001015461052a81335b610b77565b6105348383610bf5565b505050565b6001600160a01b03811633146105b75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016104de565b6105098282610c93565b6105eb7f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6106375760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60055442106104ff5760405162461bcd60e51b815260206004820152601c60248201527f696e697469616c2063616d706169676e206e6f742072756e6e696e670000000060448201526064016104de565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405162461bcd60e51b815260206004820152600f60248201527f6e6f742072657761726420706f6f6c000000000000000000000000000000000060448201526064016104de565b426001556000600255565b6107357f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6107815760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60025542600155565b6107b47f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6108005760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b6005544210156108525760405162461bcd60e51b815260206004820152601860248201527f696e697469616c2063616d706169676e2072756e6e696e67000000000000000060448201526064016104de565b6105098282610a45565b6000828152602081905260409020600101546108788133610525565b6105348383610c93565b6108ac7f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6108f85760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60055442106109495760405162461bcd60e51b815260206004820152601c60248201527f696e697469616c2063616d706169676e206e6f742072756e6e696e670000000060448201526064016104de565b6105098282610d12565b600042600154111561097557634e487b7160e01b600052600160045260246000fd5b600554600354111561099757634e487b7160e01b600052600160045260246000fd5b600554600154106109aa57506000610469565b60035442116109d4576004546001546109c39042611266565b6109cd9190611247565b9050610469565b60006006546109e7600154600354610dfc565b6109f342600554610e15565b6109fd9190611266565b610a079190611247565b905060035460015410156104665780600454600154600354610a299190611266565b610a339190611247565b610a3d919061120f565b915050610469565b610a4d610e24565b610a57814261120f565b600355610a648183611227565b600455610a71814261120f565b6005819055600060068190556003546004546040805187815260208101879052908101929092526060820152608081019290925260a08201527f6613481053266930293e519022ee89096bd8adba04d23586c5e64e20d640ec519060c0015b60405180910390a15050565b610ae4610e24565b6003544210610afa576005546003556006546004555b80600354610b08919061120f565b600555610b158183611227565b60068190556003546004546005546040805187815260208101879052908101939093526060830191909152608082015260a08101919091527f62fe920d1258e46a0c0ad6ae0720652679e9991ca4205c12358d7c4f1d9a73d09060c001610ad0565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661050957610bb3816001600160a01b03166014610e39565b610bbe836020610e39565b604051602001610bcf92919061115b565b60408051601f198184030181529082905262461bcd60e51b82526104de916004016111dc565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610509576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c4f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610509576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610d1a610e24565b6003544210610d355760055460035560068054600455600090555b6005546003541115610d5757634e487b7160e01b600052600160045260246000fd5b6000600354600554610d699190611266565b9050610d75824261120f565b6003819055610d8590829061120f565b600555610d928284611227565b60048190556003546005546006546040805188815260208101889052908101939093526060830193909352608082015260a08101919091527f19902fdc8a70bd6ba84e7161fb544495b8d6e4524914e2df32b024acc5e67fe89060c00160405180910390a1505050565b600081831015610e0c5781610e0e565b825b9392505050565b6000818310610e0c5781610e0e565b610e2c610953565b600254610781919061120f565b60606000610e48836002611247565b610e5390600261120f565b67ffffffffffffffff811115610e7957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610ea3576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610ee857634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610f5957634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000610f95846002611247565b610fa090600161120f565b90505b6001811115611059577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610fef57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061101357634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93611052816112ad565b9050610fa3565b508315610e0e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104de565b6000602082840312156110b9578081fd5b5035919050565b600080604083850312156110d2578081fd5b8235915060208301356001600160a01b03811681146110ef578182fd5b809150509250929050565b60006020828403121561110b578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610e0e578182fd5b6000806040838503121561114c578182fd5b50508035926020909101359150565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161119381601785016020880161127d565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516111d081602884016020880161127d565b01602801949350505050565b60006020825282518060208401526111fb81604085016020870161127d565b601f01601f19169190910160400192915050565b60008219821115611222576112226112c4565b500190565b60008261124257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611261576112616112c4565b500290565b600082821015611278576112786112c4565b500390565b60005b83811015611298578181015183820152602001611280565b838111156112a7576000848401525b50505050565b6000816112bc576112bc6112c4565b506000190190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122018262a595bb1bab4f4a90e9aa87f5ffa69833f69448aa25696f614a9b154e14064736f6c63430008020033000000000000000000000000d3a9caa25393765c05ce9f332b5e33b5e33d8b8f

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101ae5760003560e01c80637da73d18116100ee578063cf85496911610097578063db63233d11610071578063db63233d14610388578063e9fcdd101461039b578063f555b815146103a4578063fbfe5bd3146103ad576101ae565b8063cf85496914610359578063d4bd8fed14610362578063d547741f14610375576101ae565b8063b0165840116100c8578063b016584014610335578063b073f3421461033d578063c8f33c9114610350576101ae565b80637da73d18146102e357806391d14854146102f6578063a217fddf1461032d576101ae565b8063360f60b11161015b5780634df98bfc116101355780634df98bfc1461026a57806366666aa914610291578063679aefce146102d057806376eb43e9146102d8576101ae565b8063360f60b11461024557806336568abe1461024f5780633ec8ec5a14610262576101ae565b80632ddc40f71161018c5780632ddc40f7146102145780632ede53a3146102295780632f2ff15d14610232576101ae565b806301ffc9a7146101b35780630572b0cc146101db578063248a9ca3146101f1575b600080fd5b6101c66101c13660046110fa565b6103b6565b60405190151581526020015b60405180910390f35b6101e361044f565b6040519081526020016101d2565b6101e36101ff3660046110a8565b60009081526020819052604090206001015490565b61022761022236600461113a565b61046c565b005b6101e360035481565b6102276102403660046110c0565b61050d565b60055442106101c6565b61022761025d3660046110c0565b610539565b6003546101e3565b6101e37f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b81565b6102b87f000000000000000000000000d3a9caa25393765c05ce9f332b5e33b5e33d8b8f81565b6040516001600160a01b0390911681526020016101d2565b6004546101e3565b6005544210156101c6565b6102276102f136600461113a565b6105c1565b6101c66103043660046110c0565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6101e3600081565b610227610688565b61022761034b3660046110a8565b61070b565b6101e360015481565b6101e360045481565b61022761037036600461113a565b61078a565b6102276103833660046110c0565b61085c565b61022761039636600461113a565b610882565b6101e360025481565b6101e360065481565b6101e360055481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061044957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000610459610953565b600254610466919061120f565b90505b90565b6104967f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6104e75760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064015b60405180910390fd5b60055442106104ff576104fa8282610a45565b610509565b6105098282610adc565b5050565b60008281526020819052604090206001015461052a81335b610b77565b6105348383610bf5565b505050565b6001600160a01b03811633146105b75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016104de565b6105098282610c93565b6105eb7f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6106375760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60055442106104ff5760405162461bcd60e51b815260206004820152601c60248201527f696e697469616c2063616d706169676e206e6f742072756e6e696e670000000060448201526064016104de565b336001600160a01b037f000000000000000000000000d3a9caa25393765c05ce9f332b5e33b5e33d8b8f16146107005760405162461bcd60e51b815260206004820152600f60248201527f6e6f742072657761726420706f6f6c000000000000000000000000000000000060448201526064016104de565b426001556000600255565b6107357f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6107815760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60025542600155565b6107b47f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6108005760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b6005544210156108525760405162461bcd60e51b815260206004820152601860248201527f696e697469616c2063616d706169676e2072756e6e696e67000000000000000060448201526064016104de565b6105098282610a45565b6000828152602081905260409020600101546108788133610525565b6105348383610c93565b6108ac7f4a46aaaa31bd6eb7c4586d8b31ef0034f45e1cd695217392f1dd55078385ce0b33610304565b6108f85760405162461bcd60e51b815260206004820152601760248201527f6e6f742072657761726420646973747269627574696f6e00000000000000000060448201526064016104de565b60055442106109495760405162461bcd60e51b815260206004820152601c60248201527f696e697469616c2063616d706169676e206e6f742072756e6e696e670000000060448201526064016104de565b6105098282610d12565b600042600154111561097557634e487b7160e01b600052600160045260246000fd5b600554600354111561099757634e487b7160e01b600052600160045260246000fd5b600554600154106109aa57506000610469565b60035442116109d4576004546001546109c39042611266565b6109cd9190611247565b9050610469565b60006006546109e7600154600354610dfc565b6109f342600554610e15565b6109fd9190611266565b610a079190611247565b905060035460015410156104665780600454600154600354610a299190611266565b610a339190611247565b610a3d919061120f565b915050610469565b610a4d610e24565b610a57814261120f565b600355610a648183611227565b600455610a71814261120f565b6005819055600060068190556003546004546040805187815260208101879052908101929092526060820152608081019290925260a08201527f6613481053266930293e519022ee89096bd8adba04d23586c5e64e20d640ec519060c0015b60405180910390a15050565b610ae4610e24565b6003544210610afa576005546003556006546004555b80600354610b08919061120f565b600555610b158183611227565b60068190556003546004546005546040805187815260208101879052908101939093526060830191909152608082015260a08101919091527f62fe920d1258e46a0c0ad6ae0720652679e9991ca4205c12358d7c4f1d9a73d09060c001610ad0565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661050957610bb3816001600160a01b03166014610e39565b610bbe836020610e39565b604051602001610bcf92919061115b565b60408051601f198184030181529082905262461bcd60e51b82526104de916004016111dc565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610509576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c4f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610509576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610d1a610e24565b6003544210610d355760055460035560068054600455600090555b6005546003541115610d5757634e487b7160e01b600052600160045260246000fd5b6000600354600554610d699190611266565b9050610d75824261120f565b6003819055610d8590829061120f565b600555610d928284611227565b60048190556003546005546006546040805188815260208101889052908101939093526060830193909352608082015260a08101919091527f19902fdc8a70bd6ba84e7161fb544495b8d6e4524914e2df32b024acc5e67fe89060c00160405180910390a1505050565b600081831015610e0c5781610e0e565b825b9392505050565b6000818310610e0c5781610e0e565b610e2c610953565b600254610781919061120f565b60606000610e48836002611247565b610e5390600261120f565b67ffffffffffffffff811115610e7957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610ea3576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610ee857634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610f5957634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000610f95846002611247565b610fa090600161120f565b90505b6001811115611059577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610fef57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061101357634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93611052816112ad565b9050610fa3565b508315610e0e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104de565b6000602082840312156110b9578081fd5b5035919050565b600080604083850312156110d2578081fd5b8235915060208301356001600160a01b03811681146110ef578182fd5b809150509250929050565b60006020828403121561110b578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610e0e578182fd5b6000806040838503121561114c578182fd5b50508035926020909101359150565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161119381601785016020880161127d565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516111d081602884016020880161127d565b01602801949350505050565b60006020825282518060208401526111fb81604085016020870161127d565b601f01601f19169190910160400192915050565b60008219821115611222576112226112c4565b500190565b60008261124257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611261576112616112c4565b500290565b600082821015611278576112786112c4565b500390565b60005b83811015611298578181015183820152602001611280565b838111156112a7576000848401525b50505050565b6000816112bc576112bc6112c4565b506000190190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122018262a595bb1bab4f4a90e9aa87f5ffa69833f69448aa25696f614a9b154e14064736f6c63430008020033

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

000000000000000000000000d3a9caa25393765c05ce9f332b5e33b5e33d8b8f

-----Decoded View---------------
Arg [0] : rewardPool_ (address): 0xD3A9CAa25393765c05ce9f332B5E33b5E33D8B8F

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d3a9caa25393765c05ce9f332b5e33b5e33d8b8f


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.