ETH Price: $2,678.99 (+1.38%)

Contract

0x192810b2cebc150604c20A3Dc12bbAd9CbdeA64E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Reward Per B...184944482023-11-03 22:15:59464 days ago1699049759IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0011255114.26648435
Deposit183701662023-10-17 12:42:35482 days ago1697546555IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.000813699.42344534
Deposit181521882023-09-17 0:17:59512 days ago1694909879IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.000974111.28119325
Deposit177873782023-07-27 22:28:11563 days ago1690496891IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0023838727.6077499
Deposit174997812023-06-17 13:19:11604 days ago1687007951IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0015856818.3638836
Deposit170536272023-04-15 16:38:11667 days ago1681576691IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0022257925.77702813
Withdraw169728132023-04-04 3:10:59678 days ago1680577859IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0032711523.67759804
Deposit169728052023-04-04 3:09:11678 days ago1680577751IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0023325919.0850688
Deposit169221362023-03-27 23:59:59685 days ago1679961599IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0022945921.82813265
Deposit167324892023-03-01 8:09:11712 days ago1677658151IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0032374130.55028291
Deposit153968302022-08-23 13:24:40902 days ago1661261080IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.000981278.85786119
Deposit152979292022-08-07 22:41:38917 days ago1659912098IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0025021413.0920285
Deposit152683322022-08-03 8:00:29922 days ago1659513629IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.000775467
Deposit147243692022-05-06 15:38:101011 days ago1651851490IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0044118641.63314527
Withdraw144908202022-03-31 0:46:001047 days ago1648687560IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0081245143.55420903
Deposit143536682022-03-09 16:30:201069 days ago1646843420IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0033250330.01473046
Deposit142486962022-02-21 9:51:551085 days ago1645437115IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0060457754.57462901
Deposit140238072022-01-17 15:21:171120 days ago1642432877IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.01486891134.22022097
Set Reward Per B...137724102021-12-09 17:39:031159 days ago1639071543IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0068395874.14425263
Deposit137519202021-12-06 11:07:421162 days ago1638788862IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.011888592.96613553
Deposit137445042021-12-05 6:33:431163 days ago1638686023IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0068683662
Deposit137337642021-12-03 13:06:191165 days ago1638536779IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0182400995.43790437
Deposit137176672021-11-30 23:19:201167 days ago1638314360IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.01467259132.44803128
Deposit137015882021-11-28 9:26:401170 days ago1638091600IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.0057088651.53332759
Deposit136465412021-11-19 16:18:011179 days ago1637338681IN
RollApp: Mercedes-AMG GTS NFT Staking
0 ETH0.01521159137.31352824
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RollAppStaking

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : RollAppStaking.sol
/*
 * RollApp
 *
 * Copyright ©️ 2021 Curio AG (Company Number FL-0002.594.728-9)
 * Incorporated and registered in Liechtenstein.
 *
 * Copyright ©️ 2021 Curio Capital AG (Company Number CHE-211.446.654)
 * Incorporated and registered in Zug, Switzerland.
 */
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";

import "./interfaces/IReservoir.sol";

import "../access/Adminable.sol";

/**
 * @title RollAppStaking
 *
 * @dev ERC1155 Staking contract.
 */
