ETH Price: $3,921.95 (-0.30%)

Contract

0x58bF325843b25B4767A3ff4Ef69B1b7B47493528
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardCampaign

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.5.16;

pragma experimental ABIEncoderV2;

import {Ownable} from "../lib/Ownable.sol";
import {SafeMath} from "../lib/SafeMath.sol";
import {SafeERC20} from "../lib/SafeERC20.sol";
import {Decimal} from "../lib/Decimal.sol";
import {Adminable} from "../lib/Adminable.sol";

import {IERC20} from "../token/IERC20.sol";

import {IMozartCoreV1} from "../debt/mozart/IMozartCoreV1.sol";
import {MozartTypes} from "../debt/mozart/MozartTypes.sol";

contract RewardCampaign is Adminable {

    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /* ========== Structs ========== */

    struct Staker {
        uint256 positionId;
        uint256 debtSnapshot;
        uint256 balance;
        uint256 rewardPerTokenStored;
        uint256 rewardPerTokenPaid;
        uint256 rewardsEarned;
        uint256 rewardsReleased;
        address stateContract;
    }

    /* ========== Variables ========== */

    IERC20 public rewardsToken;
    IERC20 public stakingToken;

    mapping(address => bool) public approvedStateContracts;
    address[] public approvedStateContractsArray;

    address public arcDAO;
    address public rewardsDistributor;

    mapping (address => Staker) public stakers;

    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public rewardsDuration = 0;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;

    Decimal.D256 public daoAllocation;
    Decimal.D256 public slasherCut;

    uint256 public vestingEndDate;
    uint256 public debtToStake;

    bool public tokensClaimable;

    uint256 private _totalSupply;

    /* ========== Events ========== */

    event RewardAdded (uint256 reward);

    event Staked(address indexed user, uint256 amount);

    event Withdrawn(address indexed user, uint256 amount);

    event RewardPaid(address indexed user, uint256 reward);

    event RewardsDurationUpdated(uint256 newDuration);

    event Recovered(address token, uint256 amount);

    event PositionStaked(address _address, uint256 _positionId);

    event ClaimableStatusUpdated(bool _status);

    event UserSlashed(address _user, address _slasher, uint256 _amount);

    event StateContractApproved(address _address);

    /* ========== Modifiers ========== */

    modifier updateReward(address account) {
        rewardPerTokenStored = actualRewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();

        if (account != address(0)) {
            stakers[account].rewardsEarned = actualEarned(account);
            stakers[account].rewardPerTokenPaid = rewardPerTokenStored;
        }
        _;
    }

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

    /* ========== Admin Functions ========== */

    function setRewardsDistributor(
        address _rewardsDistributor
    )
        external
        onlyAdmin
    {
        rewardsDistributor = _rewardsDistributor;
    }

    function setRewardsDuration(
        uint256 _rewardsDuration
    )
        external
        onlyAdmin
    {
        require(
            periodFinish == 0 || getCurrentTimestamp() > periodFinish,
            "Prev period must be complete before changing duration for new period"
        );

        rewardsDuration = _rewardsDuration;
        emit RewardsDurationUpdated(rewardsDuration);
    }

    function notifyRewardAmount(
        uint256 reward
    )
        external
        onlyRewardsDistributor
        updateReward(address(0))
    {
        if (getCurrentTimestamp() >= periodFinish) {
            rewardRate = reward.div(rewardsDuration);
        } else {
            uint256 remaining = periodFinish.sub(getCurrentTimestamp());
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(rewardsDuration);
        }

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

        lastUpdateTime = getCurrentTimestamp();
        periodFinish = getCurrentTimestamp().add(rewardsDuration);
        emit RewardAdded(reward);
    }

    function recoverERC20(
        address tokenAddress,
        uint256 tokenAmount
    )
        public
        onlyAdmin
    {
        // Cannot recover the staking token or the rewards token
        require(
            tokenAddress != address(stakingToken) && tokenAddress != address(rewardsToken),
            "Cannot withdraw the staking or rewards tokens"
        );

        IERC20(tokenAddress).safeTransfer(getAdmin(), tokenAmount);
        emit Recovered(tokenAddress, tokenAmount);
    }

    function setTokensClaimable(
        bool _enabled
    )
        public
        onlyAdmin
    {
        tokensClaimable = _enabled;

        emit ClaimableStatusUpdated(_enabled);
    }

    function init(
        address _arcDAO,
        address _rewardsDistribution,
        address _rewardsToken,
        address _stakingToken,
        Decimal.D256 memory _daoAllocation,
        Decimal.D256 memory _slasherCut,
        uint256 _vestingEndDate,
        uint256 _debtToStake
    )
        public
        onlyAdmin
    {
        arcDAO = _arcDAO;
        rewardsDistributor = _rewardsDistribution;
        rewardsToken = IERC20(_rewardsToken);
        stakingToken = IERC20(_stakingToken);

        daoAllocation = _daoAllocation;
        slasherCut = _slasherCut;
        rewardsToken = IERC20(_rewardsToken);
        vestingEndDate = _vestingEndDate;
        debtToStake = _debtToStake;
    }

    function setApprovedStateContract(
        address _stateContract
    )
        public
        onlyAdmin
    {
        require(
            _stateContract != address(0),
            "State contract must be valid"
        );

        require(
            approvedStateContracts[_stateContract] != true,
            "The given state contract is already approved"
        );

        approvedStateContracts[_stateContract] = true;
        approvedStateContractsArray.push(_stateContract);
        emit StateContractApproved(_stateContract);
    }

    function setApprovedStateContracts(
        address[] memory _stateContracts
    )
        public
        onlyAdmin
    {
        for (uint256 i = 0; i < _stateContracts.length; i++) {
            setApprovedStateContract(_stateContracts[i]);
        }
    }

    /* ========== View Functions ========== */

    function totalSupply()
        public
        view
        returns (uint256)
    {
        return _totalSupply;
    }

    function balanceOf(
        address account
    )
        public
        view
        returns (uint256)
    {
        return stakers[account].balance;
    }

    function lastTimeRewardApplicable()
        public
        view
        returns (uint256)
    {
        return getCurrentTimestamp() < periodFinish ? getCurrentTimestamp() : periodFinish;
    }

    function actualRewardPerToken()
        internal
        view
        returns (uint256)
    {
        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        }

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

    function rewardPerToken()
        public
        view
        returns (uint256)
    {
        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        }

        // Since we're adding the stored amount we can't just multiply
        // the userAllocation() with the result of actualRewardPerToken()
        return
            rewardPerTokenStored.add(
                Decimal.mul(
                    lastTimeRewardApplicable()
                        .sub(lastUpdateTime)
                        .mul(rewardRate)
                        .mul(1e18)
                        .div(_totalSupply),
                    userAllocation()
                )
            );
    }

    function actualEarned(
        address account
    )
        internal
        view
        returns (uint256)
    {
        return stakers[account]
            .balance
            .mul(actualRewardPerToken().sub(stakers[account].rewardPerTokenPaid))
            .div(1e18)
            .add(stakers[account].rewardsEarned);
    }

    function earned(
        address account
    )
        public
        view
        returns (uint256)
    {
        return Decimal.mul(
            actualEarned(account),
            userAllocation()
        );
    }

    function getRewardForDuration()
        public
        view
        returns (uint256)
    {
        return rewardRate.mul(rewardsDuration);
    }

    function getCurrentTimestamp()
        public
        view
        returns (uint256)
    {
        return block.timestamp;
    }

    function isMinter(
        address _user,
        uint256 _amount,
        uint256 _positionId,
        address _stateContract
    )
        public
        view
        returns (bool)
    {
        require(
            approvedStateContracts[_stateContract] == true,
            "The state contract is not registered"
        );

        IMozartCoreV1 stateContract = IMozartCoreV1(_stateContract);
        MozartTypes.Position memory position = stateContract.getPosition(_positionId);

        if (position.owner != _user) {
            return false;
        }

        return uint256(position.borrowedAmount.value) >= _amount;
    }

    function  userAllocation()
        public
        view
        returns (Decimal.D256 memory)
    {
        return Decimal.sub(
            Decimal.one(),
            daoAllocation.value
        );
    }

    function getAllApprovedStateContracts()
        public
        view
        returns (address[] memory)
    {
        return approvedStateContractsArray;
    }

    /* ========== Mutative Functions ========== */

    function stake(
        uint256 amount,
        uint256 positionId,
        address stateContract
    )
        external
        updateReward(msg.sender)
    {
        uint256 totalBalance = balanceOf(msg.sender).add(amount);

        // Setting each variable invididually means we don't overwrite
        Staker storage staker = stakers[msg.sender];

        require(
            staker.stateContract == address(0) || staker.stateContract == stateContract,
            "Cannot re-stake to a different state contract"
        );

        uint256 debtRequirement = totalBalance.mul(debtToStake);

        require(
            isMinter(
                msg.sender,
                debtRequirement,
                positionId,
                stateContract
            ),
            "Must be a valid minter"
        );

        // This stops an attack vector where a user stakes a lot of money
        // then drops the debt requirement by staking less before the deadline
        // to reduce the amount of debt they need to lock in

        require(
            debtRequirement >= staker.debtSnapshot,
            "Your new debt requirement cannot be lower than last time"
        );

        staker.positionId = positionId;
        staker.debtSnapshot = debtRequirement;
        staker.balance = staker.balance.add(amount);
        staker.stateContract = stateContract;

        _totalSupply = _totalSupply.add(amount);

        stakingToken.safeTransferFrom(msg.sender, address(this), amount);

        emit Staked(msg.sender, amount);
    }

    function slash(
        address user
    )
        external
        updateReward(user)
    {
        require(
            user != msg.sender,
            "You cannot slash yourself"
        );

        require(
            getCurrentTimestamp() < vestingEndDate,
            "You cannot slash after the vesting end date"
        );

        Staker storage userStaker = stakers[user];

        require(
            isMinter(
                user,
                userStaker.debtSnapshot,
                userStaker.positionId,
                userStaker.stateContract
            ) == false,
            "You can't slash a user who is a valid minter"
        );

        uint256 penalty = userStaker.rewardsEarned;
        uint256 bounty = Decimal.mul(penalty, slasherCut);

        stakers[msg.sender].rewardsEarned = stakers[msg.sender].rewardsEarned.add(bounty);
        stakers[rewardsDistributor].rewardsEarned = stakers[rewardsDistributor].rewardsEarned.add(
            penalty.sub(bounty)
        );

        userStaker.rewardsEarned = 0;

        emit UserSlashed(user, msg.sender, penalty);

    }

    function getReward(address user)
        public
        updateReward(user)
    {
        require(
            tokensClaimable == true,
            "Tokens cannnot be claimed yet"
        );

        if (getCurrentTimestamp() < periodFinish) {
            // If you try to claim your reward even once the tokens are claimable
            // and the reward period is finished you'll get nothing lol.
            return;
        }

        Staker storage staker = stakers[user];

        uint256 totalAmount = staker.rewardsEarned.sub(staker.rewardsReleased);
        uint256 payableAmount = totalAmount;
        uint256 duration = vestingEndDate.sub(periodFinish);

        if (getCurrentTimestamp() < vestingEndDate) {
            payableAmount = totalAmount.mul(getCurrentTimestamp().sub(periodFinish)).div(duration);
        }

        staker.rewardsReleased = staker.rewardsReleased.add(payableAmount);

        uint256 daoPayable = Decimal.mul(payableAmount, daoAllocation);

        rewardsToken.safeTransfer(arcDAO, daoPayable);
        rewardsToken.safeTransfer(user, payableAmount.sub(daoPayable));

        emit RewardPaid(user, payableAmount);
    }

    function withdraw(
        uint256 amount
    )
        public
        updateReward(msg.sender)
    {
        require(
            amount >= 0,
            "Cannot withdraw less than 0"
        );

        _totalSupply = _totalSupply.sub(amount);
        stakers[msg.sender].balance = stakers[msg.sender].balance.sub(amount);

        stakingToken.safeTransfer(msg.sender, amount);

        emit Withdrawn(msg.sender, amount);
    }

    function exit()
        public
    {
        getReward(msg.sender);
        withdraw(balanceOf(msg.sender));
    }

}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
    }

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 12 : SafeMath.sol
pragma solidity ^0.5.16;

