OP Sepolia Testnet

Contract

0x1C98818512e59EA02c7cD47096a6Bfb38Afa9072

Overview

ETH Balance

0 ETH

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x6080604051042562023-12-08 4:50:52198 days ago1702011052IN
 Create: TradingRewards
0 ETH0.004282412.00000013

Advanced mode:
Parent Transaction Hash Block From To Value
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TradingRewards

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at sepolia-optimm.etherscan.io on 2023-12-11
*/

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: TradingRewards.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/TradingRewards.sol
* Docs: https://docs.synthetix.io/contracts/TradingRewards
*
* Contract Dependencies: 
*	- IAddressResolver
*	- ITradingRewards
*	- MixinResolver
*	- Owned
*	- Pausable
*	- ReentrancyGuard
*	- RewardsDistributionRecipient
* Libraries: 
*	- Address
*	- SafeDecimalMath
*	- SafeERC20
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2023 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/



pragma solidity ^0.5.16;

// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/pausable
contract Pausable is Owned {
    uint public lastPauseTime;
    bool public paused;

    constructor() internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");
        // Paused will be false, and lastPauseTime will be 0 upon initialisation
    }

    /**
     * @notice Change the paused state of the contract
     * @dev Only the contract owner may call this.
     */
    function setPaused(bool _paused) external onlyOwner {
        // Ensure we're actually changing the state before we do anything
        if (_paused == paused) {
            return;
        }

        // Set our paused state.
        paused = _paused;

        // If applicable, set the last pause time.
        if (paused) {
            lastPauseTime = now;
        }

        // Let everyone know that our pause state has changed.
        emit PauseChanged(paused);
    }

    event PauseChanged(bool isPaused);

    modifier notPaused {
        require(!paused, "This action cannot be performed while the contract is paused");
        _;
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);

    function getSynth(bytes32 key) external view returns (address);

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address);
}


// https://docs.synthetix.io/contracts/source/interfaces/isynth
interface ISynth {
    // Views
    function currencyKey() external view returns (bytes32);

    function transferableSynths(address account) external view returns (uint);

    // Mutative functions
    function transferAndSettle(address to, uint value) external returns (bool);

    function transferFromAndSettle(
        address from,
        address to,
        uint value
    ) external returns (bool);

    // Restricted: used internally to Synthetix
    function burn(address account, uint amount) external;

    function issue(address account, uint amount) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views

    function allNetworksDebtInfo()
        external
        view
        returns (
            uint256 debt,
            uint256 sharesSupply,
            bool isStale
        );

    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

    function availableCurrencyKeys() external view returns (bytes32[] memory);

    function availableSynthCount() external view returns (uint);

    function availableSynths(uint index) external view returns (ISynth);

    function canBurnSynths(address account) external view returns (bool);

    function collateral(address account) external view returns (uint);

    function collateralisationRatio(address issuer) external view returns (uint);

    function collateralisationRatioAndAnyRatesInvalid(address _issuer)
        external
        view
        returns (uint cratio, bool anyRateIsInvalid);

    function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance);

    function issuanceRatio() external view returns (uint);

    function lastIssueEvent(address account) external view returns (uint);

    function maxIssuableSynths(address issuer) external view returns (uint maxIssuable);

    function minimumStakeTime() external view returns (uint);

    function remainingIssuableSynths(address issuer)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        );

    function synths(bytes32 currencyKey) external view returns (ISynth);

    function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory);

    function synthsByAddress(address synthAddress) external view returns (bytes32);

    function totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) external view returns (uint);

    function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsInvalid);

    function liquidationAmounts(address account, bool isSelfLiquidation)
        external
        view
        returns (
            uint totalRedeemed,
            uint debtToRemove,
            uint escrowToLiquidate,
            uint initialDebtBalance
        );

    // Restricted: used internally to Synthetix
    function addSynths(ISynth[] calldata synthsToAdd) external;

    function issueSynths(address from, uint amount) external;

    function issueSynthsOnBehalf(
        address issueFor,
        address from,
        uint amount
    ) external;

    function issueMaxSynths(address from) external;

    function issueMaxSynthsOnBehalf(address issueFor, address from) external;

    function burnSynths(address from, uint amount) external;

    function burnSynthsOnBehalf(
        address burnForAddress,
        address from,
        uint amount
    ) external;

    function burnSynthsToTarget(address from) external;

    function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external;

    function burnForRedemption(
        address deprecatedSynthProxy,
        address account,
        uint balance
    ) external;

    function setCurrentPeriodId(uint128 periodId) external;

    function liquidateAccount(address account, bool isSelfLiquidation)
        external
        returns (
            uint totalRedeemed,
            uint debtRemoved,
            uint escrowToLiquidate
        );

    function issueSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);

    function burnSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);

    function modifyDebtSharesForMigration(address account, uint amount) external;
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/addressresolver
contract AddressResolver is Owned, IAddressResolver {
    mapping(bytes32 => address) public repository;

    constructor(address _owner) public Owned(_owner) {}

    /* ========== RESTRICTED FUNCTIONS ========== */

    function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner {
        require(names.length == destinations.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            bytes32 name = names[i];
            address destination = destinations[i];
            repository[name] = destination;
            emit AddressImported(name, destination);
        }
    }

    /* ========= PUBLIC FUNCTIONS ========== */

    function rebuildCaches(MixinResolver[] calldata destinations) external {
        for (uint i = 0; i < destinations.length; i++) {
            destinations[i].rebuildCache();
        }
    }

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

    function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) {
        for (uint i = 0; i < names.length; i++) {
            if (repository[names[i]] != destinations[i]) {
                return false;
            }
        }
        return true;
    }

    function getAddress(bytes32 name) external view returns (address) {
        return repository[name];
    }

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) {
        address _foundAddress = repository[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    function getSynth(bytes32 key) external view returns (address) {
        IIssuer issuer = IIssuer(repository["Issuer"]);
        require(address(issuer) != address(0), "Cannot find Issuer address");
        return address(issuer.synths(key));
    }

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

    event AddressImported(bytes32 name, address destination);
}


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinresolver
contract MixinResolver {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    constructor(address _resolver) internal {
        resolver = AddressResolver(_resolver);
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function combineArrays(bytes32[] memory first, bytes32[] memory second)
        internal
        pure
        returns (bytes32[] memory combination)
    {
        combination = new bytes32[](first.length + second.length);

        for (uint i = 0; i < first.length; i++) {
            combination[i] = first[i];
        }

        for (uint j = 0; j < second.length; j++) {
            combination[first.length + j] = second[j];
        }
    }

    /* ========== PUBLIC FUNCTIONS ========== */

    // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {}

    function rebuildCache() public {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        // The resolver must call this function whenver it updates its state
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            address destination =
                resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name)));
            addressCache[name] = destination;
            emit CacheUpdated(name, destination);
        }
    }

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

    function isResolverCached() external view returns (bool) {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // false if our cache is invalid or if the resolver doesn't have the required address
            if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) {
                return false;
            }
        }

        return true;
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function requireAndGetAddress(bytes32 name) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name)));
        return _foundAddress;
    }

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

    event CacheUpdated(bytes32 name, address destination);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/rewardsdistributionrecipient
contract RewardsDistributionRecipient is Owned {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }

    function setRewardsDistribution(address _rewardsDistribution) external onlyOwner {
        rewardsDistribution = _rewardsDistribution;
    }
}


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

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

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

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

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

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

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

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


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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

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