contract RollAppStaking is Adminable, Pausable, ERC1155Receiver {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 amount;     // How many ERC1155 tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of rewardTokens
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accRewardPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws ERC1155 tokens to a pool. Here's what happens:
        //   1. The pool's `accRewardPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        uint256 tokenId;            // Available tokenId of collection contract.
        uint256 allocPoint;         // How many allocation points assigned to this pool. rewardTokens to distribute per block.
        uint256 lastRewardBlock;    // Last block number that rewardTokens distribution occurs.
        uint256 accRewardPerShare;  // Accumulated rewardTokens per share, times 1e18. See below.
    }

    // The REWARD TOKEN!
    IERC20 public rewardToken;
    // Reward tokens created per block.
    uint256 public rewardPerBlock;

    // Info of each pool.
    PoolInfo public poolInfo;
    // Info of each user that stakes ERC1155.
    mapping(address => UserInfo) public userInfo;
    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when rewardToken mining starts.
    uint256 public startBlock;

    // Reward token reservoir
    IReservoir public rewardReservoir;

    // ERC1155 collection address
    IERC1155 public collection;

    event Deposit(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, address indexed to, uint256 amount);

    event SetRewardReservoir(address reservoir);
    event SetRewardPerBlock(uint256 rewardPerBlock);

    event WithdrawAlien(IERC20 token, uint256 amount);

    constructor(
        IERC20 _rewardToken,
        IReservoir _rewardReservoir,
        IERC1155 _collection,
        uint256 _rewardPerBlock,
        uint256 _startBlock,
        uint256 _tokenId
    ) public {
        require(address(_rewardToken) != address(0), "RollAppStaking: rewardToken cannot be zero address");
        require(address(_collection) != address(0), "RollAppStaking: collection cannot be zero address");

        rewardToken = _rewardToken;
        rewardReservoir = _rewardReservoir;
        rewardPerBlock = _rewardPerBlock;
        startBlock = _startBlock;
        collection = _collection;

        _addPool(1 ether, _tokenId);
    }


    // ** EXTERNAL VIEW functions **

    // View function to see pending rewardTokens on frontend.
    function pendingReward(address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo;
        UserInfo storage user = userInfo[_user];
        uint256 accRewardPerShare = pool.accRewardPerShare;
        uint256 tokenSupply = collection.balanceOf(address(this), pool.tokenId);
        if (block.number > pool.lastRewardBlock && tokenSupply != 0) {
            uint256 multiplier = _getMultiplier(pool.lastRewardBlock, block.number);
            uint256 tokenReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accRewardPerShare = accRewardPerShare.add(tokenReward.mul(1e18).div(tokenSupply));
        }
        return user.amount.mul(accRewardPerShare).div(1e18).sub(user.rewardDebt);
    }


    // ** ERC1155 Receiver functions **

    function onERC1155Received(address, address, uint256, uint256, bytes calldata) external override returns(bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address, address, uint256[] calldata, uint256[] calldata, bytes calldata
    ) external override returns(bytes4) {
        return this.onERC1155BatchReceived.selector;
    }


    // ** USER public functions **

    // Update reward variables of the given pool to be up-to-date.
    function updatePool() public {
        PoolInfo storage pool = poolInfo;
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 tokenSupply = collection.balanceOf(address(this), pool.tokenId);

        if (tokenSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = _getMultiplier(pool.lastRewardBlock, block.number);
        uint256 tokenReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
        tokenReward = rewardReservoir.drip(tokenReward);
        // transfer tokens from rewardReservoir
        pool.accRewardPerShare = pool.accRewardPerShare.add(tokenReward.mul(1e18).div(tokenSupply));
        pool.lastRewardBlock = block.number;
    }

    // Deposit tokens to RollAppStaking for rewardToken allocation. When not paused.
    function deposit(uint256 _amount) external whenNotPaused {
        PoolInfo storage pool = poolInfo;
        UserInfo storage user = userInfo[msg.sender];
        updatePool();
        if (user.amount > 0) {
            uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e18).sub(user.rewardDebt);
            if (pending > 0) {
                _safeRewardTransfer(msg.sender, pending);
            }
        }
        if (_amount > 0) {
            collection.safeTransferFrom(msg.sender, address(this), pool.tokenId, _amount, "0x0");
            user.amount = user.amount.add(_amount);
        }
        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e18);
        emit Deposit(msg.sender, _amount);
    }

    // Withdraw tokens from RollAppStaking.
    function withdraw(uint256 _amount) external {
        PoolInfo storage pool = poolInfo;
        UserInfo storage user = userInfo[msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        updatePool();
        uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e18).sub(user.rewardDebt);
        if (pending > 0) {
            _safeRewardTransfer(msg.sender, pending);
        }
        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            collection.safeTransferFrom(address(this), msg.sender, pool.tokenId, _amount, "0x0");
        }
        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e18);
        emit Withdraw(msg.sender, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(address _to) external {
        PoolInfo storage pool = poolInfo;
        UserInfo storage user = userInfo[msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        collection.safeTransferFrom(address(this), _to, pool.tokenId, amount, "0x0");
        emit EmergencyWithdraw(msg.sender, _to, amount);
    }


    // ** ONLY OWNER OR ADMIN functions **

    // Set reward per block. Can only be called by the owner or admin.
    function setRewardPerBlock(uint256 _rewardPerBlock, bool _withUpdate) external onlyOwnerOrAdmin {
        if (_withUpdate) {
            updatePool();
        }
        rewardPerBlock = _rewardPerBlock;
        emit SetRewardPerBlock(_rewardPerBlock);
    }


    // ** ONLY OWNER functions **

    // Set rewardReservoir. Can only be called by the owner.
    function setRewardReservoir(IReservoir _rewardReservoir) external onlyOwner {
        rewardReservoir = _rewardReservoir;
        emit SetRewardReservoir(address(_rewardReservoir));
    }

    // Pause deposit function. Can only be called by the owner.
    function pause() external onlyOwner {
        _pause();
    }

    // Unpause deposit function. Can only be called by the owner.
    function unpause() external onlyOwner {
        _unpause();
    }

    // Withdraw alien ERC20 assets. Can only be called by the owner.
    function withdrawAlien(IERC20 _token, uint256 _amount) public onlyOwner {
        require(_token != rewardToken, "withdrawAlien: cannot withdraw reward token");

        uint256 tokenBalance = _token.balanceOf(address(this));
        uint256 withdrawalAmount = (_amount > tokenBalance) ? tokenBalance : _amount;

        _token.safeTransfer(msg.sender, withdrawalAmount);
        emit WithdrawAlien(_token, withdrawalAmount);
    }


    // ** INTERNAL functions **

    // Return reward multiplier over the given _from to _to block.
    function _getMultiplier(uint256 _from, uint256 _to) internal pure returns (uint256) {
        return _to.sub(_from);
    }

    // Add a new tokeId to the pool.
    function _addPool(uint256 _allocPoint, uint256 _tokenId) internal {
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);

        poolInfo = PoolInfo({
            tokenId : _tokenId,
            allocPoint : _allocPoint,
            lastRewardBlock : lastRewardBlock,
            accRewardPerShare : 0
        });
    }

    // Safe rewardToken transfer function, just in case if rounding error causes pool to not have enough rewardTokens.
    function _safeRewardTransfer(address _to, uint256 _amount) internal {
        uint256 rewardBal = rewardToken.balanceOf(address(this));
        if (_amount > rewardBal) {
            rewardToken.safeTransfer(_to, rewardBal);
        } else {
            rewardToken.safeTransfer(_to, _amount);
        }
    }
}