library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

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

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {

        require(b > 0, "SafeMath: division by zero");
        uint256 c = a / b;

        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        uint256 c = a - b;

        return c;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }
}

File 4 of 12 : SafeERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.5.16;

import {IERC20} from "../token/IERC20.sol";

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library SafeERC20 {
    function safeApprove(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        /* solium-disable-next-line */
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(0x095ea7b3, to, value)
        );

        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "SafeERC20: APPROVE_FAILED"
        );
    }

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        /* solium-disable-next-line */
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(0xa9059cbb, to, value)
        );

        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "SafeERC20: TRANSFER_FAILED"
        );
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        /* solium-disable-next-line */
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(
                0x23b872dd,
                from,
                to,
                value
            )
        );

        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "SafeERC20: TRANSFER_FROM_FAILED"
        );
    }
}

File 5 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

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

File 6 of 12 : Decimal.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import {SafeMath} from "../lib/SafeMath.sol";
import {Math} from "./Math.sol";

/**
 * @title Decimal
 *
 * Library that defines a fixed-point number with 18 decimal places.
 */
library Decimal {
    using SafeMath for uint256;

    // ============ Constants ============

    uint256 constant BASE = 10**18;

    // ============ Structs ============

    struct D256 {
        uint256 value;
    }

    // ============ Functions ============

    function one()
        internal
        pure
        returns (D256 memory)
    {
        return D256({ value: BASE });
    }

    function onePlus(
        D256 memory d
    )
        internal
        pure
        returns (D256 memory)
    {
        return D256({ value: d.value.add(BASE) });
    }

    function mul(
        uint256 target,
        D256 memory d
    )
        internal
        pure
        returns (uint256)
    {
        return Math.getPartial(target, d.value, BASE);
    }

    function mul(
        D256 memory d1,
        D256 memory d2
    )
        internal
        pure
        returns (D256 memory)
    {
        return Decimal.D256({ value: Math.getPartial(d1.value, d2.value, BASE) });
    }

    function div(
        uint256 target,
        D256 memory d
    )
        internal
        pure
        returns (uint256)
    {
        return Math.getPartial(target, BASE, d.value);
    }

    function add(
        D256 memory d,
        uint256 amount
    )
        internal
        pure
        returns (D256 memory)
    {
        return D256({ value: d.value.add(amount) });
    }

    function sub(
        D256 memory d,
        uint256 amount
    )
        internal
        pure
        returns (D256 memory)
    {
        return D256({ value: d.value.sub(amount) });
    }

}

File 7 of 12 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import {SafeMath} from "./SafeMath.sol";

/**
 * @title Math
 *
 * Library for non-standard Math functions
 */
library Math {
    using SafeMath for uint256;

    // ============ Library Functions ============

    /*
     * Return target * (numerator / denominator).
     */
    function getPartial(
        uint256 target,
        uint256 numerator,
        uint256 denominator
    )
        internal
        pure
        returns (uint256)
    {
        return target.mul(numerator).div(denominator);
    }

    function to128(
        uint256 number
    )
        internal
        pure
        returns (uint128)
    {
        uint128 result = uint128(number);
        require(
            result == number,
            "Math: Unsafe cast to uint128"
        );
        return result;
    }

    function min(
        uint256 a,
        uint256 b
    )
        internal
        pure
        returns (uint256)
    {
        return a < b ? a : b;
    }

    function max(
        uint256 a,
        uint256 b
    )
        internal
        pure
        returns (uint256)
    {
        return a > b ? a : b;
    }
}

File 8 of 12 : Adminable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import { Storage } from "./Storage.sol";

/**
 * @title Adminable
 * @author dYdX
 *
 * @dev EIP-1967 Proxy Admin contract.
 */