/**
 * @dev Collection of functions related to the address type,
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * > It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}


/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied 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.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor () internal {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @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() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}


// Libraries


// https://docs.synthetix.io/contracts/source/libraries/safedecimalmath
library SafeDecimalMath {
    using SafeMath for uint;

    /* Number of decimal places in the representations. */
    uint8 public constant decimals = 18;
    uint8 public constant highPrecisionDecimals = 27;

    /* The number representing 1.0. */
    uint public constant UNIT = 10**uint(decimals);

    /* The number representing 1.0 for higher fidelity numbers. */
    uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
    uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);

    /**
     * @return Provides an interface to UNIT.
     */
    function unit() external pure returns (uint) {
        return UNIT;
    }

    /**
     * @return Provides an interface to PRECISE_UNIT.
     */
    function preciseUnit() external pure returns (uint) {
        return PRECISE_UNIT;
    }

    /**
     * @return The result of multiplying x and y, interpreting the operands as fixed-point
     * decimals.
     *
     * @dev A unit factor is divided out after the product of x and y is evaluated,
     * so that product must be less than 2**256. As this is an integer division,
     * the internal division always rounds down. This helps save on gas. Rounding
     * is more expensive on gas.
     */
    function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        return x.mul(y) / UNIT;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of the specified precision unit.
     *
     * @dev The operands should be in the form of a the specified unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function _multiplyDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a precise unit.
     *
     * @dev The operands should be in the precise unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a standard unit.
     *
     * @dev The operands should be in the standard unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is a high
     * precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and UNIT must be less than 2**256. As
     * this is an integer division, the result is always rounded down.
     * This helps save on gas. Rounding is more expensive on gas.
     */
    function divideDecimal(uint x, uint y) internal pure returns (uint) {
        /* Reintroduce the UNIT factor that will be divided out by y. */
        return x.mul(UNIT).div(y);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * decimal in the precision unit specified in the parameter.
     *
     * @dev y is divided after the product of x and the specified precision unit
     * is evaluated, so the product of x and the specified precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function _divideDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        uint resultTimesTen = x.mul(precisionUnit * 10).div(y);

        if (resultTimesTen % 10 >= 5) {
            resultTimesTen += 10;
        }

        return resultTimesTen / 10;
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * standard precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and the standard precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * high precision decimal.
     *
     * @dev y is divided after the product of x and the high precision unit
     * is evaluated, so the product of x and the high precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @dev Convert a standard decimal representation to a high precision one.
     */
    function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
        return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
    }

    /**
     * @dev Convert a high precision decimal to a standard decimal representation.
     */
    function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
        uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    // Computes `a - b`, setting the value to 0 if b > a.
    function floorsub(uint a, uint b) internal pure returns (uint) {
        return b >= a ? 0 : a - b;
    }

    /* ---------- Utilities ---------- */
    /*
     * Absolute value of the input, returned as a signed number.
     */
    function signedAbs(int x) internal pure returns (int) {
        return x < 0 ? -x : x;
    }

    /*
     * Absolute value of the input, returned as an unsigned number.
     */
    function abs(int x) internal pure returns (uint) {
        return uint(signedAbs(x));
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/itradingrewards
interface ITradingRewards {
    /* ========== VIEWS ========== */

    function getAvailableRewards() external view returns (uint);

    function getUnassignedRewards() external view returns (uint);

    function getRewardsToken() external view returns (address);

    function getPeriodController() external view returns (address);

    function getCurrentPeriod() external view returns (uint);

    function getPeriodIsClaimable(uint periodID) external view returns (bool);

    function getPeriodIsFinalized(uint periodID) external view returns (bool);

    function getPeriodRecordedFees(uint periodID) external view returns (uint);

    function getPeriodTotalRewards(uint periodID) external view returns (uint);

    function getPeriodAvailableRewards(uint periodID) external view returns (uint);

    function getUnaccountedFeesForAccountForPeriod(address account, uint periodID) external view returns (uint);

    function getAvailableRewardsForAccountForPeriod(address account, uint periodID) external view returns (uint);

    function getAvailableRewardsForAccountForPeriods(address account, uint[] calldata periodIDs)
        external
        view
        returns (uint totalRewards);

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

    function claimRewardsForPeriod(uint periodID) external;

    function claimRewardsForPeriods(uint[] calldata periodIDs) external;

    /* ========== RESTRICTED FUNCTIONS ========== */

    function recordExchangeFeeForAccount(uint usdFeeAmount, address account) external;

    function closeCurrentPeriodWithRewards(uint rewards) external;

    function recoverTokens(address tokenAddress, address recoverAddress) external;

    function recoverUnassignedRewardTokens(address recoverAddress) external;

    function recoverAssignedRewardTokensAndDestroyPeriod(address recoverAddress, uint periodID) external;

    function setPeriodController(address newPeriodController) external;
}


interface IVirtualSynth {
    // Views
    function balanceOfUnderlying(address account) external view returns (uint);

    function rate() external view returns (uint);

    function readyToSettle() external view returns (bool);

    function secsLeftInWaitingPeriod() external view returns (uint);

    function settled() external view returns (bool);

    function synth() external view returns (ISynth);

    // Mutative functions
    function settle(address account) external;
}


pragma experimental ABIEncoderV2;


// https://docs.synthetix.io/contracts/source/interfaces/iexchanger
interface IExchanger {
    struct ExchangeEntrySettlement {
        bytes32 src;
        uint amount;
        bytes32 dest;
        uint reclaim;
        uint rebate;
        uint srcRoundIdAtPeriodEnd;
        uint destRoundIdAtPeriodEnd;
        uint timestamp;
    }

    struct ExchangeEntry {
        uint sourceRate;
        uint destinationRate;
        uint destinationAmount;
        uint exchangeFeeRate;
        uint exchangeDynamicFeeRate;
        uint roundIdForSrc;
        uint roundIdForDest;
        uint sourceAmountAfterSettlement;
    }

    // Views
    function calculateAmountAfterSettlement(
        address from,
        bytes32 currencyKey,
        uint amount,
        uint refunded
    ) external view returns (uint amountAfterSettlement);

    function isSynthRateInvalid(bytes32 currencyKey) external view returns (bool);

    function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) external view returns (uint);

    function settlementOwing(address account, bytes32 currencyKey)
        external
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries
        );

    function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool);

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint);

    function dynamicFeeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint feeRate, bool tooVolatile);

    function getAmountsForExchange(
        uint sourceAmount,
        bytes32 sourceCurrencyKey,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint amountReceived,
            uint fee,
            uint exchangeFeeRate
        );

    function priceDeviationThresholdFactor() external view returns (uint);

    function waitingPeriodSecs() external view returns (uint);

    function lastExchangeRate(bytes32 currencyKey) external view returns (uint);

    // Mutative functions
    function exchange(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bool virtualSynth,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function exchangeAtomically(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    function settle(address from, bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );
}

// Used to have strongly-typed access to internal mutative functions in Synthetix
interface ISynthetixInternal {
    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        uint256 fee
    ) external;

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitAtomicSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;
}

interface IExchangerInternalDebtCache {
    function updateCachedSynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external;

    function updateCachedSynthDebts(bytes32[] calldata currencyKeys) external;
}


// Internal dependencies.


// External dependencies.


// Libraries.


// Internal references.