File 2 of 15 : IReservoir.sol
/*
 * RollApp
 *
 * Copyright ©️ 2021 Curio AG (Company Number FL-0002.594.728-9)
 * Incorporated and registered in Liechtenstein.
 *
 * Copyright ©️ 2021 Curio Capital AG (Company Number CHE-211.446.654)
 * Incorporated and registered in Zug, Switzerland.
 */
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

/**
 * @dev Interface of Reservoir contract.
 */
interface IReservoir {
    function drip(uint256 requestedTokens)
        external
        returns (uint256 sentTokens);
}

File 3 of 15 : Adminable.sol
/*
 * RollApp
 *
 * Copyright ©️ 2021 Curio AG (Company Number FL-0002.594.728-9)
 * Incorporated and registered in Liechtenstein.
 *
 * Copyright ©️ 2021 Curio Capital AG (Company Number CHE-211.446.654)
 * Incorporated and registered in Zug, Switzerland.
 */
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title Adminable
 *
 * @dev Abstract contract provides a basic access control mechanism for Admin role.
 */
abstract contract Adminable is Ownable {
    // statuses of admins addresses
    mapping(address => bool) public admins;

    event AdminPermissionSet(address indexed account, bool isAdmin);

    /**
     * @dev Creates a contract with msg.sender as first admin.
     */
    constructor() internal {
        admins[msg.sender] = true;
    }

    /**
     * @dev Throws if called by any account other than the admin.
     */
    modifier onlyAdmin {
        require(admins[msg.sender], "Adminable: permission denied");
        _;
    }

    modifier onlyOwnerOrAdmin {
        require(admins[msg.sender] || msg.sender == owner(), "Adminable: permission denied");
        _;
    }

    /**
     * @dev Allows the owner to add or remove other admin account.
     *
     * Requirements:
     * - can only be called by owner.
     *
     * @param _admin The address of admin account to add or remove.
     * @param _status True if admin is added, false if removed.
     */
    function setAdminPermission(address _admin, bool _status) public onlyOwner {
        _setAdminPermission(_admin, _status);
    }

    /**
     * @dev Allows the owner to add or remove many others admins.
     *
     * Requirements:
     * - can only be called by owner.
     * - the lengths of the arrays must be the same.
     *
     * @param _admins The array of addresses of admins accounts to add or remove.
     * @param _statuses Array of statuses of each address.
     */
    function setAdminPermissions(
        address[] memory _admins,
        bool[] memory _statuses
    ) public onlyOwner {
        uint256 len = _admins.length;
        require(len == _statuses.length, "Adminable: Array lengths do not match");

        for (uint256 i = 0; i < len; i++) {
            _setAdminPermission(_admins[i], _statuses[i]);
        }
    }

    /**
     * @dev Sets the admin/not admin status for the specified address.
     *
     * Emits a {AdminPermissionSet} event with `account` set to new added
     * or removed admin address and `isAdmin` set to admin account status.
     *
     * @param _admin The address of admin account to add or remove.
     * @param _status True if admin is added, false if removed.
     */
    function _setAdminPermission(address _admin, bool _status) internal {
        admins[_admin] = _status;
        emit AdminPermissionSet(_admin, _status);
    }
}

File 4 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 15 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

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