contract Adminable {
    /**
     * @dev Storage slot with the admin of the contract.
     *  This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    bytes32 internal constant ADMIN_SLOT =
    0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
    * @dev Modifier to check whether the `msg.sender` is the admin.
    *  If it is, it will run the function. Otherwise, it will revert.
    */
    modifier onlyAdmin() {
        require(
            msg.sender == getAdmin(),
            "Adminable: caller is not admin"
        );
        _;
    }

    /**
     * @return The EIP-1967 proxy admin
     */
    function getAdmin()
        public
        view
        returns (address)
    {
        return address(uint160(uint256(Storage.load(ADMIN_SLOT))));
    }
}

File 9 of 12 : Storage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

library Storage {

    /**
     * @dev Performs an SLOAD and returns the data in the slot.
     */
    function load(
        bytes32 slot
    )
        internal
        view
        returns (bytes32)
    {
        bytes32 result;
        /* solium-disable-next-line security/no-inline-assembly */
        assembly {
            result := sload(slot)
        }
        return result;
    }

    /**
     * @dev Performs an SSTORE to save the value to the slot.
     */
    function store(
        bytes32 slot,
        bytes32 value
    )
        internal
    {
        /* solium-disable-next-line security/no-inline-assembly */
        assembly {
            sstore(slot, value)
        }
    }
}

File 10 of 12 : IMozartCoreV1.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import {Decimal} from "../../lib/Decimal.sol";
import {Amount} from "../../lib/Amount.sol";

import {MozartTypes} from "./MozartTypes.sol";

interface IMozartCoreV1 {

    function getPosition(
        uint256 id
    )
        external
        view
        returns (MozartTypes.Position memory);

    function getCurrentPrice()
        external
        view
        returns (Decimal.D256 memory);

    function getSyntheticAsset()
        external
        view
        returns (address);

    function getCollateralAsset()
        external
        view
        returns (address);

    function getCurrentOracle()
        external
        view
        returns (address);

    function getInterestSetter()
        external
        view
        returns (address);

    function getBorrowIndex()
        external
        view
        returns (uint256, uint256);

    function getCollateralRatio()
        external
        view
        returns (Decimal.D256 memory);

    function getTotals()
        external
        view
        returns (uint256, uint256);

    function getLimits()
        external
        view
        returns (uint256, uint256);

    function getInterestRate()
        external
        view
        returns (uint256);

    function getFees()
        external
        view
        returns (
            Decimal.D256 memory _liquidationUserFee,
            Decimal.D256 memory _liquidationArcRatio
        );

    function isPositionOperator(
        uint256 _positionId,
        address _operator
    )
        external
        view
        returns (bool);

    function isGlobalOperator(
        address _operator
    )
        external
        view
        returns (bool);
}

File 11 of 12 : Amount.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import {SafeMath} from "../lib/SafeMath.sol";
import {Math} from "../lib/Math.sol";

library Amount {

    using Math for uint256;
    using SafeMath for uint256;

    // ============ Constants ============

    uint256 constant BASE = 10**18;

    // A Principal Amount is an amount that's been adjusted by an index

    struct Principal {
        bool sign; // true if positive
        uint256 value;
    }

    function zero()
        internal
        pure
        returns (Principal memory)
    {
        return Principal({
            sign: false,
            value: 0
        });
    }

    function sub(
        Principal memory a,
        Principal memory b
    )
        internal
        pure
        returns (Principal memory)
    {
        return add(a, negative(b));
    }

    function add(
        Principal memory a,
        Principal memory b
    )
        internal
        pure
        returns (Principal memory)
    {
        Principal memory result;

        if (a.sign == b.sign) {
            result.sign = a.sign;
            result.value = SafeMath.add(a.value, b.value);
        } else {
            if (a.value >= b.value) {
                result.sign = a.sign;
                result.value = SafeMath.sub(a.value, b.value);
            } else {
                result.sign = b.sign;
                result.value = SafeMath.sub(b.value, a.value);
            }
        }
        return result;
    }

    function equals(
        Principal memory a,
        Principal memory b
    )
        internal
        pure
        returns (bool)
    {
        if (a.value == b.value) {
            if (a.value == 0) {
                return true;
            }
            return a.sign == b.sign;
        }
        return false;
    }

    function negative(
        Principal memory a
    )
        internal
        pure
        returns (Principal memory)
    {
        return Principal({
            sign: !a.sign,
            value: a.value
        });
    }

    function calculateAdjusted(
        Principal memory a,
        uint256 index
    )
        internal
        pure
        returns (uint256)
    {
        return Math.getPartial(a.value, index, BASE);
    }

    function calculatePrincipal(
        uint256 value,
        uint256 index,
        bool sign
    )
        internal
        pure
        returns (Principal memory)
    {
        return Principal({
            sign: sign,
            value: Math.getPartial(value, BASE, index)
        });
    }

}

File 12 of 12 : MozartTypes.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import {Amount} from "../../lib/Amount.sol";