// https://docs.synthetix.io/contracts/source/contracts/tradingrewards
contract TradingRewards is ITradingRewards, ReentrancyGuard, Owned, Pausable, MixinResolver, RewardsDistributionRecipient {
    using SafeMath for uint;
    using SafeDecimalMath for uint;
    using SafeERC20 for IERC20;

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

    uint private _currentPeriodID;
    uint private _balanceAssignedToRewards;
    mapping(uint => Period) private _periods;

    struct Period {
        bool isFinalized;
        uint recordedFees;
        uint totalRewards;
        uint availableRewards;
        mapping(address => uint) unaccountedFeesForAccount;
    }

    address private _periodController;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */

    bytes32 private constant CONTRACT_EXCHANGER = "Exchanger";
    bytes32 private constant CONTRACT_SYNTHETIX = "Synthetix";

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

    constructor(
        address owner,
        address periodController,
        address resolver
    ) public Owned(owner) MixinResolver(resolver) {
        require(periodController != address(0), "Invalid period controller");

        _periodController = periodController;
    }

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

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](2);
        addresses[0] = CONTRACT_EXCHANGER;
        addresses[1] = CONTRACT_SYNTHETIX;
    }

    function synthetix() internal view returns (IERC20) {
        return IERC20(requireAndGetAddress(CONTRACT_SYNTHETIX));
    }

    function exchanger() internal view returns (IExchanger) {
        return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER));
    }

    function getAvailableRewards() external view returns (uint) {
        return _balanceAssignedToRewards;
    }

    function getUnassignedRewards() external view returns (uint) {
        return synthetix().balanceOf(address(this)).sub(_balanceAssignedToRewards);
    }

    function getRewardsToken() external view returns (address) {
        return address(synthetix());
    }

    function getPeriodController() external view returns (address) {
        return _periodController;
    }

    function getCurrentPeriod() external view returns (uint) {
        return _currentPeriodID;
    }

    function getPeriodIsClaimable(uint periodID) external view returns (bool) {
        return _periods[periodID].isFinalized;
    }

    function getPeriodIsFinalized(uint periodID) external view returns (bool) {
        return _periods[periodID].isFinalized;
    }

    function getPeriodRecordedFees(uint periodID) external view returns (uint) {
        return _periods[periodID].recordedFees;
    }

    function getPeriodTotalRewards(uint periodID) external view returns (uint) {
        return _periods[periodID].totalRewards;
    }

    function getPeriodAvailableRewards(uint periodID) external view returns (uint) {
        return _periods[periodID].availableRewards;
    }

    function getUnaccountedFeesForAccountForPeriod(address account, uint periodID) external view returns (uint) {
        return _periods[periodID].unaccountedFeesForAccount[account];
    }

    function getAvailableRewardsForAccountForPeriod(address account, uint periodID) external view returns (uint) {
        return _calculateRewards(account, periodID);
    }

    function getAvailableRewardsForAccountForPeriods(address account, uint[] calldata periodIDs)
        external
        view
        returns (uint totalRewards)
    {
        for (uint i = 0; i < periodIDs.length; i++) {
            uint periodID = periodIDs[i];

            totalRewards = totalRewards.add(_calculateRewards(account, periodID));
        }
    }

    function _calculateRewards(address account, uint periodID) internal view returns (uint) {
        Period storage period = _periods[periodID];
        if (period.availableRewards == 0 || period.recordedFees == 0 || !period.isFinalized) {
            return 0;
        }

        uint accountFees = period.unaccountedFeesForAccount[account];
        if (accountFees == 0) {
            return 0;
        }

        uint participationRatio = accountFees.divideDecimal(period.recordedFees);
        return participationRatio.multiplyDecimal(period.totalRewards);
    }

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

    function claimRewardsForPeriod(uint periodID) external nonReentrant notPaused {
        _claimRewards(msg.sender, periodID);
    }

    function claimRewardsForPeriods(uint[] calldata periodIDs) external nonReentrant notPaused {
        for (uint i = 0; i < periodIDs.length; i++) {
            uint periodID = periodIDs[i];

            // Will revert if any independent claim reverts.
            _claimRewards(msg.sender, periodID);
        }
    }

    function _claimRewards(address account, uint periodID) internal {
        Period storage period = _periods[periodID];
        require(period.isFinalized, "Period is not finalized");

        uint amountToClaim = _calculateRewards(account, periodID);
        require(amountToClaim > 0, "No rewards available");

        period.unaccountedFeesForAccount[account] = 0;
        period.availableRewards = period.availableRewards.sub(amountToClaim);

        _balanceAssignedToRewards = _balanceAssignedToRewards.sub(amountToClaim);

        synthetix().safeTransfer(account, amountToClaim);

        emit RewardsClaimed(account, amountToClaim, periodID);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function recordExchangeFeeForAccount(uint usdFeeAmount, address account) external onlyExchanger {
        Period storage period = _periods[_currentPeriodID];
        // Note: In theory, the current period will never be finalized.
        // Such a require could be added here, but it would just spend gas, since it should always satisfied.

        period.unaccountedFeesForAccount[account] = period.unaccountedFeesForAccount[account].add(usdFeeAmount);
        period.recordedFees = period.recordedFees.add(usdFeeAmount);

        emit ExchangeFeeRecorded(account, usdFeeAmount, _currentPeriodID);
    }

    function closeCurrentPeriodWithRewards(uint rewards) external onlyPeriodController {
        uint currentBalance = synthetix().balanceOf(address(this));
        uint availableForNewRewards = currentBalance.sub(_balanceAssignedToRewards);
        require(rewards <= availableForNewRewards, "Insufficient free rewards");

        Period storage period = _periods[_currentPeriodID];

        period.totalRewards = rewards;
        period.availableRewards = rewards;
        period.isFinalized = true;

        _balanceAssignedToRewards = _balanceAssignedToRewards.add(rewards);

        emit PeriodFinalizedWithRewards(_currentPeriodID, rewards);

        _currentPeriodID = _currentPeriodID.add(1);

        emit NewPeriodStarted(_currentPeriodID);
    }

    function recoverTokens(address tokenAddress, address recoverAddress) external onlyOwner {
        _validateRecoverAddress(recoverAddress);
        require(tokenAddress != address(synthetix()), "Must use another function");

        IERC20 token = IERC20(tokenAddress);

        uint tokenBalance = token.balanceOf(address(this));
        require(tokenBalance > 0, "No tokens to recover");

        token.safeTransfer(recoverAddress, tokenBalance);

        emit TokensRecovered(tokenAddress, recoverAddress, tokenBalance);
    }

    function recoverUnassignedRewardTokens(address recoverAddress) external onlyOwner {
        _validateRecoverAddress(recoverAddress);

        uint tokenBalance = synthetix().balanceOf(address(this));
        require(tokenBalance > 0, "No tokens to recover");

        uint unassignedBalance = tokenBalance.sub(_balanceAssignedToRewards);
        require(unassignedBalance > 0, "No tokens to recover");

        synthetix().safeTransfer(recoverAddress, unassignedBalance);

        emit UnassignedRewardTokensRecovered(recoverAddress, unassignedBalance);
    }

    function recoverAssignedRewardTokensAndDestroyPeriod(address recoverAddress, uint periodID) external onlyOwner {
        _validateRecoverAddress(recoverAddress);
        require(periodID < _currentPeriodID, "Cannot recover from active");

        Period storage period = _periods[periodID];
        require(period.availableRewards > 0, "No rewards available to recover");

        uint amount = period.availableRewards;
        synthetix().safeTransfer(recoverAddress, amount);

        _balanceAssignedToRewards = _balanceAssignedToRewards.sub(amount);

        delete _periods[periodID];

        emit AssignedRewardTokensRecovered(recoverAddress, amount, periodID);
    }

    function notifyRewardAmount(uint256 reward) external {}

    function _validateRecoverAddress(address recoverAddress) internal view {
        if (recoverAddress == address(0) || recoverAddress == address(this)) {
            revert("Invalid recover address");
        }
    }

    function setPeriodController(address newPeriodController) external onlyOwner {
        require(newPeriodController != address(0), "Invalid period controller");

        _periodController = newPeriodController;

        emit PeriodControllerChanged(newPeriodController);
    }

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

    modifier onlyPeriodController() {
        require(msg.sender == _periodController, "Caller not period controller");
        _;
    }

    modifier onlyExchanger() {
        require(msg.sender == address(exchanger()), "Only Exchanger can invoke this");
        _;
    }

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

    event ExchangeFeeRecorded(address indexed account, uint amount, uint periodID);
    event RewardsClaimed(address indexed account, uint amount, uint periodID);
    event NewPeriodStarted(uint periodID);
    event PeriodFinalizedWithRewards(uint periodID, uint rewards);
    event TokensRecovered(address tokenAddress, address recoverAddress, uint amount);
    event UnassignedRewardTokensRecovered(address recoverAddress, uint amount);
    event AssignedRewardTokensRecovered(address recoverAddress, uint amount, uint periodID);
    event PeriodControllerChanged(address newPeriodController);
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"periodController","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recoverAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"AssignedRewardTokensRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"ExchangeFeeRecorded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"NewPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPeriodController","type":"address"}],"name":"PeriodControllerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"periodID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"PeriodFinalizedWithRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"recoverAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recoverAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnassignedRewardTokensRecovered","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"claimRewardsForPeriod","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256[]","name":"periodIDs","type":"uint256[]"}],"name":"claimRewardsForPeriods","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"closeCurrentPeriodWithRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAvailableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getAvailableRewardsForAccountForPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"periodIDs","type":"uint256[]"}],"name":"getAvailableRewardsForAccountForPeriods","outputs":[{"internalType":"uint256","name":"totalRewards","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getPeriodAvailableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPeriodController","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getPeriodIsClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getPeriodIsFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getPeriodRecordedFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getPeriodTotalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"getUnaccountedFeesForAccountForPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getUnassignedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"usdFeeAmount","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"recordExchangeFeeForAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recoverAddress","type":"address"},{"internalType":"uint256","name":"periodID","type":"uint256"}],"name":"recoverAssignedRewardTokensAndDestroyPeriod","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recoverAddress","type":"address"}],"name":"recoverTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recoverAddress","type":"address"}],"name":"recoverUnassignedRewardTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPeriodController","type":"address"}],"name":"setPeriodController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"}],"name":"setRewardsDistribution","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200271b3803806200271b83398101604081905262000034916200016e565b600160005580836001600160a01b0381166200006d5760405162461bcd60e51b81526004016200006490620002cd565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383161790556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90620000bd90600090849062000283565b60405180910390a1506001546001600160a01b0316620000f15760405162461bcd60e51b81526004016200006490620002bb565b60048054610100600160a81b0319166101006001600160a01b03938416021790558216620001335760405162461bcd60e51b81526004016200006490620002a9565b50600a80546001600160a01b0319166001600160a01b03929092169190911790555062000328565b805162000168816200030e565b92915050565b6000806000606084860312156200018457600080fd5b60006200019286866200015b565b9350506020620001a5868287016200015b565b9250506040620001b8868287016200015b565b9150509250925092565b620001cd81620002fa565b82525050565b620001cd81620002e8565b6000620001ed601983620002df565b7f496e76616c696420706572696f6420636f6e74726f6c6c657200000000000000815260200192915050565b600062000228601183620002df565b7013dddb995c881b5d5cdd081899481cd95d607a1b815260200192915050565b600062000257601983620002df565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60408101620002938285620001c2565b620002a26020830184620001d3565b9392505050565b602080825281016200016881620001de565b60208082528101620001688162000219565b60208082528101620001688162000248565b90815260200190565b60006001600160a01b03821662000168565b6000620001688260006200016882620002e8565b6200031981620002e8565b81146200032557600080fd5b50565b6123e380620003386000396000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c80636fe4136b11610125578063ae934a7a116100ad578063dea021a51161007c578063dea021a5146103fa578063f32ffd6914610402578063f61f5df614610415578063f6b5847914610428578063fc9c99ac1461043b57610211565b8063ae934a7a146103c1578063b225dbaa146103d4578063ccb6e04314610297578063ce7fccba146103e757610211565b8063899ffef4116100f4578063899ffef4146103815780638da5cb5b1461039657806391b4ded91461039e578063937ffb8f146103a65780639865fdb7146103b957610211565b80636fe4136b14610356578063706848d21461035e578063741853601461037157806379ba50971461037957610211565b806321cad774116101a85780633dbf12fa116101775780633dbf12fa1461030b5780633fc6df6e1461031e57806353a47bb71461033357806355aa41bf1461033b5780635c975abb1461034e57610211565b806321cad774146102ca5780632af64bd3146102dd57806338dfa8cf146102e55780633c6b16ab146102f857610211565b806316841952116101e4578063168419521461027157806316c38b3c14610284578063175c51891461029757806319762143146102b757610211565b806304f3bcec14610216578063056097ac14610234578063086146d2146102495780631627540c1461025e575b600080fd5b61021e610443565b60405161022b9190612178565b60405180910390f35b6102476102423660046117fd565b610457565b005b6102516105a8565b60405161022b919061213c565b61024761026c3660046117b9565b6105af565b61024761027f36600461193b565b61060d565b6102476102923660046118ff565b6107b9565b6102aa6102a536600461193b565b61082e565b60405161022b919061212e565b6102476102c53660046117b9565b610843565b6102476102d8366004611977565b61086d565b6102aa610960565b6102476102f33660046117b9565b610a7d565b61024761030636600461193b565b61082b565b6102476103193660046117b9565b610bcf565b610326610c48565b60405161022b9190612096565b610326610c57565b61025161034936600461193b565b610c66565b6102aa610c7b565b610326610c84565b61025161036c36600461193b565b610c93565b610247610ca8565b610247610dfe565b610389610e9a565b60405161022b919061211d565b610326610f09565b610251610f18565b6102516103b436600461193b565b610f1e565b610251610f33565b6102476103cf36600461188d565b610fca565b6102476103e236600461193b565b6110b1565b6102516103f536600461188d565b61110a565b61032661111f565b6102476104103660046118bd565b61112e565b61025161042336600461188d565b6111b8565b610251610436366004611837565b6111e3565b610251611233565b60045461010090046001600160a01b031681565b61045f611239565b61046881611265565b6104706112a0565b6001600160a01b0316826001600160a01b031614156104aa5760405162461bcd60e51b81526004016104a1906122c7565b60405180910390fd5b6040516370a0823160e01b815282906000906001600160a01b038316906370a08231906104db903090600401612096565b60206040518083038186803b1580156104f357600080fd5b505afa158015610507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061052b9190810190611959565b90506000811161054d5760405162461bcd60e51b81526004016104a190612297565b6105676001600160a01b038316848363ffffffff6112b716565b7f401f439d865a766757ec78675925bd67198d5e78805aa41691b34b5d6a6cbbe684848360405161059a939291906120bf565b60405180910390a150505050565b6007545b90565b6105b7611239565b600280546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290610602908390612096565b60405180910390a150565b600a546001600160a01b031633146106375760405162461bcd60e51b81526004016104a1906122e7565b60006106416112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161066c9190612096565b60206040518083038186803b15801561068457600080fd5b505afa158015610698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106bc9190810190611959565b905060006106d56008548361131090919063ffffffff16565b9050808311156106f75760405162461bcd60e51b81526004016104a190612277565b60075460009081526009602052604090206002810184905560038101849055805460ff19166001178155600854610734908563ffffffff61133816565b6008556007546040517ffa0492b63d7120c62ccb8708eb597813e6968a23d09adac98d54dd0085cb264f9161076a9187906122f7565b60405180910390a160075461078690600163ffffffff61133816565b60078190556040517f4368a9298adc0e57eceb11d0ef07022051a2feb5985d832be0764cde9a2307329161059a9161213c565b6107c1611239565b60045460ff16151581151514156107d75761082b565b6004805460ff1916821515179081905560ff16156107f457426003555b6004546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916106029160ff9091169061212e565b50565b60009081526009602052604090205460ff1690565b61084b611239565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b61087561135d565b6001600160a01b0316336001600160a01b0316146108a55760405162461bcd60e51b81526004016104a1906121b7565b60075460009081526009602090815260408083206001600160a01b038516845260048101909252909120546108e0908463ffffffff61133816565b6001600160a01b03831660009081526004830160205260409020556001810154610910908463ffffffff61133816565b60018201556007546040516001600160a01b038416917f927be3e95451b16be3f4586524834dfffa10e6f9ee4c1e26fe3c46140fbbf866916109539187916122f7565b60405180910390a2505050565b6000606061096c610e9a565b905060005b8151811015610a7457600082828151811061098857fe5b60209081029190910181015160008181526005909252604091829020546004805493516321f8a72160e01b81529294506001600160a01b03918216936101009004909116916321f8a721916109df9186910161213c565b60206040518083038186803b1580156109f757600080fd5b505afa158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a2f91908101906117df565b6001600160a01b0316141580610a5a57506000818152600560205260409020546001600160a01b0316155b15610a6b57600093505050506105ac565b50600101610971565b50600191505090565b610a85611239565b610a8e81611265565b6000610a986112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ac39190612096565b60206040518083038186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b139190810190611959565b905060008111610b355760405162461bcd60e51b81526004016104a190612297565b6000610b4c6008548361131090919063ffffffff16565b905060008111610b6e5760405162461bcd60e51b81526004016104a190612297565b610b918382610b7b6112a0565b6001600160a01b0316919063ffffffff6112b716565b7f14e7312259d4851b8b6742ace55ac44b31d7929a6b2998b35ba22445859e5ee38382604051610bc29291906120e7565b60405180910390a1505050565b610bd7611239565b6001600160a01b038116610bfd5760405162461bcd60e51b81526004016104a190612287565b600a80546001600160a01b0319166001600160a01b0383161790556040517fb81e5409e39d3d3d85951a2af3563e484cfe2e7b4af2500a0ecbe14035a9bddc90610602908390612096565b6006546001600160a01b031681565b6002546001600160a01b031681565b60009081526009602052604090206001015490565b60045460ff1681565b6000610c8e6112a0565b905090565b60009081526009602052604090206003015490565b6060610cb2610e9a565b905060005b8151811015610dfa576000828281518110610cce57fe5b602002602001015190506000600460019054906101000a90046001600160a01b03166001600160a01b031663dacb2d018384604051602001610d10919061208b565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610d3c929190612158565b60206040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d8c91908101906117df565b6000838152600560205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa6890610de8908490849061214a565b60405180910390a15050600101610cb7565b5050565b6002546001600160a01b03163314610e285760405162461bcd60e51b81526004016104a1906121a7565b6001546002546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610e6b926001600160a01b03918216929116906120a4565b60405180910390a160028054600180546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600280825260608083018452926020830190803883390190505090506822bc31b430b733b2b960b91b81600081518110610ed457fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600181518110610efa57fe5b60200260200101818152505090565b6001546001600160a01b031681565b60035481565b60009081526009602052604090206002015490565b6000610c8e600854610f436112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610f6e9190612096565b60206040518083038186803b158015610f8657600080fd5b505afa158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fbe9190810190611959565b9063ffffffff61131016565b610fd2611239565b610fdb82611265565b6007548110610ffc5760405162461bcd60e51b81526004016104a190612257565b6000818152600960205260409020600381015461102b5760405162461bcd60e51b81526004016104a1906121d7565b600381015461103d8482610b7b6112a0565b600854611050908263ffffffff61131016565b600855600083815260096020526040808220805460ff19168155600181018390556002810183905560030191909155517f60f2caebb6d06055322fce1f0db429f6bc0a48534c8c9ba42359a80f36bb7f0c9061059a90869084908790612102565b600080546001019081905560045460ff16156110df5760405162461bcd60e51b81526004016104a190612267565b6110e93383611374565b6000548114610dfa5760405162461bcd60e51b81526004016104a1906122b7565b60006111168383611472565b90505b92915050565b600a546001600160a01b031690565b600080546001019081905560045460ff161561115c5760405162461bcd60e51b81526004016104a190612267565b60005b8281101561119157600084848381811061117557fe5b9050602002013590506111883382611374565b5060010161115f565b5060005481146111b35760405162461bcd60e51b81526004016104a1906122b7565b505050565b60009081526009602090815260408083206001600160a01b0394909416835260049093019052205490565b6000805b8281101561122b5760008484838181106111fd57fe5b9050602002013590506112206112138783611472565b849063ffffffff61133816565b9250506001016111e7565b509392505050565b60085490565b6001546001600160a01b031633146112635760405162461bcd60e51b81526004016104a190612227565b565b6001600160a01b038116158061128357506001600160a01b03811630145b1561082b5760405162461bcd60e51b81526004016104a190612197565b6000610c8e680a6f2dce8d0cae8d2f60bb1b611516565b6040516111b390849063a9059cbb60e01b906112d990869086906024016120e7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261157a565b6000828211156113325760405162461bcd60e51b81526004016104a1906121f7565b50900390565b6000828201838110156111165760405162461bcd60e51b81526004016104a1906121c7565b6000610c8e6822bc31b430b733b2b960b91b611516565b6000818152600960205260409020805460ff166113a35760405162461bcd60e51b81526004016104a190612217565b60006113af8484611472565b9050600081116113d15760405162461bcd60e51b81526004016104a190612237565b6001600160a01b03841660009081526004830160205260408120556003820154611401908263ffffffff61131016565b6003830155600854611419908263ffffffff61131016565b6008556114298482610b7b6112a0565b836001600160a01b03167fdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e32582856040516114649291906122f7565b60405180910390a250505050565b60008181526009602052604081206003810154158061149357506001810154155b806114a05750805460ff16155b156114af576000915050611119565b6001600160a01b0384166000908152600482016020526040902054806114da57600092505050611119565b60006114f383600101548361166590919063ffffffff16565b905061150c83600201548261168f90919063ffffffff16565b9695505050505050565b60008181526005602090815260408083205490516001600160a01b0390911691821515916115469186910161206b565b604051602081830303815290604052906115735760405162461bcd60e51b81526004016104a19190612186565b5092915050565b61158c826001600160a01b03166116b9565b6115a85760405162461bcd60e51b81526004016104a1906122d7565b60006060836001600160a01b0316836040516115c49190612058565b6000604051808303816000865af19150503d8060008114611601576040519150601f19603f3d011682016040523d82523d6000602084013e611606565b606091505b5091509150816116285760405162461bcd60e51b81526004016104a1906121e7565b80511561165f5780806020019051611643919081019061191d565b61165f5760405162461bcd60e51b81526004016104a1906122a7565b50505050565b60006111168261168385670de0b6b3a764000063ffffffff6116bf16565b9063ffffffff6116f916565b6000670de0b6b3a76400006116aa848463ffffffff6116bf16565b816116b157fe5b049392505050565b3b151590565b6000826116ce57506000611119565b828202828482816116db57fe5b04146111165760405162461bcd60e51b81526004016104a190612247565b600080821161171a5760405162461bcd60e51b81526004016104a190612207565b600082848161172557fe5b04949350505050565b80356111198161237a565b80516111198161237a565b60008083601f84011261175657600080fd5b50813567ffffffffffffffff81111561176e57600080fd5b60208301915083602082028301111561178657600080fd5b9250929050565b80356111198161238e565b80516111198161238e565b803561111981612397565b805161111981612397565b6000602082840312156117cb57600080fd5b60006117d7848461172e565b949350505050565b6000602082840312156117f157600080fd5b60006117d78484611739565b6000806040838503121561181057600080fd5b600061181c858561172e565b925050602061182d8582860161172e565b9150509250929050565b60008060006040848603121561184c57600080fd5b6000611858868661172e565b935050602084013567ffffffffffffffff81111561187557600080fd5b61188186828701611744565b92509250509250925092565b600080604083850312156118a057600080fd5b60006118ac858561172e565b925050602061182d858286016117a3565b600080602083850312156118d057600080fd5b823567ffffffffffffffff8111156118e757600080fd5b6118f385828601611744565b92509250509250929050565b60006020828403121561191157600080fd5b60006117d7848461178d565b60006020828403121561192f57600080fd5b60006117d78484611798565b60006020828403121561194d57600080fd5b60006117d784846117a3565b60006020828403121561196b57600080fd5b60006117d784846117ae565b6000806040838503121561198a57600080fd5b600061181c85856117a3565b60006119a28383611a1b565b505060200190565b6119b38161231d565b82525050565b60006119c48261230b565b6119ce818561230f565b93506119d983612305565b8060005b83811015611a075781516119f18882611996565b97506119fc83612305565b9250506001016119dd565b509495945050505050565b6119b381612328565b6119b3816105ac565b6119b3611a30826105ac565b6105ac565b6000611a408261230b565b611a4a8185612318565b9350611a5a818560208601612344565b9290920192915050565b6119b381612339565b6000611a788261230b565b611a82818561230f565b9350611a92818560208601612344565b611a9b81612370565b9093019392505050565b6000611ab260178361230f565b7f496e76616c6964207265636f7665722061646472657373000000000000000000815260200192915050565b6000611aeb60358361230f565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611b42601e8361230f565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000611b7b601b8361230f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611bb4601f8361230f565b7f4e6f207265776172647320617661696c61626c6520746f207265636f76657200815260200192915050565b6000611bed60208361230f565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000611c26601e8361230f565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000611c5f601a8361230f565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000611c98601183612318565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611cc560178361230f565b7f506572696f64206973206e6f742066696e616c697a6564000000000000000000815260200192915050565b6000611cfe602f8361230f565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b6000611d4f60148361230f565b734e6f207265776172647320617661696c61626c6560601b815260200192915050565b6000611d7f60218361230f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000611dc2601a8361230f565b7f43616e6e6f74207265636f7665722066726f6d20616374697665000000000000815260200192915050565b6000611dfb603c8361230f565b7f5468697320616374696f6e2063616e6e6f7420626520706572666f726d65642081527f7768696c652074686520636f6e74726163742069732070617573656400000000602082015260400192915050565b6000611e5a601983612318565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000611e9360198361230f565b7f496e73756666696369656e742066726565207265776172647300000000000000815260200192915050565b6000611ecc60198361230f565b7f496e76616c696420706572696f6420636f6e74726f6c6c657200000000000000815260200192915050565b6000611f0560148361230f565b732737903a37b5b2b739903a37903932b1b7bb32b960611b815260200192915050565b6000611f35602a8361230f565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b6000611f81601f8361230f565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000611fba60198361230f565b7f4d7573742075736520616e6f746865722066756e6374696f6e00000000000000815260200192915050565b6000611ff3601f8361230f565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b600061202c601c8361230f565b7f43616c6c6572206e6f7420706572696f6420636f6e74726f6c6c657200000000815260200192915050565b60006120648284611a35565b9392505050565b600061207682611c8b565b91506120828284611a24565b50602001919050565b600061207682611e4d565b6020810161111982846119aa565b604081016120b282856119aa565b61206460208301846119aa565b606081016120cd82866119aa565b6120da60208301856119aa565b6117d76040830184611a1b565b604081016120f582856119aa565b6120646020830184611a1b565b6060810161211082866119aa565b6120da6020830185611a1b565b6020808252810161111681846119b9565b602081016111198284611a12565b602081016111198284611a1b565b604081016120b28285611a1b565b604081016121668285611a1b565b81810360208301526117d78184611a6d565b602081016111198284611a64565b602080825281016111168184611a6d565b6020808252810161111981611aa5565b6020808252810161111981611ade565b6020808252810161111981611b35565b6020808252810161111981611b6e565b6020808252810161111981611ba7565b6020808252810161111981611be0565b6020808252810161111981611c19565b6020808252810161111981611c52565b6020808252810161111981611cb8565b6020808252810161111981611cf1565b6020808252810161111981611d42565b6020808252810161111981611d72565b6020808252810161111981611db5565b6020808252810161111981611dee565b6020808252810161111981611e86565b6020808252810161111981611ebf565b6020808252810161111981611ef8565b6020808252810161111981611f28565b6020808252810161111981611f74565b6020808252810161111981611fad565b6020808252810161111981611fe6565b602080825281016111198161201f565b604081016120f58285611a1b565b60200190565b5190565b90815260200190565b919050565b60006111198261232d565b151590565b6001600160a01b031690565b60006111198261231d565b60005b8381101561235f578181015183820152602001612347565b8381111561165f5750506000910152565b601f01601f191690565b6123838161231d565b811461082b57600080fd5b61238381612328565b612383816105ac56fea365627a7a723158201c686ada6d5c8f58b5ad15ed20d29d820d8b9d5f3c1a51bbeaa00ca6a519264b6c6578706572696d656e74616cf564736f6c6343000510004000000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9000000000000000000000000529c553ef2d0370279dc8abf19702b98b166d252

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102115760003560e01c80636fe4136b11610125578063ae934a7a116100ad578063dea021a51161007c578063dea021a5146103fa578063f32ffd6914610402578063f61f5df614610415578063f6b5847914610428578063fc9c99ac1461043b57610211565b8063ae934a7a146103c1578063b225dbaa146103d4578063ccb6e04314610297578063ce7fccba146103e757610211565b8063899ffef4116100f4578063899ffef4146103815780638da5cb5b1461039657806391b4ded91461039e578063937ffb8f146103a65780639865fdb7146103b957610211565b80636fe4136b14610356578063706848d21461035e578063741853601461037157806379ba50971461037957610211565b806321cad774116101a85780633dbf12fa116101775780633dbf12fa1461030b5780633fc6df6e1461031e57806353a47bb71461033357806355aa41bf1461033b5780635c975abb1461034e57610211565b806321cad774146102ca5780632af64bd3146102dd57806338dfa8cf146102e55780633c6b16ab146102f857610211565b806316841952116101e4578063168419521461027157806316c38b3c14610284578063175c51891461029757806319762143146102b757610211565b806304f3bcec14610216578063056097ac14610234578063086146d2146102495780631627540c1461025e575b600080fd5b61021e610443565b60405161022b9190612178565b60405180910390f35b6102476102423660046117fd565b610457565b005b6102516105a8565b60405161022b919061213c565b61024761026c3660046117b9565b6105af565b61024761027f36600461193b565b61060d565b6102476102923660046118ff565b6107b9565b6102aa6102a536600461193b565b61082e565b60405161022b919061212e565b6102476102c53660046117b9565b610843565b6102476102d8366004611977565b61086d565b6102aa610960565b6102476102f33660046117b9565b610a7d565b61024761030636600461193b565b61082b565b6102476103193660046117b9565b610bcf565b610326610c48565b60405161022b9190612096565b610326610c57565b61025161034936600461193b565b610c66565b6102aa610c7b565b610326610c84565b61025161036c36600461193b565b610c93565b610247610ca8565b610247610dfe565b610389610e9a565b60405161022b919061211d565b610326610f09565b610251610f18565b6102516103b436600461193b565b610f1e565b610251610f33565b6102476103cf36600461188d565b610fca565b6102476103e236600461193b565b6110b1565b6102516103f536600461188d565b61110a565b61032661111f565b6102476104103660046118bd565b61112e565b61025161042336600461188d565b6111b8565b610251610436366004611837565b6111e3565b610251611233565b60045461010090046001600160a01b031681565b61045f611239565b61046881611265565b6104706112a0565b6001600160a01b0316826001600160a01b031614156104aa5760405162461bcd60e51b81526004016104a1906122c7565b60405180910390fd5b6040516370a0823160e01b815282906000906001600160a01b038316906370a08231906104db903090600401612096565b60206040518083038186803b1580156104f357600080fd5b505afa158015610507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061052b9190810190611959565b90506000811161054d5760405162461bcd60e51b81526004016104a190612297565b6105676001600160a01b038316848363ffffffff6112b716565b7f401f439d865a766757ec78675925bd67198d5e78805aa41691b34b5d6a6cbbe684848360405161059a939291906120bf565b60405180910390a150505050565b6007545b90565b6105b7611239565b600280546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290610602908390612096565b60405180910390a150565b600a546001600160a01b031633146106375760405162461bcd60e51b81526004016104a1906122e7565b60006106416112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161066c9190612096565b60206040518083038186803b15801561068457600080fd5b505afa158015610698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106bc9190810190611959565b905060006106d56008548361131090919063ffffffff16565b9050808311156106f75760405162461bcd60e51b81526004016104a190612277565b60075460009081526009602052604090206002810184905560038101849055805460ff19166001178155600854610734908563ffffffff61133816565b6008556007546040517ffa0492b63d7120c62ccb8708eb597813e6968a23d09adac98d54dd0085cb264f9161076a9187906122f7565b60405180910390a160075461078690600163ffffffff61133816565b60078190556040517f4368a9298adc0e57eceb11d0ef07022051a2feb5985d832be0764cde9a2307329161059a9161213c565b6107c1611239565b60045460ff16151581151514156107d75761082b565b6004805460ff1916821515179081905560ff16156107f457426003555b6004546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916106029160ff9091169061212e565b50565b60009081526009602052604090205460ff1690565b61084b611239565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b61087561135d565b6001600160a01b0316336001600160a01b0316146108a55760405162461bcd60e51b81526004016104a1906121b7565b60075460009081526009602090815260408083206001600160a01b038516845260048101909252909120546108e0908463ffffffff61133816565b6001600160a01b03831660009081526004830160205260409020556001810154610910908463ffffffff61133816565b60018201556007546040516001600160a01b038416917f927be3e95451b16be3f4586524834dfffa10e6f9ee4c1e26fe3c46140fbbf866916109539187916122f7565b60405180910390a2505050565b6000606061096c610e9a565b905060005b8151811015610a7457600082828151811061098857fe5b60209081029190910181015160008181526005909252604091829020546004805493516321f8a72160e01b81529294506001600160a01b03918216936101009004909116916321f8a721916109df9186910161213c565b60206040518083038186803b1580156109f757600080fd5b505afa158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a2f91908101906117df565b6001600160a01b0316141580610a5a57506000818152600560205260409020546001600160a01b0316155b15610a6b57600093505050506105ac565b50600101610971565b50600191505090565b610a85611239565b610a8e81611265565b6000610a986112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ac39190612096565b60206040518083038186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b139190810190611959565b905060008111610b355760405162461bcd60e51b81526004016104a190612297565b6000610b4c6008548361131090919063ffffffff16565b905060008111610b6e5760405162461bcd60e51b81526004016104a190612297565b610b918382610b7b6112a0565b6001600160a01b0316919063ffffffff6112b716565b7f14e7312259d4851b8b6742ace55ac44b31d7929a6b2998b35ba22445859e5ee38382604051610bc29291906120e7565b60405180910390a1505050565b610bd7611239565b6001600160a01b038116610bfd5760405162461bcd60e51b81526004016104a190612287565b600a80546001600160a01b0319166001600160a01b0383161790556040517fb81e5409e39d3d3d85951a2af3563e484cfe2e7b4af2500a0ecbe14035a9bddc90610602908390612096565b6006546001600160a01b031681565b6002546001600160a01b031681565b60009081526009602052604090206001015490565b60045460ff1681565b6000610c8e6112a0565b905090565b60009081526009602052604090206003015490565b6060610cb2610e9a565b905060005b8151811015610dfa576000828281518110610cce57fe5b602002602001015190506000600460019054906101000a90046001600160a01b03166001600160a01b031663dacb2d018384604051602001610d10919061208b565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610d3c929190612158565b60206040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d8c91908101906117df565b6000838152600560205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa6890610de8908490849061214a565b60405180910390a15050600101610cb7565b5050565b6002546001600160a01b03163314610e285760405162461bcd60e51b81526004016104a1906121a7565b6001546002546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92610e6b926001600160a01b03918216929116906120a4565b60405180910390a160028054600180546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600280825260608083018452926020830190803883390190505090506822bc31b430b733b2b960b91b81600081518110610ed457fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600181518110610efa57fe5b60200260200101818152505090565b6001546001600160a01b031681565b60035481565b60009081526009602052604090206002015490565b6000610c8e600854610f436112a0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610f6e9190612096565b60206040518083038186803b158015610f8657600080fd5b505afa158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fbe9190810190611959565b9063ffffffff61131016565b610fd2611239565b610fdb82611265565b6007548110610ffc5760405162461bcd60e51b81526004016104a190612257565b6000818152600960205260409020600381015461102b5760405162461bcd60e51b81526004016104a1906121d7565b600381015461103d8482610b7b6112a0565b600854611050908263ffffffff61131016565b600855600083815260096020526040808220805460ff19168155600181018390556002810183905560030191909155517f60f2caebb6d06055322fce1f0db429f6bc0a48534c8c9ba42359a80f36bb7f0c9061059a90869084908790612102565b600080546001019081905560045460ff16156110df5760405162461bcd60e51b81526004016104a190612267565b6110e93383611374565b6000548114610dfa5760405162461bcd60e51b81526004016104a1906122b7565b60006111168383611472565b90505b92915050565b600a546001600160a01b031690565b600080546001019081905560045460ff161561115c5760405162461bcd60e51b81526004016104a190612267565b60005b8281101561119157600084848381811061117557fe5b9050602002013590506111883382611374565b5060010161115f565b5060005481146111b35760405162461bcd60e51b81526004016104a1906122b7565b505050565b60009081526009602090815260408083206001600160a01b0394909416835260049093019052205490565b6000805b8281101561122b5760008484838181106111fd57fe5b9050602002013590506112206112138783611472565b849063ffffffff61133816565b9250506001016111e7565b509392505050565b60085490565b6001546001600160a01b031633146112635760405162461bcd60e51b81526004016104a190612227565b565b6001600160a01b038116158061128357506001600160a01b03811630145b1561082b5760405162461bcd60e51b81526004016104a190612197565b6000610c8e680a6f2dce8d0cae8d2f60bb1b611516565b6040516111b390849063a9059cbb60e01b906112d990869086906024016120e7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261157a565b6000828211156113325760405162461bcd60e51b81526004016104a1906121f7565b50900390565b6000828201838110156111165760405162461bcd60e51b81526004016104a1906121c7565b6000610c8e6822bc31b430b733b2b960b91b611516565b6000818152600960205260409020805460ff166113a35760405162461bcd60e51b81526004016104a190612217565b60006113af8484611472565b9050600081116113d15760405162461bcd60e51b81526004016104a190612237565b6001600160a01b03841660009081526004830160205260408120556003820154611401908263ffffffff61131016565b6003830155600854611419908263ffffffff61131016565b6008556114298482610b7b6112a0565b836001600160a01b03167fdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e32582856040516114649291906122f7565b60405180910390a250505050565b60008181526009602052604081206003810154158061149357506001810154155b806114a05750805460ff16155b156114af576000915050611119565b6001600160a01b0384166000908152600482016020526040902054806114da57600092505050611119565b60006114f383600101548361166590919063ffffffff16565b905061150c83600201548261168f90919063ffffffff16565b9695505050505050565b60008181526005602090815260408083205490516001600160a01b0390911691821515916115469186910161206b565b604051602081830303815290604052906115735760405162461bcd60e51b81526004016104a19190612186565b5092915050565b61158c826001600160a01b03166116b9565b6115a85760405162461bcd60e51b81526004016104a1906122d7565b60006060836001600160a01b0316836040516115c49190612058565b6000604051808303816000865af19150503d8060008114611601576040519150601f19603f3d011682016040523d82523d6000602084013e611606565b606091505b5091509150816116285760405162461bcd60e51b81526004016104a1906121e7565b80511561165f5780806020019051611643919081019061191d565b61165f5760405162461bcd60e51b81526004016104a1906122a7565b50505050565b60006111168261168385670de0b6b3a764000063ffffffff6116bf16565b9063ffffffff6116f916565b6000670de0b6b3a76400006116aa848463ffffffff6116bf16565b816116b157fe5b049392505050565b3b151590565b6000826116ce57506000611119565b828202828482816116db57fe5b04146111165760405162461bcd60e51b81526004016104a190612247565b600080821161171a5760405162461bcd60e51b81526004016104a190612207565b600082848161172557fe5b04949350505050565b80356111198161237a565b80516111198161237a565b60008083601f84011261175657600080fd5b50813567ffffffffffffffff81111561176e57600080fd5b60208301915083602082028301111561178657600080fd5b9250929050565b80356111198161238e565b80516111198161238e565b803561111981612397565b805161111981612397565b6000602082840312156117cb57600080fd5b60006117d7848461172e565b949350505050565b6000602082840312156117f157600080fd5b60006117d78484611739565b6000806040838503121561181057600080fd5b600061181c858561172e565b925050602061182d8582860161172e565b9150509250929050565b60008060006040848603121561184c57600080fd5b6000611858868661172e565b935050602084013567ffffffffffffffff81111561187557600080fd5b61188186828701611744565b92509250509250925092565b600080604083850312156118a057600080fd5b60006118ac858561172e565b925050602061182d858286016117a3565b600080602083850312156118d057600080fd5b823567ffffffffffffffff8111156118e757600080fd5b6118f385828601611744565b92509250509250929050565b60006020828403121561191157600080fd5b60006117d7848461178d565b60006020828403121561192f57600080fd5b60006117d78484611798565b60006020828403121561194d57600080fd5b60006117d784846117a3565b60006020828403121561196b57600080fd5b60006117d784846117ae565b6000806040838503121561198a57600080fd5b600061181c85856117a3565b60006119a28383611a1b565b505060200190565b6119b38161231d565b82525050565b60006119c48261230b565b6119ce818561230f565b93506119d983612305565b8060005b83811015611a075781516119f18882611996565b97506119fc83612305565b9250506001016119dd565b509495945050505050565b6119b381612328565b6119b3816105ac565b6119b3611a30826105ac565b6105ac565b6000611a408261230b565b611a4a8185612318565b9350611a5a818560208601612344565b9290920192915050565b6119b381612339565b6000611a788261230b565b611a82818561230f565b9350611a92818560208601612344565b611a9b81612370565b9093019392505050565b6000611ab260178361230f565b7f496e76616c6964207265636f7665722061646472657373000000000000000000815260200192915050565b6000611aeb60358361230f565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611b42601e8361230f565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000611b7b601b8361230f565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611bb4601f8361230f565b7f4e6f207265776172647320617661696c61626c6520746f207265636f76657200815260200192915050565b6000611bed60208361230f565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000611c26601e8361230f565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000611c5f601a8361230f565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000611c98601183612318565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611cc560178361230f565b7f506572696f64206973206e6f742066696e616c697a6564000000000000000000815260200192915050565b6000611cfe602f8361230f565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b6000611d4f60148361230f565b734e6f207265776172647320617661696c61626c6560601b815260200192915050565b6000611d7f60218361230f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000611dc2601a8361230f565b7f43616e6e6f74207265636f7665722066726f6d20616374697665000000000000815260200192915050565b6000611dfb603c8361230f565b7f5468697320616374696f6e2063616e6e6f7420626520706572666f726d65642081527f7768696c652074686520636f6e74726163742069732070617573656400000000602082015260400192915050565b6000611e5a601983612318565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000611e9360198361230f565b7f496e73756666696369656e742066726565207265776172647300000000000000815260200192915050565b6000611ecc60198361230f565b7f496e76616c696420706572696f6420636f6e74726f6c6c657200000000000000815260200192915050565b6000611f0560148361230f565b732737903a37b5b2b739903a37903932b1b7bb32b960611b815260200192915050565b6000611f35602a8361230f565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b6000611f81601f8361230f565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000611fba60198361230f565b7f4d7573742075736520616e6f746865722066756e6374696f6e00000000000000815260200192915050565b6000611ff3601f8361230f565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b600061202c601c8361230f565b7f43616c6c6572206e6f7420706572696f6420636f6e74726f6c6c657200000000815260200192915050565b60006120648284611a35565b9392505050565b600061207682611c8b565b91506120828284611a24565b50602001919050565b600061207682611e4d565b6020810161111982846119aa565b604081016120b282856119aa565b61206460208301846119aa565b606081016120cd82866119aa565b6120da60208301856119aa565b6117d76040830184611a1b565b604081016120f582856119aa565b6120646020830184611a1b565b6060810161211082866119aa565b6120da6020830185611a1b565b6020808252810161111681846119b9565b602081016111198284611a12565b602081016111198284611a1b565b604081016120b28285611a1b565b604081016121668285611a1b565b81810360208301526117d78184611a6d565b602081016111198284611a64565b602080825281016111168184611a6d565b6020808252810161111981611aa5565b6020808252810161111981611ade565b6020808252810161111981611b35565b6020808252810161111981611b6e565b6020808252810161111981611ba7565b6020808252810161111981611be0565b6020808252810161111981611c19565b6020808252810161111981611c52565b6020808252810161111981611cb8565b6020808252810161111981611cf1565b6020808252810161111981611d42565b6020808252810161111981611d72565b6020808252810161111981611db5565b6020808252810161111981611dee565b6020808252810161111981611e86565b6020808252810161111981611ebf565b6020808252810161111981611ef8565b6020808252810161111981611f28565b6020808252810161111981611f74565b6020808252810161111981611fad565b6020808252810161111981611fe6565b602080825281016111198161201f565b604081016120f58285611a1b565b60200190565b5190565b90815260200190565b919050565b60006111198261232d565b151590565b6001600160a01b031690565b60006111198261231d565b60005b8381101561235f578181015183820152602001612347565b8381111561165f5750506000910152565b601f01601f191690565b6123838161231d565b811461082b57600080fd5b61238381612328565b612383816105ac56fea365627a7a723158201c686ada6d5c8f58b5ad15ed20d29d820d8b9d5f3c1a51bbeaa00ca6a519264b6c6578706572696d656e74616cf564736f6c63430005100040

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

00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9000000000000000000000000529c553ef2d0370279dc8abf19702b98b166d252

-----Decoded View---------------
Arg [0] : owner (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [1] : periodController (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [2] : resolver (address): 0x529C553eF2d0370279DC8AbF19702B98b166D252

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [1] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [2] : 000000000000000000000000529c553ef2d0370279dc8abf19702b98b166d252


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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.