File 6 of 15 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on 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;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @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 IERC20;` 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));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    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, "SafeERC20: decreased allowance below zero");
        _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. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "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");
        }
    }
}

File 8 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @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 9 of 15 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../introspection/IERC165.sol";

/**
 * _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {

    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        external
        returns(bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        external
        returns(bytes4);
}

File 10 of 15 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "../../introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
}

File 11 of 15 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC1155Receiver.sol";
import "../../introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    constructor() internal {
        _registerInterface(
            ERC1155Receiver(address(0)).onERC1155Received.selector ^
            ERC1155Receiver(address(0)).onERC1155BatchReceived.selector
        );
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

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

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

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        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");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 13 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

File 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IReservoir","name":"_rewardReservoir","type":"address"},{"internalType":"contract IERC1155","name":"_collection","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isAdmin","type":"bool"}],"name":"AdminPermissionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"SetRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"reservoir","type":"address"}],"name":"SetRewardReservoir","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawAlien","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admins","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collection","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolInfo","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardReservoir","outputs":[{"internalType":"contract IReservoir","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAdminPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_admins","type":"address[]"},{"internalType":"bool[]","name":"_statuses","type":"bool[]"}],"name":"setAdminPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"setRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReservoir","name":"_rewardReservoir","type":"address"}],"name":"setRewardReservoir","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAlien","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600b553480156200001657600080fd5b506040516200229938038062002299833981810160405260c08110156200003c57600080fd5b508051602082015160408301516060840151608085015160a090950151939492939192909160006200006d620001f8565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350336000908152600160208190526040909120805460ff199081169092179055600280549091169055620000f16301ffc9a760e01b620001fc565b62000103630271189760e51b620001fc565b6001600160a01b0386166200014a5760405162461bcd60e51b8152600401808060200182810382526032815260200180620022676032913960400191505060405180910390fd5b6001600160a01b038416620001915760405162461bcd60e51b8152600401808060200182810382526031815260200180620022366031913960400191505060405180910390fd5b600480546001600160a01b038089166001600160a01b031992831617909255600d80548884169083161790556005859055600c849055600e805492871692909116919091179055620001ec670de0b6b3a76400008262000281565b50505050505062000356565b3390565b6001600160e01b031980821614156200025c576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152600360205260409020805460ff19166001179055565b6000600c5443116200029657600c5462000298565b435b9050620002b683600b54620002f460201b620016a11790919060201c565b600b55604080516080810182528381526020810185905290810182905260006060909101819052600692909255600792909255600891909155600955565b6000828201838110156200034f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b611ed080620003666000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806381505c05116100f9578063b6b55f2511610097578063f23a6e6111610071578063f23a6e611461068b578063f2fde38b1461071e578063f40f0f5214610744578063f7c618c11461076a576101c4565b8063b6b55f2514610522578063bc197c811461053f578063e3161ddd14610683576101c4565b80638da5cb5b116100d35780638da5cb5b146103a5578063a0c92eec146103ad578063a6dd10f8146104d0578063af3ae26d146104f6576101c4565b806381505c05146103705780638456cb59146103955780638ae39cac1461039d576101c4565b806348cd4cb1116101665780636ff1c9bc116101405780636ff1c9bc1461030c578063715018a61461033257806375f3974b1461033a5780637de1e53614610368576101c4565b806348cd4cb1146102ce5780635a2f3d09146102d65780635c975abb14610304576101c4565b80631959a002116101a25780631959a002146102425780632e1a7d4d146102815780633f4ba83a146102a0578063429b62e5146102a8576101c4565b806301ffc9a7146101c95780630a15e61b1461020457806317caf6f114610228575b600080fd5b6101f0600480360360208110156101df57600080fd5b50356001600160e01b031916610772565b604080519115158252519081900360200190f35b61020c610791565b604080516001600160a01b039092168252519081900360200190f35b6102306107a0565b60408051918252519081900360200190f35b6102686004803603602081101561025857600080fd5b50356001600160a01b03166107a6565b6040805192835260208301919091528051918290030190f35b61029e6004803603602081101561029757600080fd5b50356107bf565b005b61029e61097c565b6101f0600480360360208110156102be57600080fd5b50356001600160a01b03166109e8565b6102306109fd565b6102de610a03565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101f0610a12565b61029e6004803603602081101561032257600080fd5b50356001600160a01b0316610a1b565b61029e610b15565b61029e6004803603604081101561035057600080fd5b506001600160a01b0381351690602001351515610bc1565b61020c610c31565b61029e6004803603604081101561038657600080fd5b50803590602001351515610c40565b61029e610d11565b610230610d7b565b61020c610d81565b61029e600480360360408110156103c357600080fd5b810190602081018135600160201b8111156103dd57600080fd5b8201836020820111156103ef57600080fd5b803590602001918460208302840111600160201b8311171561041057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561045f57600080fd5b82018360208201111561047157600080fd5b803590602001918460208302840111600160201b8311171561049257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d90945050505050565b61029e600480360360208110156104e657600080fd5b50356001600160a01b0316610e7c565b61029e6004803603604081101561050c57600080fd5b506001600160a01b038135169060200135610f32565b61029e6004803603602081101561053857600080fd5b50356110cf565b610666600480360360a081101561055557600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b81111561058857600080fd5b82018360208201111561059a57600080fd5b803590602001918460208302840111600160201b831117156105bb57600080fd5b919390929091602081019035600160201b8111156105d857600080fd5b8201836020820111156105ea57600080fd5b803590602001918460208302840111600160201b8311171561060b57600080fd5b919390929091602081019035600160201b81111561062857600080fd5b82018360208201111561063a57600080fd5b803590602001918460018302840111600160201b8311171561065b57600080fd5b50909250905061128a565b604080516001600160e01b03199092168252519081900360200190f35b61029e61129e565b610666600480360360a08110156106a157600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b8111156106e057600080fd5b8201836020820111156106f257600080fd5b803590602001918460018302840111600160201b8311171561071357600080fd5b509092509050611436565b61029e6004803603602081101561073457600080fd5b50356001600160a01b0316611448565b6102306004803603602081101561075a57600080fd5b50356001600160a01b031661154a565b61020c611692565b6001600160e01b03191660009081526003602052604090205460ff1690565b600d546001600160a01b031681565b600b5481565b600a602052600090815260409020805460019091015482565b336000908152600a6020526040902080546006919083111561081d576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b61082561129e565b6000610862826001015461085c670de0b6b3a76400006108568760030154876000015461170490919063ffffffff16565b9061175d565b906117c4565b90508015610874576108743382611821565b831561091d57815461088690856117c4565b8255600e54835460408051637921219560e11b815230600482015233602482015260448101929092526064820187905260a06084830152600360a48301526203078360ec1b60c4830152516001600160a01b039092169163f242432a9160e48082019260009290919082900301818387803b15801561090457600080fd5b505af1158015610918573d6000803e3d6000fd5b505050505b6003830154825461093b91670de0b6b3a76400009161085691611704565b600183015560408051858152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a250505050565b6109846118de565b6001600160a01b0316610995610d81565b6001600160a01b0316146109de576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6109e66118e2565b565b60016020526000908152604090205460ff1681565b600c5481565b60065460075460085460095484565b60025460ff1690565b336000908152600a6020526040808220805483825560018201849055600e54600680548551637921219560e11b81523060048201526001600160a01b03898116602483015260448201929092526064810185905260a06084820152600360a48201526203078360ec1b60c4820152955191969495939492169263f242432a9260e480830193919282900301818387803b158015610ab757600080fd5b505af1158015610acb573d6000803e3d6000fd5b50506040805184815290516001600160a01b03881693503392507ff24ef89f38eadc1bde50701ad6e4d6d11a2dc24f7cf834a486991f38833285049181900360200190a350505050565b610b1d6118de565b6001600160a01b0316610b2e610d81565b6001600160a01b031614610b77576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610bc96118de565b6001600160a01b0316610bda610d81565b6001600160a01b031614610c23576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b610c2d8282611982565b5050565b600e546001600160a01b031681565b3360009081526001602052604090205460ff1680610c765750610c61610d81565b6001600160a01b0316336001600160a01b0316145b610cc7576040805162461bcd60e51b815260206004820152601c60248201527f41646d696e61626c653a207065726d697373696f6e2064656e69656400000000604482015290519081900360640190fd5b8015610cd557610cd561129e565b60058290556040805183815290517f22c0456177178fec69cb519ce05c0f0b39708187e616a82ceea49f84e19169cd9181900360200190a15050565b610d196118de565b6001600160a01b0316610d2a610d81565b6001600160a01b031614610d73576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6109e66119e2565b60055481565b6000546001600160a01b031690565b610d986118de565b6001600160a01b0316610da9610d81565b6001600160a01b031614610df2576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b815181518114610e335760405162461bcd60e51b8152600401808060200182810382526025815260200180611d946025913960400191505060405180910390fd5b60005b81811015610e7657610e6e848281518110610e4d57fe5b6020026020010151848381518110610e6157fe5b6020026020010151611982565b600101610e36565b50505050565b610e846118de565b6001600160a01b0316610e95610d81565b6001600160a01b031614610ede576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b600d80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ff243e62bec804104afe7b2ab78e5e90d349a0e5a420a10589f5a543f3e7ee7fc9181900360200190a150565b610f3a6118de565b6001600160a01b0316610f4b610d81565b6001600160a01b031614610f94576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6004546001600160a01b0383811691161415610fe15760405162461bcd60e51b815260040180806020018281038252602b815260200180611ddf602b913960400191505060405180910390fd5b6000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561103057600080fd5b505afa158015611044573d6000803e3d6000fd5b505050506040513d602081101561105a57600080fd5b50519050600081831161106d578261106f565b815b90506110856001600160a01b0385163383611a65565b604080516001600160a01b03861681526020810183905281517ffe6840162a79fe9fccf0bec859ec79a37312cfc90ab2f2c8c1af38ab4ecfd01d929181900390910190a150505050565b6110d7610a12565b1561111c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b336000908152600a6020526040902060069061113661129e565b80541561118257600061116e826001015461085c670de0b6b3a76400006108568760030154876000015461170490919063ffffffff16565b90508015611180576111803382611821565b505b821561122c57600e54825460408051637921219560e11b815233600482015230602482015260448101929092526064820186905260a06084830152600360a48301526203078360ec1b60c4830152516001600160a01b039092169163f242432a9160e48082019260009290919082900301818387803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b5050825461122992509050846116a1565b81555b6003820154815461124a91670de0b6b3a76400009161085691611704565b600182015560408051848152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2505050565b63bc197c8160e01b98975050505050505050565b60085460069043116112b057506109e6565b600e54815460408051627eeac760e11b81523060048201526024810192909252516000926001600160a01b03169162fdd58e916044808301926020929190829003018186803b15801561130257600080fd5b505afa158015611316573d6000803e3d6000fd5b505050506040513d602081101561132c57600080fd5b50519050806113425750436002909101556109e6565b6000611352836002015443611ab7565b9050600061137f600b5461085686600101546113796005548761170490919063ffffffff16565b90611704565b600d5460408051632c1935bd60e11b81526004810184905290519293506001600160a01b03909116916358326b7a916024808201926020929091908290030181600087803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506040513d60208110156113fa57600080fd5b505190506114226114178461085684670de0b6b3a7640000611704565b6003860154906116a1565b600385015550504360029092019190915550565b63f23a6e6160e01b9695505050505050565b6114506118de565b6001600160a01b0316611461610d81565b6001600160a01b0316146114aa576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6001600160a01b0381166114ef5760405162461bcd60e51b8152600401808060200182810382526026815260200180611db96026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038082166000908152600a60209081526040808320600954600e54600680548551627eeac760e11b81523060048201526024810191909152945196979096939592948894929091169262fdd58e92604480840193829003018186803b1580156115b957600080fd5b505afa1580156115cd573d6000803e3d6000fd5b505050506040513d60208110156115e357600080fd5b50516002850154909150431180156115fa57508015155b1561165d57600061160f856002015443611ab7565b90506000611636600b5461085688600101546113796005548761170490919063ffffffff16565b90506116586116518461085684670de0b6b3a7640000611704565b85906116a1565b935050505b611688836001015461085c670de0b6b3a764000061085686886000015461170490919063ffffffff16565b9695505050505050565b6004546001600160a01b031681565b6000828201838110156116fb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600082611713575060006116fe565b8282028284828161172057fe5b04146116fb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e306021913960400191505060405180910390fd5b60008082116117b3576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816117bc57fe5b049392505050565b60008282111561181b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561187057600080fd5b505afa158015611884573d6000803e3d6000fd5b505050506040513d602081101561189a57600080fd5b50519050808211156118c2576004546118bd906001600160a01b03168483611a65565b6118d9565b6004546118d9906001600160a01b03168484611a65565b505050565b3390565b6118ea610a12565b611932576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6119656118de565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b038216600081815260016020908152604091829020805460ff1916851515908117909155825190815291517fd80b81cdd3eaf5642e0ede06b790a6f8ae1791baa7db7bf13448e9393df037739281900390910190a25050565b6119ea610a12565b15611a2f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119656118de565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526118d9908490611ac3565b60006116fb82846117c4565b6060611b18826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b749092919063ffffffff16565b8051909150156118d957808060200190516020811015611b3757600080fd5b50516118d95760405162461bcd60e51b815260040180806020018281038252602a815260200180611e71602a913960400191505060405180910390fd5b6060611b838484600085611b8d565b90505b9392505050565b606082471015611bce5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e0a6026913960400191505060405180910390fd5b611bd785611ce9565b611c28576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611c675780518252601f199092019160209182019101611c48565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611cc9576040519150601f19603f3d011682016040523d82523d6000602084013e611cce565b606091505b5091509150611cde828286611cef565b979650505050505050565b3b151590565b60608315611cfe575081611b86565b825115611d0e5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d58578181015183820152602001611d40565b50505050905090810190601f168015611d855780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe41646d696e61626c653a204172726179206c656e6774687320646f206e6f74206d617463684f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573737769746864726177416c69656e3a2063616e6e6f742077697468647261772072657761726420746f6b656e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220bb8a9a09ed75e3bde910035e6aef52e0e19f8d2aa474ffb356f7b1ec134bb6ec64736f6c634300060c0033526f6c6c4170705374616b696e673a20636f6c6c656374696f6e2063616e6e6f74206265207a65726f2061646472657373526f6c6c4170705374616b696e673a20726577617264546f6b656e2063616e6e6f74206265207a65726f2061646472657373000000000000000000000000f56b164efd3cfc02ba739b719b6526a6fa1ca32a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006884ef328ea1862e69bed5aa30ffafd4ed096ce80000000000000000000000000000000000000000000000000587191b75fd84750000000000000000000000000000000000000000000000000000000000000000db989915643334f5a715b7c2e30a831f802119e4000000000000000000000001

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806381505c05116100f9578063b6b55f2511610097578063f23a6e6111610071578063f23a6e611461068b578063f2fde38b1461071e578063f40f0f5214610744578063f7c618c11461076a576101c4565b8063b6b55f2514610522578063bc197c811461053f578063e3161ddd14610683576101c4565b80638da5cb5b116100d35780638da5cb5b146103a5578063a0c92eec146103ad578063a6dd10f8146104d0578063af3ae26d146104f6576101c4565b806381505c05146103705780638456cb59146103955780638ae39cac1461039d576101c4565b806348cd4cb1116101665780636ff1c9bc116101405780636ff1c9bc1461030c578063715018a61461033257806375f3974b1461033a5780637de1e53614610368576101c4565b806348cd4cb1146102ce5780635a2f3d09146102d65780635c975abb14610304576101c4565b80631959a002116101a25780631959a002146102425780632e1a7d4d146102815780633f4ba83a146102a0578063429b62e5146102a8576101c4565b806301ffc9a7146101c95780630a15e61b1461020457806317caf6f114610228575b600080fd5b6101f0600480360360208110156101df57600080fd5b50356001600160e01b031916610772565b604080519115158252519081900360200190f35b61020c610791565b604080516001600160a01b039092168252519081900360200190f35b6102306107a0565b60408051918252519081900360200190f35b6102686004803603602081101561025857600080fd5b50356001600160a01b03166107a6565b6040805192835260208301919091528051918290030190f35b61029e6004803603602081101561029757600080fd5b50356107bf565b005b61029e61097c565b6101f0600480360360208110156102be57600080fd5b50356001600160a01b03166109e8565b6102306109fd565b6102de610a03565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101f0610a12565b61029e6004803603602081101561032257600080fd5b50356001600160a01b0316610a1b565b61029e610b15565b61029e6004803603604081101561035057600080fd5b506001600160a01b0381351690602001351515610bc1565b61020c610c31565b61029e6004803603604081101561038657600080fd5b50803590602001351515610c40565b61029e610d11565b610230610d7b565b61020c610d81565b61029e600480360360408110156103c357600080fd5b810190602081018135600160201b8111156103dd57600080fd5b8201836020820111156103ef57600080fd5b803590602001918460208302840111600160201b8311171561041057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561045f57600080fd5b82018360208201111561047157600080fd5b803590602001918460208302840111600160201b8311171561049257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d90945050505050565b61029e600480360360208110156104e657600080fd5b50356001600160a01b0316610e7c565b61029e6004803603604081101561050c57600080fd5b506001600160a01b038135169060200135610f32565b61029e6004803603602081101561053857600080fd5b50356110cf565b610666600480360360a081101561055557600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b81111561058857600080fd5b82018360208201111561059a57600080fd5b803590602001918460208302840111600160201b831117156105bb57600080fd5b919390929091602081019035600160201b8111156105d857600080fd5b8201836020820111156105ea57600080fd5b803590602001918460208302840111600160201b8311171561060b57600080fd5b919390929091602081019035600160201b81111561062857600080fd5b82018360208201111561063a57600080fd5b803590602001918460018302840111600160201b8311171561065b57600080fd5b50909250905061128a565b604080516001600160e01b03199092168252519081900360200190f35b61029e61129e565b610666600480360360a08110156106a157600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b8111156106e057600080fd5b8201836020820111156106f257600080fd5b803590602001918460018302840111600160201b8311171561071357600080fd5b509092509050611436565b61029e6004803603602081101561073457600080fd5b50356001600160a01b0316611448565b6102306004803603602081101561075a57600080fd5b50356001600160a01b031661154a565b61020c611692565b6001600160e01b03191660009081526003602052604090205460ff1690565b600d546001600160a01b031681565b600b5481565b600a602052600090815260409020805460019091015482565b336000908152600a6020526040902080546006919083111561081d576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b61082561129e565b6000610862826001015461085c670de0b6b3a76400006108568760030154876000015461170490919063ffffffff16565b9061175d565b906117c4565b90508015610874576108743382611821565b831561091d57815461088690856117c4565b8255600e54835460408051637921219560e11b815230600482015233602482015260448101929092526064820187905260a06084830152600360a48301526203078360ec1b60c4830152516001600160a01b039092169163f242432a9160e48082019260009290919082900301818387803b15801561090457600080fd5b505af1158015610918573d6000803e3d6000fd5b505050505b6003830154825461093b91670de0b6b3a76400009161085691611704565b600183015560408051858152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a250505050565b6109846118de565b6001600160a01b0316610995610d81565b6001600160a01b0316146109de576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6109e66118e2565b565b60016020526000908152604090205460ff1681565b600c5481565b60065460075460085460095484565b60025460ff1690565b336000908152600a6020526040808220805483825560018201849055600e54600680548551637921219560e11b81523060048201526001600160a01b03898116602483015260448201929092526064810185905260a06084820152600360a48201526203078360ec1b60c4820152955191969495939492169263f242432a9260e480830193919282900301818387803b158015610ab757600080fd5b505af1158015610acb573d6000803e3d6000fd5b50506040805184815290516001600160a01b03881693503392507ff24ef89f38eadc1bde50701ad6e4d6d11a2dc24f7cf834a486991f38833285049181900360200190a350505050565b610b1d6118de565b6001600160a01b0316610b2e610d81565b6001600160a01b031614610b77576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610bc96118de565b6001600160a01b0316610bda610d81565b6001600160a01b031614610c23576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b610c2d8282611982565b5050565b600e546001600160a01b031681565b3360009081526001602052604090205460ff1680610c765750610c61610d81565b6001600160a01b0316336001600160a01b0316145b610cc7576040805162461bcd60e51b815260206004820152601c60248201527f41646d696e61626c653a207065726d697373696f6e2064656e69656400000000604482015290519081900360640190fd5b8015610cd557610cd561129e565b60058290556040805183815290517f22c0456177178fec69cb519ce05c0f0b39708187e616a82ceea49f84e19169cd9181900360200190a15050565b610d196118de565b6001600160a01b0316610d2a610d81565b6001600160a01b031614610d73576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6109e66119e2565b60055481565b6000546001600160a01b031690565b610d986118de565b6001600160a01b0316610da9610d81565b6001600160a01b031614610df2576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b815181518114610e335760405162461bcd60e51b8152600401808060200182810382526025815260200180611d946025913960400191505060405180910390fd5b60005b81811015610e7657610e6e848281518110610e4d57fe5b6020026020010151848381518110610e6157fe5b6020026020010151611982565b600101610e36565b50505050565b610e846118de565b6001600160a01b0316610e95610d81565b6001600160a01b031614610ede576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b600d80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ff243e62bec804104afe7b2ab78e5e90d349a0e5a420a10589f5a543f3e7ee7fc9181900360200190a150565b610f3a6118de565b6001600160a01b0316610f4b610d81565b6001600160a01b031614610f94576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6004546001600160a01b0383811691161415610fe15760405162461bcd60e51b815260040180806020018281038252602b815260200180611ddf602b913960400191505060405180910390fd5b6000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561103057600080fd5b505afa158015611044573d6000803e3d6000fd5b505050506040513d602081101561105a57600080fd5b50519050600081831161106d578261106f565b815b90506110856001600160a01b0385163383611a65565b604080516001600160a01b03861681526020810183905281517ffe6840162a79fe9fccf0bec859ec79a37312cfc90ab2f2c8c1af38ab4ecfd01d929181900390910190a150505050565b6110d7610a12565b1561111c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b336000908152600a6020526040902060069061113661129e565b80541561118257600061116e826001015461085c670de0b6b3a76400006108568760030154876000015461170490919063ffffffff16565b90508015611180576111803382611821565b505b821561122c57600e54825460408051637921219560e11b815233600482015230602482015260448101929092526064820186905260a06084830152600360a48301526203078360ec1b60c4830152516001600160a01b039092169163f242432a9160e48082019260009290919082900301818387803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b5050825461122992509050846116a1565b81555b6003820154815461124a91670de0b6b3a76400009161085691611704565b600182015560408051848152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2505050565b63bc197c8160e01b98975050505050505050565b60085460069043116112b057506109e6565b600e54815460408051627eeac760e11b81523060048201526024810192909252516000926001600160a01b03169162fdd58e916044808301926020929190829003018186803b15801561130257600080fd5b505afa158015611316573d6000803e3d6000fd5b505050506040513d602081101561132c57600080fd5b50519050806113425750436002909101556109e6565b6000611352836002015443611ab7565b9050600061137f600b5461085686600101546113796005548761170490919063ffffffff16565b90611704565b600d5460408051632c1935bd60e11b81526004810184905290519293506001600160a01b03909116916358326b7a916024808201926020929091908290030181600087803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506040513d60208110156113fa57600080fd5b505190506114226114178461085684670de0b6b3a7640000611704565b6003860154906116a1565b600385015550504360029092019190915550565b63f23a6e6160e01b9695505050505050565b6114506118de565b6001600160a01b0316611461610d81565b6001600160a01b0316146114aa576040805162461bcd60e51b81526020600482018190526024820152600080516020611e51833981519152604482015290519081900360640190fd5b6001600160a01b0381166114ef5760405162461bcd60e51b8152600401808060200182810382526026815260200180611db96026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038082166000908152600a60209081526040808320600954600e54600680548551627eeac760e11b81523060048201526024810191909152945196979096939592948894929091169262fdd58e92604480840193829003018186803b1580156115b957600080fd5b505afa1580156115cd573d6000803e3d6000fd5b505050506040513d60208110156115e357600080fd5b50516002850154909150431180156115fa57508015155b1561165d57600061160f856002015443611ab7565b90506000611636600b5461085688600101546113796005548761170490919063ffffffff16565b90506116586116518461085684670de0b6b3a7640000611704565b85906116a1565b935050505b611688836001015461085c670de0b6b3a764000061085686886000015461170490919063ffffffff16565b9695505050505050565b6004546001600160a01b031681565b6000828201838110156116fb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600082611713575060006116fe565b8282028284828161172057fe5b04146116fb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e306021913960400191505060405180910390fd5b60008082116117b3576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816117bc57fe5b049392505050565b60008282111561181b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561187057600080fd5b505afa158015611884573d6000803e3d6000fd5b505050506040513d602081101561189a57600080fd5b50519050808211156118c2576004546118bd906001600160a01b03168483611a65565b6118d9565b6004546118d9906001600160a01b03168484611a65565b505050565b3390565b6118ea610a12565b611932576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6119656118de565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b038216600081815260016020908152604091829020805460ff1916851515908117909155825190815291517fd80b81cdd3eaf5642e0ede06b790a6f8ae1791baa7db7bf13448e9393df037739281900390910190a25050565b6119ea610a12565b15611a2f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119656118de565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526118d9908490611ac3565b60006116fb82846117c4565b6060611b18826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b749092919063ffffffff16565b8051909150156118d957808060200190516020811015611b3757600080fd5b50516118d95760405162461bcd60e51b815260040180806020018281038252602a815260200180611e71602a913960400191505060405180910390fd5b6060611b838484600085611b8d565b90505b9392505050565b606082471015611bce5760405162461bcd60e51b8152600401808060200182810382526026815260200180611e0a6026913960400191505060405180910390fd5b611bd785611ce9565b611c28576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611c675780518252601f199092019160209182019101611c48565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611cc9576040519150601f19603f3d011682016040523d82523d6000602084013e611cce565b606091505b5091509150611cde828286611cef565b979650505050505050565b3b151590565b60608315611cfe575081611b86565b825115611d0e5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d58578181015183820152602001611d40565b50505050905090810190601f168015611d855780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe41646d696e61626c653a204172726179206c656e6774687320646f206e6f74206d617463684f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573737769746864726177416c69656e3a2063616e6e6f742077697468647261772072657761726420746f6b656e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220bb8a9a09ed75e3bde910035e6aef52e0e19f8d2aa474ffb356f7b1ec134bb6ec64736f6c634300060c0033

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

000000000000000000000000f56b164efd3cfc02ba739b719b6526a6fa1ca32a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006884ef328ea1862e69bed5aa30ffafd4ed096ce80000000000000000000000000000000000000000000000000587191b75fd84750000000000000000000000000000000000000000000000000000000000000000db989915643334f5a715b7c2e30a831f802119e4000000000000000000000001

-----Decoded View---------------
Arg [0] : _rewardToken (address): 0xF56b164efd3CFc02BA739b719B6526A6FA1cA32a
Arg [1] : _rewardReservoir (address): 0x0000000000000000000000000000000000000000
Arg [2] : _collection (address): 0x6884eF328EA1862E69beD5aA30FfAfD4ed096Ce8
Arg [3] : _rewardPerBlock (uint256): 398314697779938421
Arg [4] : _startBlock (uint256): 0
Arg [5] : _tokenId (uint256): 99326131137483886891004264430325786609158860882489678491178031342521990250497

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000f56b164efd3cfc02ba739b719b6526a6fa1ca32a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000006884ef328ea1862e69bed5aa30ffafd4ed096ce8
Arg [3] : 0000000000000000000000000000000000000000000000000587191b75fd8475
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : db989915643334f5a715b7c2e30a831f802119e4000000000000000000000001


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