library MozartTypes {

    /* ========== Structs ========== */

    struct Position {
        address owner;
        Amount.Principal collateralAmount;
        Amount.Principal borrowedAmount;
    }

}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"ClaimableStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"uint256","name":"_positionId","type":"uint256"}],"name":"PositionStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"StateContractApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"address","name":"_slasher","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"UserSlashed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedStateContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"approvedStateContractsArray","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"arcDAO","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"daoAllocation","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"debtToStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getAllApprovedStateContracts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_arcDAO","type":"address"},{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"_daoAllocation","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"_slasherCut","type":"tuple"},{"internalType":"uint256","name":"_vestingEndDate","type":"uint256"},{"internalType":"uint256","name":"_debtToStake","type":"uint256"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_positionId","type":"uint256"},{"internalType":"address","name":"_stateContract","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_stateContract","type":"address"}],"name":"setApprovedStateContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"_stateContracts","type":"address[]"}],"name":"setApprovedStateContracts","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_rewardsDistributor","type":"address"}],"name":"setRewardsDistributor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"}],"name":"setRewardsDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setTokensClaimable","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"slash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"slasherCut","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"positionId","type":"uint256"},{"internalType":"address","name":"stateContract","type":"address"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakers","outputs":[{"internalType":"uint256","name":"positionId","type":"uint256"},{"internalType":"uint256","name":"debtSnapshot","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenStored","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenPaid","type":"uint256"},{"internalType":"uint256","name":"rewardsEarned","type":"uint256"},{"internalType":"uint256","name":"rewardsReleased","type":"uint256"},{"internalType":"address","name":"stateContract","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokensClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"userAllocation","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vestingEndDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

608060405260006007556000600855600060095534801561001f57600080fd5b506128978061002f6000396000f3fe608060405234801561001057600080fd5b50600436106102525760003560e01c80637b0a47ee11610146578063c96be4cb116100c3578063d1f5c33b11610087578063d1f5c33b14610481578063df136d6514610494578063dff45b901461049c578063e27a547d146104af578063e9fad8ee146104c2578063ebe2b12b146104ca57610252565b8063c96be4cb14610443578063cc1a378f14610456578063cd2d790814610469578063cd3daf9d14610471578063d1af0c7d1461047957610252565b80639168ae721161010a5780639168ae72146103e4578063924b1eb31461040b5780639af71b7914610413578063c00007b014610428578063c8f33c911461043b57610252565b80637b0a47ee146103a65780637e0dc545146103ae57806380faa57d146103c1578063886140be146103c95780638980f11f146103d157610252565b80633e02cac8116101d45780636d156ef2116101985780636d156ef21461035b5780636e9960c31461036357806370a082311461036b57806372f702f31461037e5780637628a37d1461039357610252565b80633e02cac8146103035780633f2a55401461032357806341b798f91461032b578063542360fd146103405780636c9230db1461035357610252565b806335c68c5d1161021b57806335c68c5d146102ba578063386a9525146102cd5780633b51991a146102d55780633c6b16ab146102e85780633db5a524146102fb57610252565b80628cc2621461025757806318160ddd146102805780631c1f78eb146102885780632e1a7d4d1461029057806331f684c0146102a5575b600080fd5b61026a610265366004611bef565b6104d2565b60405161027791906126ec565b60405180910390f35b61026a6104f3565b61026a6104fa565b6102a361029e366004611de7565b610518565b005b6102ad61062c565b6040516102779190612572565b6102a36102c8366004611d58565b610635565b61026a6106a1565b6102a36102e3366004611bef565b6106a7565b6102a36102f6366004611de7565b6107e5565b61026a610a15565b610316610311366004611de7565b610a1b565b60405161027791906124f5565b610316610a42565b610333610a51565b6040516102779190612561565b6102a361034e366004611d8d565b610ab3565b61026a610b29565b610316610b2d565b610316610b3c565b61026a610379366004611bef565b610b67565b610386610b85565b6040516102779190612580565b6102a36103a1366004611e23565b610b94565b61026a610d72565b6102a36103bc366004611c0d565b610d78565b61026a610e17565b61026a610e39565b6102a36103df366004611cbd565b610e3f565b6103f76103f2366004611bef565b610f1e565b6040516102779897969594939291906126fa565b61026a610f6c565b61041b610f72565b60405161027791906126de565b6102a3610436366004611bef565b610f8d565b61026a61117e565b6102a3610451366004611bef565b611184565b6102a3610464366004611de7565b61137f565b61026a61141f565b61026a611425565b610386611482565b6102a361048f366004611bef565b611491565b61026a6114eb565b6102ad6104aa366004611cf7565b6114f1565b6102ad6104bd366004611bef565b6115f4565b6102a3611609565b61026a611620565b60006104ed6104e083611626565b6104e8610f72565b611694565b92915050565b6011545b90565b60006105136009546008546116b490919063ffffffff16565b905090565b336105216116ee565b600b5561052c610e17565b600a556001600160a01b038116156105715761054781611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b61057f565b60405180910390fd5b601154610592908363ffffffff61172d16565b601155336000908152600660205260409020600201546105b8908363ffffffff61172d16565b336000818152600660205260409020600201919091556001546105e7916001600160a01b039091169084611755565b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58360405161062091906126ec565b60405180910390a25050565b60105460ff1681565b61063d610b3c565b6001600160a01b0316336001600160a01b03161461066d5760405162461bcd60e51b81526004016105769061261e565b60005b815181101561069d5761069582828151811061068857fe5b60200260200101516106a7565b600101610670565b5050565b60095481565b6106af610b3c565b6001600160a01b0316336001600160a01b0316146106df5760405162461bcd60e51b81526004016105769061261e565b6001600160a01b0381166107055760405162461bcd60e51b81526004016105769061266e565b6001600160a01b03811660009081526002602052604090205460ff161515600114156107435760405162461bcd60e51b81526004016105769061258e565b6001600160a01b038116600081815260026020526040808220805460ff191660019081179091556003805491820181559092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b031916909217909155517f6661cd512f7c75aeb212df51eaa4e17bebbc89b690110902093595b267ffbed2906107da9083906124f5565b60405180910390a150565b6005546001600160a01b0316331461080f5760405162461bcd60e51b8152600401610576906126ce565b60006108196116ee565b600b55610824610e17565b600a556001600160a01b038116156108695761083f81611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b600754610874610b29565b106108955760095461088d90839063ffffffff61184316565b6008556108f6565b60006108b16108a2610b29565b6007549063ffffffff61172d16565b905060006108ca600854836116b490919063ffffffff16565b6009549091506108f0906108e4868463ffffffff61187816565b9063ffffffff61184316565b60085550505b600080546040516370a0823160e01b81526001600160a01b03909116906370a08231906109279030906004016124f5565b60206040518083038186803b15801561093f57600080fd5b505afa158015610953573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109779190810190611e05565b905061098e6009548261184390919063ffffffff16565b60085411156109af5760405162461bcd60e51b81526004016105769061269e565b6109b7610b29565b600a556009546109d5906109c9610b29565b9063ffffffff61187816565b6007556040517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d90610a089085906126ec565b60405180910390a1505050565b600e5481565b60038181548110610a2857fe5b6000918252602090912001546001600160a01b0316905081565b6005546001600160a01b031681565b60606003805480602002602001604051908101604052809291908181526020018280548015610aa957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a8b575b5050505050905090565b610abb610b3c565b6001600160a01b0316336001600160a01b031614610aeb5760405162461bcd60e51b81526004016105769061261e565b6010805460ff19168215151790556040517f4a113b1b56ac87c884bce0b1715ef967c43f546e247aa746d79d92335fe9f825906107da908390612572565b4290565b6004546001600160a01b031681565b60006105137fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610361189d565b6001600160a01b031660009081526006602052604090206002015490565b6001546001600160a01b031681565b33610b9d6116ee565b600b55610ba8610e17565b600a556001600160a01b03811615610bed57610bc381611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b6000610bfc856109c933610b67565b3360009081526006602052604090206007810154919250906001600160a01b03161580610c38575060078101546001600160a01b038581169116145b610c545760405162461bcd60e51b81526004016105769061268e565b6000610c6b600f54846116b490919063ffffffff16565b9050610c79338288886114f1565b610c955760405162461bcd60e51b8152600401610576906125ae565b8160010154811015610cb95760405162461bcd60e51b8152600401610576906125ce565b858255600182018190556002820154610cd8908863ffffffff61187816565b60028301556007820180546001600160a01b0319166001600160a01b038716179055601154610d079088611878565b601155600154610d28906001600160a01b031633308a63ffffffff6118a116565b336001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d88604051610d6191906126ec565b60405180910390a250505050505050565b60085481565b610d80610b3c565b6001600160a01b0316336001600160a01b031614610db05760405162461bcd60e51b81526004016105769061261e565b600480546001600160a01b03998a166001600160a01b03199182161790915560058054988a16988216989098179097556000805460018054978b16978a16979097179096559351600c559151600d5593909516918416821790931617909155600e55600f55565b6000600754610e24610b29565b10610e3157600754610513565b610513610b29565b600c5481565b610e47610b3c565b6001600160a01b0316336001600160a01b031614610e775760405162461bcd60e51b81526004016105769061261e565b6001546001600160a01b03838116911614801590610ea357506000546001600160a01b03838116911614155b610ebf5760405162461bcd60e51b8152600401610576906126be565b610ee1610eca610b3c565b6001600160a01b038416908363ffffffff61175516565b7f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288282604051610f12929190612546565b60405180910390a15050565b6006602081905260009182526040909120805460018201546002830154600384015460048501546005860154968601546007909601549496939592949193909290916001600160a01b031688565b600f5481565b610f7a6119fa565b610513610f85611992565b600c546119b4565b80610f966116ee565b600b55610fa1610e17565b600a556001600160a01b03811615610fe657610fbc81611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b60105460ff16151560011461100d5760405162461bcd60e51b8152600401610576906126ae565b600754611018610b29565b10156110235761069d565b6001600160a01b038216600090815260066020819052604082209081015460058201549192916110589163ffffffff61172d16565b600754600e549192508291600091611076919063ffffffff61172d16565b9050600e54611083610b29565b10156110ba576110b7816108e46110aa60075461109e610b29565b9063ffffffff61172d16565b869063ffffffff6116b416565b91505b60068401546110cf908363ffffffff61187816565b60068501556040805160208101909152600c5481526000906110f2908490611694565b600454600054919250611118916001600160a01b0390811691168363ffffffff61175516565b6111458761112c858463ffffffff61172d16565b6000546001600160a01b0316919063ffffffff61175516565b866001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048684604051610d6191906126ec565b600a5481565b8061118d6116ee565b600b55611198610e17565b600a556001600160a01b038116156111dd576111b381611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b6001600160a01b0382163314156112065760405162461bcd60e51b81526004016105769061263e565b600e54611211610b29565b1061122e5760405162461bcd60e51b8152600401610576906125be565b6001600160a01b03808316600090815260066020526040902060018101548154600783015492936112639387939291166114f1565b156112805760405162461bcd60e51b81526004016105769061262e565b60058101546040805160208101909152600d5481526000906112a3908390611694565b336000908152600660205260409020600501549091506112c9908263ffffffff61187816565b336000908152600660205260409020600501556113186112ef838363ffffffff61172d16565b600580546001600160a01b0316600090815260066020526040902001549063ffffffff61187816565b600580546001600160a01b031660009081526006602052604080822083019390935590850155517fcffec9b4a803a2405d372361581bea722031790d28e912c659c3128511744f299061137090879033908690612503565b60405180910390a15050505050565b611387610b3c565b6001600160a01b0316336001600160a01b0316146113b75760405162461bcd60e51b81526004016105769061261e565b60075415806113ce57506007546113cc610b29565b115b6113ea5760405162461bcd60e51b81526004016105769061264e565b60098190556040517ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d3906107da9083906126ec565b600d5481565b60006011546000141561143b5750600b546104f7565b6105136114736104e06011546108e4670de0b6b3a7640000611467600854611467600a5461109e610e17565b9063ffffffff6116b416565b600b549063ffffffff61187816565b6000546001600160a01b031681565b611499610b3c565b6001600160a01b0316336001600160a01b0316146114c95760405162461bcd60e51b81526004016105769061261e565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600b5481565b6001600160a01b03811660009081526002602052604081205460ff16151560011461152e5760405162461bcd60e51b81526004016105769061259e565b81611537611a0d565b60405163eb02c30160e01b81526001600160a01b0383169063eb02c301906115639088906004016126ec565b60a06040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115b39190810190611dc9565b9050866001600160a01b031681600001516001600160a01b0316146115dd576000925050506115ec565b60400151602001518511159150505b949350505050565b60026020526000908152604090205460ff1681565b61161233610f8d565b61161e61029e33610b67565b565b60075481565b6001600160a01b038116600090815260066020526040812060058101546004909101546104ed91906109c990670de0b6b3a7640000906108e49061166c9061109e6116ee565b6001600160a01b0388166000908152600660205260409020600201549063ffffffff6116b416565b60006116ad838360000151670de0b6b3a76400006119e4565b9392505050565b6000826116c3575060006104ed565b828202828482816116d057fe5b04146116ad5760405162461bcd60e51b81526004016105769061267e565b6000601154600014156117045750600b546104f7565b6105136114736011546108e4670de0b6b3a7640000611467600854611467600a5461109e610e17565b60008282111561174f5760405162461bcd60e51b8152600401610576906125fe565b50900390565b60006060846001600160a01b031663a9059cbb858560405160240161177b929190612546565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506040516117b491906124e9565b6000604051808303816000865af19150503d80600081146117f1576040519150601f19603f3d011682016040523d82523d6000602084013e6117f6565b606091505b50915091508180156118205750805115806118205750808060200190516118209190810190611dab565b61183c5760405162461bcd60e51b8152600401610576906125de565b5050505050565b60008082116118645760405162461bcd60e51b81526004016105769061260e565b600082848161186f57fe5b04949350505050565b6000828201838110156116ad5760405162461bcd60e51b8152600401610576906125ee565b5490565b60006060856001600160a01b03166323b872dd8686866040516024016118c99392919061252b565b6040516020818303038152906040529060e01b6020820180516001600160e01b03838183161783525050505060405161190291906124e9565b6000604051808303816000865af19150503d806000811461193f576040519150601f19603f3d011682016040523d82523d6000602084013e611944565b606091505b509150915081801561196e57508051158061196e57508080602001905161196e9190810190611dab565b61198a5760405162461bcd60e51b81526004016105769061265e565b505050505050565b61199a6119fa565b506040805160208101909152670de0b6b3a7640000815290565b6119bc6119fa565b6040805160208101909152835181906119db908563ffffffff61172d16565b90529392505050565b60006115ec826108e4868663ffffffff6116b416565b6040518060200160405280600081525090565b604051806060016040528060006001600160a01b03168152602001611a30611a42565b8152602001611a3d611a42565b905290565b604080518082019091526000808252602082015290565b80356104ed8161282b565b80516104ed8161282b565b600082601f830112611a8057600080fd5b8135611a93611a8e82612798565b612771565b91508181835260208401935060208101905083856020840282011115611ab857600080fd5b60005b83811015611ae45781611ace8882611a59565b8452506020928301929190910190600101611abb565b5050505092915050565b80356104ed81612842565b80516104ed81612842565b600060208284031215611b1657600080fd5b611b206020612771565b90506000611b2e8484611bd9565b82525092915050565b600060a08284031215611b4957600080fd5b611b536060612771565b90506000611b618484611a64565b8252506020611b7284848301611b92565b6020830152506060611b8684828501611b92565b60408301525092915050565b600060408284031215611ba457600080fd5b611bae6040612771565b90506000611bbc8484611af9565b8252506020611bcd84848301611be4565b60208301525092915050565b80356104ed8161284b565b80516104ed8161284b565b600060208284031215611c0157600080fd5b60006115ec8484611a59565b600080600080600080600080610100898b031215611c2a57600080fd5b6000611c368b8b611a59565b9850506020611c478b828c01611a59565b9750506040611c588b828c01611a59565b9650506060611c698b828c01611a59565b9550506080611c7a8b828c01611b04565b94505060a0611c8b8b828c01611b04565b93505060c0611c9c8b828c01611bd9565b92505060e0611cad8b828c01611bd9565b9150509295985092959890939650565b60008060408385031215611cd057600080fd5b6000611cdc8585611a59565b9250506020611ced85828601611bd9565b9150509250929050565b60008060008060808587031215611d0d57600080fd5b6000611d198787611a59565b9450506020611d2a87828801611bd9565b9350506040611d3b87828801611bd9565b9250506060611d4c87828801611a59565b91505092959194509250565b600060208284031215611d6a57600080fd5b813567ffffffffffffffff811115611d8157600080fd5b6115ec84828501611a6f565b600060208284031215611d9f57600080fd5b60006115ec8484611aee565b600060208284031215611dbd57600080fd5b60006115ec8484611af9565b600060a08284031215611ddb57600080fd5b60006115ec8484611b37565b600060208284031215611df957600080fd5b60006115ec8484611bd9565b600060208284031215611e1757600080fd5b60006115ec8484611be4565b600080600060608486031215611e3857600080fd5b6000611e448686611bd9565b9350506020611e5586828701611bd9565b9250506040611e6686828701611a59565b9150509250925092565b6000611e7c8383611e93565b505060200190565b611e8d816127ed565b82525050565b611e8d816127d1565b6000611ea7826127bf565b611eb181856127c3565b9350611ebc836127b9565b8060005b83811015611eea578151611ed48882611e70565b9750611edf836127b9565b925050600101611ec0565b509495945050505050565b611e8d816127dc565b6000611f09826127bf565b611f1381856127cc565b9350611f238185602086016127ff565b9290920192915050565b611e8d816127f4565b6000611f43602c836127c3565b7f54686520676976656e20737461746520636f6e747261637420697320616c726581526b18591e48185c1c1c9bdd995960a21b602082015260400192915050565b6000611f916024836127c3565b7f54686520737461746520636f6e7472616374206973206e6f7420726567697374815263195c995960e21b602082015260400192915050565b6000611fd76016836127c3565b7526bab9ba1031329030903b30b634b21036b4b73a32b960511b815260200192915050565b6000612009602b836127c3565b7f596f752063616e6e6f7420736c6173682061667465722074686520766573746981526a6e6720656e64206461746560a81b602082015260400192915050565b60006120566038836127c3565b7f596f7572206e6577206465627420726571756972656d656e742063616e6e6f7481527f206265206c6f776572207468616e206c6173742074696d650000000000000000602082015260400192915050565b60006120b5601a836127c3565b7f5361666545524332303a205452414e534645525f4641494c4544000000000000815260200192915050565b60006120ee601b836127c3565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000612127601e836127c3565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612160601a836127c3565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612199601e836127c3565b7f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e0000815260200192915050565b60006121d2602c836127c3565b7f596f752063616e277420736c617368206120757365722077686f20697320612081526b3b30b634b21036b4b73a32b960a11b602082015260400192915050565b60006122206019836127c3565b7f596f752063616e6e6f7420736c61736820796f757273656c6600000000000000815260200192915050565b60006122596044836127c3565b7f5072657620706572696f64206d75737420626520636f6d706c6574652062656681527f6f7265206368616e67696e67206475726174696f6e20666f72206e65772070656020820152631c9a5bd960e21b604082015260600192915050565b60006122c5601f836127c3565b7f5361666545524332303a205452414e534645525f46524f4d5f4641494c454400815260200192915050565b60006122fe601c836127c3565b7f537461746520636f6e7472616374206d7573742062652076616c696400000000815260200192915050565b60006123376021836127c3565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b600061237a602d836127c3565b7f43616e6e6f742072652d7374616b6520746f206120646966666572656e74207381526c1d185d194818dbdb9d1c9858dd609a1b602082015260400192915050565b60006123c96018836127c3565b7f50726f76696465642072657761726420746f6f20686967680000000000000000815260200192915050565b6000612402601d836127c3565b7f546f6b656e732063616e6e6e6f7420626520636c61696d656420796574000000815260200192915050565b600061243b602d836127c3565b7f43616e6e6f7420776974686472617720746865207374616b696e67206f72207281526c65776172647320746f6b656e7360981b602082015260400192915050565b600061248a602a836127c3565b7f43616c6c6572206973206e6f742052657761726473446973747269627574696f8152691b8818dbdb9d1c9858dd60b21b602082015260400192915050565b805160208301906124da84826124e0565b50505050565b611e8d816104f7565b60006116ad8284611efe565b602081016104ed8284611e93565b606081016125118286611e93565b61251e6020830185611e84565b6115ec60408301846124e0565b606081016125398286611e93565b61251e6020830185611e93565b604081016125548285611e93565b6116ad60208301846124e0565b602080825281016116ad8184611e9c565b602081016104ed8284611ef5565b602081016104ed8284611f2d565b602080825281016104ed81611f36565b602080825281016104ed81611f84565b602080825281016104ed81611fca565b602080825281016104ed81611ffc565b602080825281016104ed81612049565b602080825281016104ed816120a8565b602080825281016104ed816120e1565b602080825281016104ed8161211a565b602080825281016104ed81612153565b602080825281016104ed8161218c565b602080825281016104ed816121c5565b602080825281016104ed81612213565b602080825281016104ed8161224c565b602080825281016104ed816122b8565b602080825281016104ed816122f1565b602080825281016104ed8161232a565b602080825281016104ed8161236d565b602080825281016104ed816123bc565b602080825281016104ed816123f5565b602080825281016104ed8161242e565b602080825281016104ed8161247d565b602081016104ed82846124c9565b602081016104ed82846124e0565b6101008101612709828b6124e0565b612716602083018a6124e0565b61272360408301896124e0565b61273060608301886124e0565b61273d60808301876124e0565b61274a60a08301866124e0565b61275760c08301856124e0565b61276460e0830184611e93565b9998505050505050505050565b60405181810167ffffffffffffffff8111828210171561279057600080fd5b604052919050565b600067ffffffffffffffff8211156127af57600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b919050565b60006104ed826127e1565b151590565b6001600160a01b031690565b60006104ed825b60006104ed826127d1565b60005b8381101561281a578181015183820152602001612802565b838111156124da5750506000910152565b612834816127d1565b811461283f57600080fd5b50565b612834816127dc565b612834816104f756fea365627a7a723158204540753c517baa8f45f86150aff82b0ff45412053c83028c14b1a6f8995d2e8b6c6578706572696d656e74616cf564736f6c63430005100040

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102525760003560e01c80637b0a47ee11610146578063c96be4cb116100c3578063d1f5c33b11610087578063d1f5c33b14610481578063df136d6514610494578063dff45b901461049c578063e27a547d146104af578063e9fad8ee146104c2578063ebe2b12b146104ca57610252565b8063c96be4cb14610443578063cc1a378f14610456578063cd2d790814610469578063cd3daf9d14610471578063d1af0c7d1461047957610252565b80639168ae721161010a5780639168ae72146103e4578063924b1eb31461040b5780639af71b7914610413578063c00007b014610428578063c8f33c911461043b57610252565b80637b0a47ee146103a65780637e0dc545146103ae57806380faa57d146103c1578063886140be146103c95780638980f11f146103d157610252565b80633e02cac8116101d45780636d156ef2116101985780636d156ef21461035b5780636e9960c31461036357806370a082311461036b57806372f702f31461037e5780637628a37d1461039357610252565b80633e02cac8146103035780633f2a55401461032357806341b798f91461032b578063542360fd146103405780636c9230db1461035357610252565b806335c68c5d1161021b57806335c68c5d146102ba578063386a9525146102cd5780633b51991a146102d55780633c6b16ab146102e85780633db5a524146102fb57610252565b80628cc2621461025757806318160ddd146102805780631c1f78eb146102885780632e1a7d4d1461029057806331f684c0146102a5575b600080fd5b61026a610265366004611bef565b6104d2565b60405161027791906126ec565b60405180910390f35b61026a6104f3565b61026a6104fa565b6102a361029e366004611de7565b610518565b005b6102ad61062c565b6040516102779190612572565b6102a36102c8366004611d58565b610635565b61026a6106a1565b6102a36102e3366004611bef565b6106a7565b6102a36102f6366004611de7565b6107e5565b61026a610a15565b610316610311366004611de7565b610a1b565b60405161027791906124f5565b610316610a42565b610333610a51565b6040516102779190612561565b6102a361034e366004611d8d565b610ab3565b61026a610b29565b610316610b2d565b610316610b3c565b61026a610379366004611bef565b610b67565b610386610b85565b6040516102779190612580565b6102a36103a1366004611e23565b610b94565b61026a610d72565b6102a36103bc366004611c0d565b610d78565b61026a610e17565b61026a610e39565b6102a36103df366004611cbd565b610e3f565b6103f76103f2366004611bef565b610f1e565b6040516102779897969594939291906126fa565b61026a610f6c565b61041b610f72565b60405161027791906126de565b6102a3610436366004611bef565b610f8d565b61026a61117e565b6102a3610451366004611bef565b611184565b6102a3610464366004611de7565b61137f565b61026a61141f565b61026a611425565b610386611482565b6102a361048f366004611bef565b611491565b61026a6114eb565b6102ad6104aa366004611cf7565b6114f1565b6102ad6104bd366004611bef565b6115f4565b6102a3611609565b61026a611620565b60006104ed6104e083611626565b6104e8610f72565b611694565b92915050565b6011545b90565b60006105136009546008546116b490919063ffffffff16565b905090565b336105216116ee565b600b5561052c610e17565b600a556001600160a01b038116156105715761054781611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b61057f565b60405180910390fd5b601154610592908363ffffffff61172d16565b601155336000908152600660205260409020600201546105b8908363ffffffff61172d16565b336000818152600660205260409020600201919091556001546105e7916001600160a01b039091169084611755565b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58360405161062091906126ec565b60405180910390a25050565b60105460ff1681565b61063d610b3c565b6001600160a01b0316336001600160a01b03161461066d5760405162461bcd60e51b81526004016105769061261e565b60005b815181101561069d5761069582828151811061068857fe5b60200260200101516106a7565b600101610670565b5050565b60095481565b6106af610b3c565b6001600160a01b0316336001600160a01b0316146106df5760405162461bcd60e51b81526004016105769061261e565b6001600160a01b0381166107055760405162461bcd60e51b81526004016105769061266e565b6001600160a01b03811660009081526002602052604090205460ff161515600114156107435760405162461bcd60e51b81526004016105769061258e565b6001600160a01b038116600081815260026020526040808220805460ff191660019081179091556003805491820181559092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b031916909217909155517f6661cd512f7c75aeb212df51eaa4e17bebbc89b690110902093595b267ffbed2906107da9083906124f5565b60405180910390a150565b6005546001600160a01b0316331461080f5760405162461bcd60e51b8152600401610576906126ce565b60006108196116ee565b600b55610824610e17565b600a556001600160a01b038116156108695761083f81611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b600754610874610b29565b106108955760095461088d90839063ffffffff61184316565b6008556108f6565b60006108b16108a2610b29565b6007549063ffffffff61172d16565b905060006108ca600854836116b490919063ffffffff16565b6009549091506108f0906108e4868463ffffffff61187816565b9063ffffffff61184316565b60085550505b600080546040516370a0823160e01b81526001600160a01b03909116906370a08231906109279030906004016124f5565b60206040518083038186803b15801561093f57600080fd5b505afa158015610953573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109779190810190611e05565b905061098e6009548261184390919063ffffffff16565b60085411156109af5760405162461bcd60e51b81526004016105769061269e565b6109b7610b29565b600a556009546109d5906109c9610b29565b9063ffffffff61187816565b6007556040517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d90610a089085906126ec565b60405180910390a1505050565b600e5481565b60038181548110610a2857fe5b6000918252602090912001546001600160a01b0316905081565b6005546001600160a01b031681565b60606003805480602002602001604051908101604052809291908181526020018280548015610aa957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a8b575b5050505050905090565b610abb610b3c565b6001600160a01b0316336001600160a01b031614610aeb5760405162461bcd60e51b81526004016105769061261e565b6010805460ff19168215151790556040517f4a113b1b56ac87c884bce0b1715ef967c43f546e247aa746d79d92335fe9f825906107da908390612572565b4290565b6004546001600160a01b031681565b60006105137fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610361189d565b6001600160a01b031660009081526006602052604090206002015490565b6001546001600160a01b031681565b33610b9d6116ee565b600b55610ba8610e17565b600a556001600160a01b03811615610bed57610bc381611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b6000610bfc856109c933610b67565b3360009081526006602052604090206007810154919250906001600160a01b03161580610c38575060078101546001600160a01b038581169116145b610c545760405162461bcd60e51b81526004016105769061268e565b6000610c6b600f54846116b490919063ffffffff16565b9050610c79338288886114f1565b610c955760405162461bcd60e51b8152600401610576906125ae565b8160010154811015610cb95760405162461bcd60e51b8152600401610576906125ce565b858255600182018190556002820154610cd8908863ffffffff61187816565b60028301556007820180546001600160a01b0319166001600160a01b038716179055601154610d079088611878565b601155600154610d28906001600160a01b031633308a63ffffffff6118a116565b336001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d88604051610d6191906126ec565b60405180910390a250505050505050565b60085481565b610d80610b3c565b6001600160a01b0316336001600160a01b031614610db05760405162461bcd60e51b81526004016105769061261e565b600480546001600160a01b03998a166001600160a01b03199182161790915560058054988a16988216989098179097556000805460018054978b16978a16979097179096559351600c559151600d5593909516918416821790931617909155600e55600f55565b6000600754610e24610b29565b10610e3157600754610513565b610513610b29565b600c5481565b610e47610b3c565b6001600160a01b0316336001600160a01b031614610e775760405162461bcd60e51b81526004016105769061261e565b6001546001600160a01b03838116911614801590610ea357506000546001600160a01b03838116911614155b610ebf5760405162461bcd60e51b8152600401610576906126be565b610ee1610eca610b3c565b6001600160a01b038416908363ffffffff61175516565b7f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288282604051610f12929190612546565b60405180910390a15050565b6006602081905260009182526040909120805460018201546002830154600384015460048501546005860154968601546007909601549496939592949193909290916001600160a01b031688565b600f5481565b610f7a6119fa565b610513610f85611992565b600c546119b4565b80610f966116ee565b600b55610fa1610e17565b600a556001600160a01b03811615610fe657610fbc81611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b60105460ff16151560011461100d5760405162461bcd60e51b8152600401610576906126ae565b600754611018610b29565b10156110235761069d565b6001600160a01b038216600090815260066020819052604082209081015460058201549192916110589163ffffffff61172d16565b600754600e549192508291600091611076919063ffffffff61172d16565b9050600e54611083610b29565b10156110ba576110b7816108e46110aa60075461109e610b29565b9063ffffffff61172d16565b869063ffffffff6116b416565b91505b60068401546110cf908363ffffffff61187816565b60068501556040805160208101909152600c5481526000906110f2908490611694565b600454600054919250611118916001600160a01b0390811691168363ffffffff61175516565b6111458761112c858463ffffffff61172d16565b6000546001600160a01b0316919063ffffffff61175516565b866001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048684604051610d6191906126ec565b600a5481565b8061118d6116ee565b600b55611198610e17565b600a556001600160a01b038116156111dd576111b381611626565b6001600160a01b03821660009081526006602052604090206005810191909155600b546004909101555b6001600160a01b0382163314156112065760405162461bcd60e51b81526004016105769061263e565b600e54611211610b29565b1061122e5760405162461bcd60e51b8152600401610576906125be565b6001600160a01b03808316600090815260066020526040902060018101548154600783015492936112639387939291166114f1565b156112805760405162461bcd60e51b81526004016105769061262e565b60058101546040805160208101909152600d5481526000906112a3908390611694565b336000908152600660205260409020600501549091506112c9908263ffffffff61187816565b336000908152600660205260409020600501556113186112ef838363ffffffff61172d16565b600580546001600160a01b0316600090815260066020526040902001549063ffffffff61187816565b600580546001600160a01b031660009081526006602052604080822083019390935590850155517fcffec9b4a803a2405d372361581bea722031790d28e912c659c3128511744f299061137090879033908690612503565b60405180910390a15050505050565b611387610b3c565b6001600160a01b0316336001600160a01b0316146113b75760405162461bcd60e51b81526004016105769061261e565b60075415806113ce57506007546113cc610b29565b115b6113ea5760405162461bcd60e51b81526004016105769061264e565b60098190556040517ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d3906107da9083906126ec565b600d5481565b60006011546000141561143b5750600b546104f7565b6105136114736104e06011546108e4670de0b6b3a7640000611467600854611467600a5461109e610e17565b9063ffffffff6116b416565b600b549063ffffffff61187816565b6000546001600160a01b031681565b611499610b3c565b6001600160a01b0316336001600160a01b0316146114c95760405162461bcd60e51b81526004016105769061261e565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600b5481565b6001600160a01b03811660009081526002602052604081205460ff16151560011461152e5760405162461bcd60e51b81526004016105769061259e565b81611537611a0d565b60405163eb02c30160e01b81526001600160a01b0383169063eb02c301906115639088906004016126ec565b60a06040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115b39190810190611dc9565b9050866001600160a01b031681600001516001600160a01b0316146115dd576000925050506115ec565b60400151602001518511159150505b949350505050565b60026020526000908152604090205460ff1681565b61161233610f8d565b61161e61029e33610b67565b565b60075481565b6001600160a01b038116600090815260066020526040812060058101546004909101546104ed91906109c990670de0b6b3a7640000906108e49061166c9061109e6116ee565b6001600160a01b0388166000908152600660205260409020600201549063ffffffff6116b416565b60006116ad838360000151670de0b6b3a76400006119e4565b9392505050565b6000826116c3575060006104ed565b828202828482816116d057fe5b04146116ad5760405162461bcd60e51b81526004016105769061267e565b6000601154600014156117045750600b546104f7565b6105136114736011546108e4670de0b6b3a7640000611467600854611467600a5461109e610e17565b60008282111561174f5760405162461bcd60e51b8152600401610576906125fe565b50900390565b60006060846001600160a01b031663a9059cbb858560405160240161177b929190612546565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506040516117b491906124e9565b6000604051808303816000865af19150503d80600081146117f1576040519150601f19603f3d011682016040523d82523d6000602084013e6117f6565b606091505b50915091508180156118205750805115806118205750808060200190516118209190810190611dab565b61183c5760405162461bcd60e51b8152600401610576906125de565b5050505050565b60008082116118645760405162461bcd60e51b81526004016105769061260e565b600082848161186f57fe5b04949350505050565b6000828201838110156116ad5760405162461bcd60e51b8152600401610576906125ee565b5490565b60006060856001600160a01b03166323b872dd8686866040516024016118c99392919061252b565b6040516020818303038152906040529060e01b6020820180516001600160e01b03838183161783525050505060405161190291906124e9565b6000604051808303816000865af19150503d806000811461193f576040519150601f19603f3d011682016040523d82523d6000602084013e611944565b606091505b509150915081801561196e57508051158061196e57508080602001905161196e9190810190611dab565b61198a5760405162461bcd60e51b81526004016105769061265e565b505050505050565b61199a6119fa565b506040805160208101909152670de0b6b3a7640000815290565b6119bc6119fa565b6040805160208101909152835181906119db908563ffffffff61172d16565b90529392505050565b60006115ec826108e4868663ffffffff6116b416565b6040518060200160405280600081525090565b604051806060016040528060006001600160a01b03168152602001611a30611a42565b8152602001611a3d611a42565b905290565b604080518082019091526000808252602082015290565b80356104ed8161282b565b80516104ed8161282b565b600082601f830112611a8057600080fd5b8135611a93611a8e82612798565b612771565b91508181835260208401935060208101905083856020840282011115611ab857600080fd5b60005b83811015611ae45781611ace8882611a59565b8452506020928301929190910190600101611abb565b5050505092915050565b80356104ed81612842565b80516104ed81612842565b600060208284031215611b1657600080fd5b611b206020612771565b90506000611b2e8484611bd9565b82525092915050565b600060a08284031215611b4957600080fd5b611b536060612771565b90506000611b618484611a64565b8252506020611b7284848301611b92565b6020830152506060611b8684828501611b92565b60408301525092915050565b600060408284031215611ba457600080fd5b611bae6040612771565b90506000611bbc8484611af9565b8252506020611bcd84848301611be4565b60208301525092915050565b80356104ed8161284b565b80516104ed8161284b565b600060208284031215611c0157600080fd5b60006115ec8484611a59565b600080600080600080600080610100898b031215611c2a57600080fd5b6000611c368b8b611a59565b9850506020611c478b828c01611a59565b9750506040611c588b828c01611a59565b9650506060611c698b828c01611a59565b9550506080611c7a8b828c01611b04565b94505060a0611c8b8b828c01611b04565b93505060c0611c9c8b828c01611bd9565b92505060e0611cad8b828c01611bd9565b9150509295985092959890939650565b60008060408385031215611cd057600080fd5b6000611cdc8585611a59565b9250506020611ced85828601611bd9565b9150509250929050565b60008060008060808587031215611d0d57600080fd5b6000611d198787611a59565b9450506020611d2a87828801611bd9565b9350506040611d3b87828801611bd9565b9250506060611d4c87828801611a59565b91505092959194509250565b600060208284031215611d6a57600080fd5b813567ffffffffffffffff811115611d8157600080fd5b6115ec84828501611a6f565b600060208284031215611d9f57600080fd5b60006115ec8484611aee565b600060208284031215611dbd57600080fd5b60006115ec8484611af9565b600060a08284031215611ddb57600080fd5b60006115ec8484611b37565b600060208284031215611df957600080fd5b60006115ec8484611bd9565b600060208284031215611e1757600080fd5b60006115ec8484611be4565b600080600060608486031215611e3857600080fd5b6000611e448686611bd9565b9350506020611e5586828701611bd9565b9250506040611e6686828701611a59565b9150509250925092565b6000611e7c8383611e93565b505060200190565b611e8d816127ed565b82525050565b611e8d816127d1565b6000611ea7826127bf565b611eb181856127c3565b9350611ebc836127b9565b8060005b83811015611eea578151611ed48882611e70565b9750611edf836127b9565b925050600101611ec0565b509495945050505050565b611e8d816127dc565b6000611f09826127bf565b611f1381856127cc565b9350611f238185602086016127ff565b9290920192915050565b611e8d816127f4565b6000611f43602c836127c3565b7f54686520676976656e20737461746520636f6e747261637420697320616c726581526b18591e48185c1c1c9bdd995960a21b602082015260400192915050565b6000611f916024836127c3565b7f54686520737461746520636f6e7472616374206973206e6f7420726567697374815263195c995960e21b602082015260400192915050565b6000611fd76016836127c3565b7526bab9ba1031329030903b30b634b21036b4b73a32b960511b815260200192915050565b6000612009602b836127c3565b7f596f752063616e6e6f7420736c6173682061667465722074686520766573746981526a6e6720656e64206461746560a81b602082015260400192915050565b60006120566038836127c3565b7f596f7572206e6577206465627420726571756972656d656e742063616e6e6f7481527f206265206c6f776572207468616e206c6173742074696d650000000000000000602082015260400192915050565b60006120b5601a836127c3565b7f5361666545524332303a205452414e534645525f4641494c4544000000000000815260200192915050565b60006120ee601b836127c3565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000612127601e836127c3565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612160601a836127c3565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612199601e836127c3565b7f41646d696e61626c653a2063616c6c6572206973206e6f742061646d696e0000815260200192915050565b60006121d2602c836127c3565b7f596f752063616e277420736c617368206120757365722077686f20697320612081526b3b30b634b21036b4b73a32b960a11b602082015260400192915050565b60006122206019836127c3565b7f596f752063616e6e6f7420736c61736820796f757273656c6600000000000000815260200192915050565b60006122596044836127c3565b7f5072657620706572696f64206d75737420626520636f6d706c6574652062656681527f6f7265206368616e67696e67206475726174696f6e20666f72206e65772070656020820152631c9a5bd960e21b604082015260600192915050565b60006122c5601f836127c3565b7f5361666545524332303a205452414e534645525f46524f4d5f4641494c454400815260200192915050565b60006122fe601c836127c3565b7f537461746520636f6e7472616374206d7573742062652076616c696400000000815260200192915050565b60006123376021836127c3565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b600061237a602d836127c3565b7f43616e6e6f742072652d7374616b6520746f206120646966666572656e74207381526c1d185d194818dbdb9d1c9858dd609a1b602082015260400192915050565b60006123c96018836127c3565b7f50726f76696465642072657761726420746f6f20686967680000000000000000815260200192915050565b6000612402601d836127c3565b7f546f6b656e732063616e6e6e6f7420626520636c61696d656420796574000000815260200192915050565b600061243b602d836127c3565b7f43616e6e6f7420776974686472617720746865207374616b696e67206f72207281526c65776172647320746f6b656e7360981b602082015260400192915050565b600061248a602a836127c3565b7f43616c6c6572206973206e6f742052657761726473446973747269627574696f8152691b8818dbdb9d1c9858dd60b21b602082015260400192915050565b805160208301906124da84826124e0565b50505050565b611e8d816104f7565b60006116ad8284611efe565b602081016104ed8284611e93565b606081016125118286611e93565b61251e6020830185611e84565b6115ec60408301846124e0565b606081016125398286611e93565b61251e6020830185611e93565b604081016125548285611e93565b6116ad60208301846124e0565b602080825281016116ad8184611e9c565b602081016104ed8284611ef5565b602081016104ed8284611f2d565b602080825281016104ed81611f36565b602080825281016104ed81611f84565b602080825281016104ed81611fca565b602080825281016104ed81611ffc565b602080825281016104ed81612049565b602080825281016104ed816120a8565b602080825281016104ed816120e1565b602080825281016104ed8161211a565b602080825281016104ed81612153565b602080825281016104ed8161218c565b602080825281016104ed816121c5565b602080825281016104ed81612213565b602080825281016104ed8161224c565b602080825281016104ed816122b8565b602080825281016104ed816122f1565b602080825281016104ed8161232a565b602080825281016104ed8161236d565b602080825281016104ed816123bc565b602080825281016104ed816123f5565b602080825281016104ed8161242e565b602080825281016104ed8161247d565b602081016104ed82846124c9565b602081016104ed82846124e0565b6101008101612709828b6124e0565b612716602083018a6124e0565b61272360408301896124e0565b61273060608301886124e0565b61273d60808301876124e0565b61274a60a08301866124e0565b61275760c08301856124e0565b61276460e0830184611e93565b9998505050505050505050565b60405181810167ffffffffffffffff8111828210171561279057600080fd5b604052919050565b600067ffffffffffffffff8211156127af57600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b919050565b60006104ed826127e1565b151590565b6001600160a01b031690565b60006104ed825b60006104ed826127d1565b60005b8381101561281a578181015183820152602001612802565b838111156124da5750506000910152565b612834816127d1565b811461283f57600080fd5b50565b612834816127dc565b612834816104f756fea365627a7a723158204540753c517baa8f45f86150aff82b0ff45412053c83028c14b1a6f8995d2e8b6c6578706572696d656e74616cf564736f6c63430005100040

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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
Loading...
Loading

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