Contract 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821Stake590415192023-02-08 8:04:393 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006807
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bbStake590414612023-02-08 8:04:233 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006475
0xa4c25a8a60e233cbcf3fdbcfd2ce9a3927c11c730c68b4e5925f78548f888b2cUnstake590408202023-02-08 8:01:466 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005958
0x6c38bb25fbca1bbb05585b0fac39b7ed2d6ac4c7d41df2d3f4e8cd5a1656d343Stake590405222023-02-08 8:00:307 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006836
0x78bb175bb0a4cf9edffa5125dfe9a193ea80dc9276587653ae04032b131c98a4Harvest590404262023-02-08 8:00:038 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007159
0x7feb2affa47fd9e17c4a07db559fdaa4993baa167d74c42848d2f8a4eefa2858Harvest590402852023-02-08 7:59:278 mins ago0x0ed57484e130e435fe6f8383ef9318ce8704e6fd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005086
0x01b376613b68ae422b2f79e00be13496fcf736280ced9f29f830cdbdc4340244Harvest590390852023-02-08 7:54:2213 mins ago0xc4ba4f981112db41e8edde523bcc09378cb17eb1 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005356
0xe6446bdea8df72e92bf358fe4c450ad81ebf6b3483a8ae23b3e1813882217af7Stake590389012023-02-08 7:53:3514 mins ago0x9ef171a8c62eea6455830bde5de99db5a7ca5119 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00013609
0xa09ded81718db18f262cd7f9176991e1c587932fc477eca492913c19c690a370Stake590385842023-02-08 7:52:1316 mins ago0x01c1eee6d802645dcccefd9f609765db864188a9 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006252
0xc550762fe9e11492319a9fb780c90a1a8ee3dea5a141ea56349c3bd76cb66bffUnstake590362462023-02-08 7:42:1825 mins ago0x8f6e3361385660524f88de44737ba8f41f216a3f IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006536
0x49a6db439fd35e649a91391b9426277461787a048d0716d8fcac6075283455d3Harvest590359282023-02-08 7:40:5527 mins ago0x8f6e3361385660524f88de44737ba8f41f216a3f IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005279
0x7d0c19aa22c708ad8b2d28c66eb06f2240dcc129829fcab3825798a709bee356Stake590352332023-02-08 7:37:5730 mins ago0x5877022fe1a776e5275ed535b50d83a69634089c IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007318
0xbe05fae3e9a71b028aec5f40c0c6facd8f19f4dcd95795b77ec4629dcd0efb9bStake590350052023-02-08 7:36:5731 mins ago0x5877022fe1a776e5275ed535b50d83a69634089c IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007319
0x840e0a947a07d03b20af200156a6704378a7a2cbfe9ee88eb2c25e16deb4c1acStake590343962023-02-08 7:34:1433 mins ago0x99fee9e1c22eca7aa9cbdefa68a9dd6bed152e21 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006641
0x5e7494274ba58313bb4080fea34b2d60e7aa71451d788b7275bd96ae71e97663Stake590342502023-02-08 7:33:3634 mins ago0x5877022fe1a776e5275ed535b50d83a69634089c IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007318
0x993c6fecd7d04abcca10fca938b69dcf2d62ee752cecc6665686fd45eac96407Stake590339752023-02-08 7:32:2235 mins ago0x5a470fbc821b7bb42d896707097210eb2309a3dd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00008895
0xa54cb58495548e800158fc0cb26c76fb7be9d0bc7821b2286a8e3b4bdbe51073Stake590327722023-02-08 7:27:0441 mins ago0x450cbba6de0bc9da5871e07bc511e4ff1f41dacd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007244
0x8078ab215474ee040a429416f4f48d8a6c6f9b8de9db9d8cf600e10b6dd8084dHarvest590326942023-02-08 7:26:4341 mins ago0x450cbba6de0bc9da5871e07bc511e4ff1f41dacd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005396
0x683cc06d528f511fb126bb1cd3048847eebde66796c19b2c6fa7877f812d1f2dStake590320742023-02-08 7:24:0444 mins ago0x31f3208e17b11c671a78280a734226e4e546f585 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.0000687
0x906b503b1e7768aca8d8b258528b7da35c809ef9ea0e566e896719eb2d5f94c0Harvest590312242023-02-08 7:20:1747 mins ago0x7a4510d033986af688a0a8a9ef114d07a7b2a577 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005965
0x8d9156a9cb08c9b5f17f5f6db5baeb9417d7d62aab4bdf4e75921ca8aea9c528Stake590287342023-02-08 7:09:2758 mins ago0x5a470fbc821b7bb42d896707097210eb2309a3dd IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.0000814
0x748e8151b92f19e1695c2206fe7b215b26a0af817f2125d29080c7f2cdc8db03Unstake590278532023-02-08 7:05:411 hr 2 mins ago0x36e3b42e57a21701662e8c522b427d85e0e5df29 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00006347
0x036359860607c575eb115cbf55e0d01e9c817c5a6e417bfe6856c020927e5078Harvest590272762023-02-08 7:03:091 hr 5 mins ago0x1cfdf6f913a8eed38b39e9dc6b73f478d4f6cf72 IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00005498
0xf4bb48e6311a8d964ca4fdb4ca3a8594e01ce0c35bc5060e1f1837533ee07f34Stake590271952023-02-08 7:02:471 hr 5 mins ago0x37f3a858c8af36cf84fca69921fc511a98d5c2ee IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007189
0x807d0ba3b8953a07fb90e086f9d23355e00669918c82675a3b4e0a4da0066c86Harvest590271262023-02-08 7:02:291 hr 5 mins ago0x37f3a858c8af36cf84fca69921fc511a98d5c2ee IN  0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH0.00007634
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30xbf6a0418e31f90b60ae3d19c56a659ad8b2f4d180 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xa481384653c484901b301634086c8625e550bbec 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30xbf6a0418e31f90b60ae3d19c56a659ad8b2f4d180 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30xbf6a0418e31f90b60ae3d19c56a659ad8b2f4d180 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30xbf6a0418e31f90b60ae3d19c56a659ad8b2f4d180 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xa481384653c484901b301634086c8625e550bbec 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0x113a8c6885aaa734b54ce3eba2799c5417018b5c4297cd840252461e6ca70821590415192023-02-08 8:04:393 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xed10e067c1544e240b13e789b4124b3a9e2ed6e80 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0x91216c4468841f811fec421d32d84550d4986a909c1ccd16d107d710adccf0bb590414612023-02-08 8:04:233 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xed10e067c1544e240b13e789b4124b3a9e2ed6e80 ETH
0xa4c25a8a60e233cbcf3fdbcfd2ce9a3927c11c730c68b4e5925f78548f888b2c590408202023-02-08 8:01:466 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0xa4c25a8a60e233cbcf3fdbcfd2ce9a3927c11c730c68b4e5925f78548f888b2c590408202023-02-08 8:01:466 mins ago 0xa481384653c484901b301634086c8625e550bbec 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH
0xa4c25a8a60e233cbcf3fdbcfd2ce9a3927c11c730c68b4e5925f78548f888b2c590408202023-02-08 8:01:466 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xa481384653c484901b301634086c8625e550bbec0 ETH
0xa4c25a8a60e233cbcf3fdbcfd2ce9a3927c11c730c68b4e5925f78548f888b2c590408202023-02-08 8:01:466 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 0xed10e067c1544e240b13e789b4124b3a9e2ed6e80 ETH
0x6c38bb25fbca1bbb05585b0fac39b7ed2d6ac4c7d41df2d3f4e8cd5a1656d343590405222023-02-08 8:00:307 mins ago 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d3 OreoSwap: OREO Token0 ETH
0x6c38bb25fbca1bbb05585b0fac39b7ed2d6ac4c7d41df2d3f4e8cd5a1656d343590405222023-02-08 8:00:307 mins ago 0xa481384653c484901b301634086c8625e550bbec 0xfcb6e23a2d6a1c0901b5fcabd73f25eea48957d30 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OreoBooster

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 23 : OreoBooster.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";

import "../farm/interfaces/IMasterChef.sol";
import "../farm/interfaces/IMasterChefCallback.sol";
import "./interfaces/IOreoBoosterConfig.sol";
import "../periphery/interfaces/IWNativeRelayer.sol";
import "../interfaces/IWETH.sol";
import "../periphery/library/SafeToken.sol";

contract OreoBooster is Ownable, Pausable, ReentrancyGuard, AccessControl, IMasterChefCallback, IERC721Receiver {
  using SafeERC20 for IERC20;
  using SafeMath for uint256;

  uint256 private constant _NOT_ENTERED = 1;
  uint256 private constant _ENTERED = 2;

  bytes32 public constant GOVERNANCE_ROLE = keccak256("GOVERNANCE_ROLE");
  // keccak256(abi.encodePacked("I am an EOA"))
  bytes32 public constant SIGNATURE_HASH = 0x08367bb0e0d2abf304a79452b2b95f4dc75fda0fc6df55dca6e5ad183de10cf0;

  IMasterChef public masterChef;
  IOreoBoosterConfig public oreoboosterConfig;
  IERC20 public oreo;
  IWNativeRelayer public wNativeRelayer;
  address public wNative;

  struct UserInfo {
    uint256 accumBoostedReward;
    uint256 lastUserActionTime;
  }

  struct NFTStakingInfo {
    address nftAddress;
    uint256 nftTokenId;
  }

  mapping(address => mapping(address => UserInfo)) public userInfo;

  mapping(address => uint256) public totalAccumBoostedReward;
  mapping(address => mapping(address => NFTStakingInfo)) public userStakingNFT;

  uint256 public _IN_EXEC_LOCK;

  event StakeNFT(address indexed staker, address indexed stakeToken, address nftAddress, uint256 nftTokenId);
  event UnstakeNFT(address indexed staker, address indexed stakeToken, address nftAddress, uint256 nftTokenId);
  event Stake(address indexed staker, IERC20 indexed stakeToken, uint256 amount);
  event Unstake(address indexed unstaker, IERC20 indexed stakeToken, uint256 amount);
  event Harvest(address indexed harvester, IERC20 indexed stakeToken, uint256 amount);
  event EmergencyWithdraw(address indexed caller, IERC20 indexed stakeToken, uint256 amount);
  event MasterChefCall(
    address indexed user,
    uint256 extraReward,
    address stakeToken,
    uint256 prevEnergy,
    uint256 currentEnergy
  );
  event Pause();
  event Unpause();

  constructor(
    IERC20 _oreo,
    IMasterChef _masterChef,
    IOreoBoosterConfig _oreoboosterConfig,
    IWNativeRelayer _wNativeRelayer,
    address _wNative
  ) public {
    require(_wNative != address(0), "OreoBooster::constructor:: _wNative cannot be address(0)");
    require(address(_oreo) != address(0), "OreoNFTOffering::constructor:: _oreo cannot be address(0)");
    require(address(_masterChef) != address(0), "OreoNFTOffering::constructor:: _masterChef cannot be address(0)");
    require(
      address(_oreoboosterConfig) != address(0),
      "OreoNFTOffering::constructor:: _oreoboosterConfig cannot be address(0)"
    );
    require(
      address(_wNativeRelayer) != address(0),
      "OreoNFTOffering::constructor:: _wNativeRelayer cannot be address(0)"
    );

    _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    _setupRole(GOVERNANCE_ROLE, _msgSender());

    masterChef = _masterChef;
    oreoboosterConfig = _oreoboosterConfig;
    oreo = _oreo;
    wNativeRelayer = _wNativeRelayer;
    wNative = _wNative;

    _IN_EXEC_LOCK = _NOT_ENTERED;
  }

  /// @dev Ensure that the function is called with the execution scope
  modifier inExec() {
    require(_IN_EXEC_LOCK == _NOT_ENTERED, "OreoBooster::inExec:: in exec lock");
    require(address(masterChef) == _msgSender(), "OreoBooster::inExec:: not from the master chef");
    _IN_EXEC_LOCK = _ENTERED;
    _;
    _IN_EXEC_LOCK = _NOT_ENTERED;
  }

  /// @dev validate whether a specified stake token is allowed
  modifier isStakeTokenOK(address _stakeToken) {
    require(oreoboosterConfig.stakeTokenAllowance(_stakeToken), "OreoBooster::isStakeTokenOK::bad stake token");
    _;
  }

  /// @dev validate whether a specified nft can be staked into a particular staoke token
  modifier isOreoBoosterNftOK(
    address _stakeToken,
    address _nftAddress,
    uint256 _nftTokenId
  ) {
    require(
      oreoboosterConfig.oreoboosterNftAllowance(_stakeToken, _nftAddress, _nftTokenId),
      "OreoBooster::isOreoBoosterNftOK::bad nft"
    );
    _;
  }

  modifier permit(bytes calldata _sig) {
    address recoveredAddress = ECDSA.recover(ECDSA.toEthSignedMessageHash(SIGNATURE_HASH), _sig);
    require(recoveredAddress == _msgSender(), "OreoBooster::permit::INVALID_SIGNATURE");
    _;
  }

  modifier onlyGovernance() {
    require(hasRole(GOVERNANCE_ROLE, _msgSender()), "OreoBooster::onlyGovernance::only GOVERNANCE role");
    _;
  }

  /// @dev Require that the caller must be an EOA account to avoid flash loans.
  modifier onlyEOA() {
    require(msg.sender == tx.origin, "OreoBooster::onlyEOA:: not eoa");
    _;
  }

  /**
   * @notice Triggers stopped state
   * @dev Only possible when contract not paused.
   */
  function pause() external onlyGovernance whenNotPaused {
    _pause();
    emit Pause();
  }

  /**
   * @notice Returns to normal state
   * @dev Only possible when contract is paused.
   */
  function unpause() external onlyGovernance whenPaused {
    _unpause();
    emit Unpause();
  }

  /// @dev View function to see pending booster OREOs on frontend.
  function pendingBoosterOreo(address _stakeToken, address _user) external view returns (uint256) {
    uint256 pendingOreo = masterChef.pendingOreo(_stakeToken, _user);
    NFTStakingInfo memory stakingNFT = userStakingNFT[_stakeToken][_user];
    if (stakingNFT.nftAddress == address(0)) {
      return 0;
    }
    (, , uint256 boostBps) = oreoboosterConfig.energyInfo(stakingNFT.nftAddress, stakingNFT.nftTokenId);
    // if (currentEnergy == 0) {
    //   return 0;
    // }
    return pendingOreo.mul(boostBps).div(1e4);
    // return Math.min(currentEnergy, pendingOreo.mul(boostBps).div(1e4));
  }

  /// @dev Internal function for withdraoreo a boosted stake token and receive a reward from a master chef
  /// @param _stakeToken specified stake token
  /// @param _shares user's shares to be withdrawn
  function _withdrawFromMasterChef(IERC20 _stakeToken, uint256 _shares) internal {
    if (_shares == 0) return;
    if (address(_stakeToken) == address(oreo)) {
      masterChef.withdrawOreo(_msgSender(), _shares);
    } else {
      masterChef.withdraw(_msgSender(), address(_stakeToken), _shares);
    }
  }

  /// @dev Internal function for harvest a reward from a master chef
  /// @param _stakeToken specified stake token
  function _harvestFromMasterChef(address user, IERC20 _stakeToken) internal {
    (uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), user);
    if (userStakeAmount == 0) {
      emit Harvest(user, _stakeToken, 0);
      return;
    }
    uint256 beforeReward = oreo.balanceOf(user);
    masterChef.harvest(user, address(_stakeToken));

    emit Harvest(user, _stakeToken, oreo.balanceOf(user).sub(beforeReward));
  }

  /// @notice function for staking a new nft
  /// @dev This one is a preparation for nft staking info, if nft address and nft token id are the same with existing record, it will be reverted
  /// @param _stakeToken a specified stake token address
  /// @param _nftAddress composite key for nft
  /// @param _nftTokenId composite key for nft
  function stakeNFT(
    address _stakeToken,
    address _nftAddress,
    uint256 _nftTokenId
  )
    external
    whenNotPaused
    isStakeTokenOK(_stakeToken)
    isOreoBoosterNftOK(_stakeToken, _nftAddress, _nftTokenId)
    nonReentrant
    onlyEOA
  {
    _stakeNFT(_stakeToken, _nftAddress, _nftTokenId);
  }

  /// @dev avoid stack-too-deep by branching the function
  function _stakeNFT(
    address _stakeToken,
    address _nftAddress,
    uint256 _nftTokenId
  ) internal {
    NFTStakingInfo memory toBeSentBackNft = userStakingNFT[_stakeToken][_msgSender()];
    require(
      toBeSentBackNft.nftAddress != _nftAddress || toBeSentBackNft.nftTokenId != _nftTokenId,
      "OreoBooster::stakeNFT:: nft already staked"
    );
    _harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));

    userStakingNFT[_stakeToken][_msgSender()] = NFTStakingInfo({ nftAddress: _nftAddress, nftTokenId: _nftTokenId });

    IERC721(_nftAddress).safeTransferFrom(_msgSender(), address(this), _nftTokenId);

    if (toBeSentBackNft.nftAddress != address(0)) {
      IERC721(toBeSentBackNft.nftAddress).safeTransferFrom(address(this), _msgSender(), toBeSentBackNft.nftTokenId);
    }
    emit StakeNFT(_msgSender(), _stakeToken, _nftAddress, _nftTokenId);
  }

  /// @notice function for unstaking a current nft
  /// @dev This one is a preparation for nft staking info, if nft address and nft token id are the same with existing record, it will be reverted
  /// @param _stakeToken a specified stake token address
  function unstakeNFT(address _stakeToken) external isStakeTokenOK(_stakeToken) nonReentrant onlyEOA {
    _unstakeNFT(_stakeToken);
  }

  /// @dev avoid stack-too-deep by branching the function
  function _unstakeNFT(address _stakeToken) internal {
    NFTStakingInfo memory toBeSentBackNft = userStakingNFT[_stakeToken][_msgSender()];
    require(toBeSentBackNft.nftAddress != address(0), "OreoBooster::stakeNFT:: no nft staked");

    _harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));

    userStakingNFT[_stakeToken][_msgSender()] = NFTStakingInfo({ nftAddress: address(0), nftTokenId: 0 });

    IERC721(toBeSentBackNft.nftAddress).safeTransferFrom(address(this), _msgSender(), toBeSentBackNft.nftTokenId);

    emit UnstakeNFT(_msgSender(), _stakeToken, toBeSentBackNft.nftAddress, toBeSentBackNft.nftTokenId);
  }

  /// @notice for staking a stakeToken and receive some rewards
  /// @param _stakeToken a specified stake token to be staked
  /// @param _amount amount to stake
  function stake(IERC20 _stakeToken, uint256 _amount)
    external
    payable
    whenNotPaused
    isStakeTokenOK(address(_stakeToken))
    nonReentrant
  {
    require(_amount > 0, "OreoBooster::stake::nothing to stake");

    UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];

    _harvestFromMasterChef(_msgSender(), _stakeToken);
    user.lastUserActionTime = block.timestamp;
    _stakeToken.safeApprove(address(masterChef), _amount);
    _safeWrap(_stakeToken, _amount);

    if (address(_stakeToken) == address(oreo)) {
      masterChef.depositOreo(_msgSender(), _amount);
    } else {
      masterChef.deposit(_msgSender(), address(_stakeToken), _amount);
    }

    _stakeToken.safeApprove(address(masterChef), 0);

    emit Stake(_msgSender(), _stakeToken, _amount);
  }

  /// @dev internal function for unstaking a stakeToken and receive some rewards
  /// @param _stakeToken a specified stake token to be unstaked
  /// @param _amount amount to stake
  function _unstake(IERC20 _stakeToken, uint256 _amount) internal {
    require(_amount > 0, "OreoBooster::_unstake::use harvest instead");

    UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];

    _withdrawFromMasterChef(_stakeToken, _amount);

    user.lastUserActionTime = block.timestamp;
    _safeUnwrap(_stakeToken, _msgSender(), _amount);

    emit Unstake(_msgSender(), _stakeToken, _amount);
  }

  /// @dev function for unstaking a stakeToken and receive some rewards
  /// @param _stakeToken a specified stake token to be unstaked
  /// @param _amount amount to stake
  function unstake(address _stakeToken, uint256 _amount) external isStakeTokenOK(_stakeToken) nonReentrant {
    _unstake(IERC20(_stakeToken), _amount);
  }

  /// @notice function for unstaking all portion of stakeToken and receive some rewards
  /// @dev similar to unstake with user's shares
  /// @param _stakeToken a specified stake token to be unstaked
  function unstakeAll(address _stakeToken) external isStakeTokenOK(_stakeToken) nonReentrant {
    (uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), _msgSender());
    _unstake(IERC20(_stakeToken), userStakeAmount);
  }

  /// @notice function for harvesting the reward
  /// @param _stakeToken a specified stake token to be harvested
  function harvest(address _stakeToken) external whenNotPaused isStakeTokenOK(_stakeToken) nonReentrant {
    _harvestFromMasterChef(_msgSender(), IERC20(_stakeToken));
  }

  /// @notice function for harvesting rewards in specified staking tokens
  /// @param _stakeTokens specified stake tokens to be harvested
  function harvest(address[] calldata _stakeTokens) external whenNotPaused nonReentrant {
    for (uint256 i = 0; i < _stakeTokens.length; i++) {
      require(oreoboosterConfig.stakeTokenAllowance(_stakeTokens[i]), "OreoBooster::harvest::bad stake token");
      _harvestFromMasterChef(_msgSender(), IERC20(_stakeTokens[i]));
    }
  }

  /// @dev a notifier function for letting some observer call when some conditions met
  /// @dev currently, the caller will be a master chef calling before a oreo lock
  function masterChefCall(
    address stakeToken,
    address userAddr,
    uint256 unboostedReward
  ) external override inExec {
    NFTStakingInfo memory stakingNFT = userStakingNFT[stakeToken][userAddr];
    UserInfo storage user = userInfo[stakeToken][userAddr];
    if (stakingNFT.nftAddress == address(0)) {
      return;
    }
    (, uint256 currentEnergy, uint256 boostBps) = oreoboosterConfig.energyInfo(
      stakingNFT.nftAddress,
      stakingNFT.nftTokenId
    );
    // if (currentEnergy == 0) {
    //   return;
    // }
    uint256 extraReward = unboostedReward.mul(boostBps).div(1e4);
    totalAccumBoostedReward[stakeToken] = totalAccumBoostedReward[stakeToken].add(extraReward);
    user.accumBoostedReward = user.accumBoostedReward.add(extraReward);
    uint256 newEnergy = 0;
    masterChef.mintExtraReward(stakeToken, userAddr, extraReward);
    // oreoboosterConfig.consumeEnergy(stakingNFT.nftAddress, stakingNFT.nftTokenId, extraReward);

    emit MasterChefCall(userAddr, extraReward, stakeToken, currentEnergy, newEnergy);
  }

  function _safeWrap(IERC20 _quoteBep20, uint256 _amount) internal {
    if (msg.value != 0) {
      require(address(_quoteBep20) == wNative, "OreoBooster::_safeWrap:: baseToken is not wNative");
      require(_amount == msg.value, "OreoBooster::_safeWrap:: value != msg.value");
      IWETH(wNative).deposit{ value: msg.value }();
      return;
    }
    _quoteBep20.safeTransferFrom(_msgSender(), address(this), _amount);
  }

  function _safeUnwrap(
    IERC20 _quoteBep20,
    address _to,
    uint256 _amount
  ) internal {
    if (address(_quoteBep20) == wNative) {
      _quoteBep20.safeTransfer(address(wNativeRelayer), _amount);
      wNativeRelayer.withdraw(_amount);
      SafeToken.safeTransferETH(_to, _amount);
      return;
    }
    _quoteBep20.safeTransfer(_to, _amount);
  }

  /**
   * @notice Withdraws a stake token from MasterChef back to the user considerless the rewards.
   * @dev EMERGENCY ONLY
   */
  function emergencyWithdraw(IERC20 _stakeToken) external isStakeTokenOK(address(_stakeToken)) {
    UserInfo storage user = userInfo[address(_stakeToken)][_msgSender()];
    (uint256 userStakeAmount, , ) = masterChef.userInfo(address(_stakeToken), _msgSender());

    user.lastUserActionTime = block.timestamp;
    masterChef.emergencyWithdraw(_msgSender(), address(_stakeToken));

    emit EmergencyWithdraw(_msgSender(), _stakeToken, userStakeAmount);
  }

  /// @dev when doing a safeTransferFrom, the caller needs to implement this, for safety reason
  function onERC721Received(
    address, /*operator*/
    address, /*from*/
    uint256, /*tokenId*/
    bytes calldata /*data*/
  ) external override returns (bytes4) {
    return IERC721Receiver.onERC721Received.selector;
  }

  /// @dev Fallback function to accept ETH. Workers will send ETH back the pool.
  receive() external payable {}
}

File 2 of 23 : 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;
    }
}

File 3 of 23 : 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 4 of 23 : 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 5 of 23 : 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 6 of 23 : 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 7 of 23 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

File 8 of 23 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 9 of 23 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

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

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

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

        _revokeRole(role, account);
    }

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

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

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 10 of 23 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
      * - `from` cannot be the zero address.
      * - `to` cannot be the zero address.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

File 11 of 23 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

File 13 of 23 : IMasterChef.sol
// SPDX-License-Identifier: GPL-3.0

import "./IOREO.sol";

pragma solidity 0.6.12;

interface IMasterChef {
  /// @dev functions return information. no states changed.
  function poolLength() external view returns (uint256);

  function pendingOreo(address _stakeToken, address _user) external view returns (uint256);

  function userInfo(address _stakeToken, address _user)
    external
    view
    returns (
      uint256,
      uint256,
      address
    );

  function poolInfo(address _stakeToken)
    external
    view
    returns (
      uint256,
      uint256,
      uint256,
      uint256
    );

  function devAddr() external view returns (address);

  function refAddr() external view returns (address);

  function bonusMultiplier() external view returns (uint256);

  function totalAllocPoint() external view returns (uint256);

  function oreoPerBlock() external view returns (uint256);

  /// @dev configuration functions
  function addPool(
    address _stakeToken,
    uint256 _allocPoint,
    uint256 _depositFee
  ) external;

  function setPool(
    address _stakeToken,
    uint256 _allocPoint,
    uint256 _depositFee
  ) external;

  function updatePool(address _stakeToken) external;

  function removePool(address _stakeToken) external;

  /// @dev user interaction functions
  function deposit(
    address _for,
    address _stakeToken,
    uint256 _amount
  ) external;

  function withdraw(
    address _for,
    address _stakeToken,
    uint256 _amount
  ) external;

  function depositOreo(address _for, uint256 _amount) external;

  function withdrawOreo(address _for, uint256 _amount) external;

  function harvest(address _for, address _stakeToken) external;

  function harvest(address _for, address[] calldata _stakeToken) external;

  function emergencyWithdraw(address _for, address _stakeToken) external;

  function mintExtraReward(
    address _stakeToken,
    address _to,
    uint256 _amount
  ) external;

  function oreo() external returns (IOREO);
}

File 14 of 23 : IMasterChefCallback.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IMasterChefCallback {
  function masterChefCall(
    address stakeToken,
    address userAddr,
    uint256 unboostedReward
  ) external;
}

File 15 of 23 : IOreoBoosterConfig.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.12;

pragma experimental ABIEncoderV2;

interface IOreoBoosterConfig {
  // getter

  function energyInfo(address nftAddress, uint256 nftTokenId)
    external
    view
    returns (
      uint256 maxEnergy,
      uint256 currentEnergy,
      uint256 boostBps
    );

  function oreoboosterNftAllowance(
    address stakingToken,
    address nftAddress,
    uint256 nftTokenId
  ) external view returns (bool);

  function stakeTokenAllowance(address stakingToken) external view returns (bool);

  function callerAllowance(address caller) external view returns (bool);

  // external

  function consumeEnergy(
    address nftAddress,
    uint256 nftTokenId,
    uint256 energyToBeConsumed
  ) external;
}

File 16 of 23 : IWNativeRelayer.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IWNativeRelayer {
  function withdraw(uint256 _amount) external;
}

File 17 of 23 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.5.0;

interface IWETH {
  function deposit() external payable;

  function transfer(address to, uint256 value) external returns (bool);

  function withdraw(uint256) external;
}

File 18 of 23 : SafeToken.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface ERC20Interface {
  function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
  function myBalance(address token) internal view returns (uint256) {
    return ERC20Interface(token).balanceOf(address(this));
  }

  function balanceOf(address token, address user) internal view returns (uint256) {
    return ERC20Interface(token).balanceOf(user);
  }

  function safeApprove(
    address token,
    address to,
    uint256 value
  ) internal {
    // bytes4(keccak256(bytes('approve(address,uint256)')));
    (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
    require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
  }

  function safeTransfer(
    address token,
    address to,
    uint256 value
  ) internal {
    // bytes4(keccak256(bytes('transfer(address,uint256)')));
    (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
    require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransfer");
  }

  function safeTransferFrom(
    address token,
    address from,
    address to,
    uint256 value
  ) internal {
    // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
    (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
    require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransferFrom");
  }

  function safeTransferETH(address to, uint256 value) internal {
    // solhint-disable-next-line no-call-value
    (bool success, ) = to.call{ value: value }(new bytes(0));
    require(success, "!safeTransferETH");
  }
}

File 19 of 23 : 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 20 of 23 : 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 21 of 23 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 22 of 23 : 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 23 of 23 : IOREO.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.12;

interface IOREO {
  // OREO specific functions
  function lock(address _account, uint256 _amount) external;

  function lockOf(address _account) external view returns (uint256);

  function unlock() external;

  function mint(address _to, uint256 _amount) external;

  // Generic BEP20 functions
  function totalSupply() external view returns (uint256);

  function balanceOf(address account) external view returns (uint256);

  function transfer(address recipient, uint256 amount) external returns (bool);

  function allowance(address owner, address spender) external view returns (uint256);

  function approve(address spender, uint256 amount) external returns (bool);

  function transferFrom(
    address sender,
    address recipient,
    uint256 amount
  ) external returns (bool);

  // Getter functions
  function startReleaseBlock() external view returns (uint256);

  function endReleaseBlock() external view returns (uint256);

  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_oreo","type":"address"},{"internalType":"contract IMasterChef","name":"_masterChef","type":"address"},{"internalType":"contract IOreoBoosterConfig","name":"_oreoboosterConfig","type":"address"},{"internalType":"contract IWNativeRelayer","name":"_wNativeRelayer","type":"address"},{"internalType":"address","name":"_wNative","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"harvester","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"extraReward","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"prevEnergy","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentEnergy","type":"uint256"}],"name":"MasterChefCall","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":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"StakeNFT","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","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":"unstaker","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":false,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"UnstakeNFT","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNANCE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNATURE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_IN_EXEC_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_stakeToken","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_stakeTokens","type":"address[]"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterChef","outputs":[{"internalType":"contract IMasterChef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakeToken","type":"address"},{"internalType":"address","name":"userAddr","type":"address"},{"internalType":"uint256","name":"unboostedReward","type":"uint256"}],"name":"masterChefCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oreo","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oreoboosterConfig","outputs":[{"internalType":"contract IOreoBoosterConfig","name":"","type":"address"}],"stateMutability":"view","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":"_stakeToken","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingBoosterOreo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_stakeToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_nftTokenId","type":"uint256"}],"name":"stakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalAccumBoostedReward","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":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"unstakeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"unstakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"accumBoostedReward","type":"uint256"},{"internalType":"uint256","name":"lastUserActionTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userStakingNFT","outputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wNative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wNativeRelayer","outputs":[{"internalType":"contract IWNativeRelayer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b50604051620043db380380620043db833981810160405260a08110156200003757600080fd5b50805160208201516040830151606084015160809094015192939192909190600062000062620002cf565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19169055600180556001600160a01b038116620001045760405162461bcd60e51b81526004018080602001828103825260388152602001806200431a6038913960400191505060405180910390fd5b6001600160a01b0385166200014b5760405162461bcd60e51b8152600401808060200182810382526039815260200180620042e16039913960400191505060405180910390fd5b6001600160a01b038416620001925760405162461bcd60e51b815260040180806020018281038252603f815260200180620042a2603f913960400191505060405180910390fd5b6001600160a01b038316620001d95760405162461bcd60e51b8152600401808060200182810382526046815260200180620043956046913960600191505060405180910390fd5b6001600160a01b038216620002205760405162461bcd60e51b8152600401808060200182810382526043815260200180620043526043913960600191505060405180910390fd5b62000236600062000230620002cf565b620002d3565b620002657f71840dc4906352362b0cdaf79870196c8e42acafade72d5d5a6d59291253ceb162000230620002cf565b600380546001600160a01b03199081166001600160a01b0396871617909155600480548216948616949094179093556005805484169585169590951790945560068054831691841691909117905560078054909116929091169190911790556001600b55620003e5565b3390565b620002df8282620002e3565b5050565b60008281526002602090815260409091206200030a918390620024646200035e821b17901c565b15620002df576200031a620002cf565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000375836001600160a01b0384166200037e565b90505b92915050565b60006200038c8383620003cd565b620003c45750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000378565b50600062000378565b60009081526001919091016020526040902054151590565b613ead80620003f56000396000f3fe6080604052600436106102135760003560e01c80638a3fdeff11610118578063bb623d13116100a0578063ca15c8731161006f578063ca15c87314610872578063d13a35e61461089c578063d547741f146108b1578063f2fde38b146108ea578063f36c8f5c1461091d5761021a565b8063bb623d1314610764578063c2a672e0146107a7578063c89d3460146107e0578063c9a4bb3f1461085d5761021a565b8063a0d6ff9a116100e7578063a0d6ff9a14610682578063a217fddf146106b5578063a2666b9d146106ca578063a97bacff14610705578063adc9772e146107385761021a565b80638a3fdeff146105ef5780638da5cb5b146106045780639010d07c1461061957806391d14854146106495761021a565b806354f0c5aa1161019b5780636978a7ea1161016a5780636978a7ea1461054a5780636ff1c9bc1461057d578063715018a6146105b057806383862796146105c55780638456cb59146105da5761021a565b806354f0c5aa146104b4578063575a86b2146104f75780635c975abb1461050c5780636475d583146105355761021a565b8063248a9ca3116101e2578063248a9ca3146103c05780632d68efc9146103fc5780632f2ff15d1461042d57806336568abe146104665780633f4ba83a1461049f5761021a565b80630e5c011e1461021f5780630f208beb146102545780631288f86d146102a8578063150b7a02146103065761021a565b3661021a57005b600080fd5b34801561022b57600080fd5b506102526004803603602081101561024257600080fd5b50356001600160a01b0316610932565b005b34801561026057600080fd5b5061028f6004803603604081101561027757600080fd5b506001600160a01b0381358116916020013516610aad565b6040805192835260208301919091528051918290030190f35b3480156102b457600080fd5b506102e3600480360360408110156102cb57600080fd5b506001600160a01b0381358116916020013516610ad1565b604080516001600160a01b03909316835260208301919091528051918290030190f35b34801561031257600080fd5b506103a36004803603608081101561032957600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561036457600080fd5b82018360208201111561037657600080fd5b8035906020019184600183028401116401000000008311171561039857600080fd5b509092509050610b01565b604080516001600160e01b03199092168252519081900360200190f35b3480156103cc57600080fd5b506103ea600480360360208110156103e357600080fd5b5035610b12565b60408051918252519081900360200190f35b34801561040857600080fd5b50610411610b28565b604080516001600160a01b039092168252519081900360200190f35b34801561043957600080fd5b506102526004803603604081101561045057600080fd5b50803590602001356001600160a01b0316610b37565b34801561047257600080fd5b506102526004803603604081101561048957600080fd5b50803590602001356001600160a01b0316610ba4565b3480156104ab57600080fd5b50610252610c05565b3480156104c057600080fd5b50610252600480360360608110156104d757600080fd5b506001600160a01b03813581169160208101359091169060400135610cef565b34801561050357600080fd5b50610411610fe7565b34801561051857600080fd5b50610521610ff6565b604080519115158252519081900360200190f35b34801561054157600080fd5b50610411611006565b34801561055657600080fd5b506102526004803603602081101561056d57600080fd5b50356001600160a01b0316611015565b34801561058957600080fd5b50610252600480360360208110156105a057600080fd5b50356001600160a01b0316611187565b3480156105bc57600080fd5b50610252611401565b3480156105d157600080fd5b506104116114bf565b3480156105e657600080fd5b506102526114ce565b3480156105fb57600080fd5b506103ea6115b5565b34801561061057600080fd5b506104116115d9565b34801561062557600080fd5b506104116004803603604081101561063c57600080fd5b50803590602001356115e8565b34801561065557600080fd5b506105216004803603604081101561066c57600080fd5b50803590602001356001600160a01b0316611609565b34801561068e57600080fd5b50610252600480360360208110156106a557600080fd5b50356001600160a01b0316611621565b3480156106c157600080fd5b506103ea6117e1565b3480156106d657600080fd5b506103ea600480360360408110156106ed57600080fd5b506001600160a01b03813581169160200135166117e6565b34801561071157600080fd5b506103ea6004803603602081101561072857600080fd5b50356001600160a01b0316611984565b6102526004803603604081101561074e57600080fd5b506001600160a01b038135169060200135611996565b34801561077057600080fd5b506102526004803603606081101561078757600080fd5b506001600160a01b03813581169160208101359091169060400135611d46565b3480156107b357600080fd5b50610252600480360360408110156107ca57600080fd5b506001600160a01b038135169060200135611fdf565b3480156107ec57600080fd5b506102526004803603602081101561080357600080fd5b81019060208101813564010000000081111561081e57600080fd5b82018360208201111561083057600080fd5b8035906020019184602083028401116401000000008311171561085257600080fd5b5090925090506120fe565b34801561086957600080fd5b506103ea6122a6565b34801561087e57600080fd5b506103ea6004803603602081101561089557600080fd5b50356122ac565b3480156108a857600080fd5b506104116122c3565b3480156108bd57600080fd5b50610252600480360360408110156108d457600080fd5b50803590602001356001600160a01b03166122d2565b3480156108f657600080fd5b506102526004803603602081101561090d57600080fd5b50356001600160a01b031661232c565b34801561092957600080fd5b506103ea612440565b61093a610ff6565b1561097f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b80600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156109e257600080fd5b505afa1580156109f6573d6000803e3d6000fd5b505050506040513d6020811015610a0c57600080fd5b5051610a495760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b60026001541415610a8f576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b6002600155610aa5610a9f612479565b8361247d565b505060018055565b60086020908152600092835260408084209091529082529020805460019091015482565b600a602090815260009283526040808420909152908252902080546001909101546001600160a01b039091169082565b630a85bd0160e11b95945050505050565b6000908152600260208190526040909120015490565b6007546001600160a01b031681565b60008281526002602081905260409091200154610b5b90610b56612479565b611609565b610b965760405162461bcd60e51b815260040180806020018281038252602f815260200180613b0a602f913960400191505060405180910390fd5b610ba0828261272c565b5050565b610bac612479565b6001600160a01b0316816001600160a01b031614610bfb5760405162461bcd60e51b815260040180806020018281038252602f815260200180613e49602f913960400191505060405180910390fd5b610ba08282612795565b610c317f71840dc4906352362b0cdaf79870196c8e42acafade72d5d5a6d59291253ceb1610b56612479565b610c6c5760405162461bcd60e51b8152600401808060200182810382526031815260200180613bfd6031913960400191505060405180910390fd5b610c74610ff6565b610cbc576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b610cc46127fe565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6001600b5414610d305760405162461bcd60e51b8152600401808060200182810382526022815260200180613cb56022913960400191505060405180910390fd5b610d38612479565b6003546001600160a01b03908116911614610d845760405162461bcd60e51b815260040180806020018281038252602e815260200180613bcf602e913960400191505060405180910390fd5b6002600b55610d91613ad0565b506001600160a01b038084166000818152600a60209081526040808320878616808552908352818420825180840184528154881681526001909101548185015294845260088352818420908452909152902081519192909116610df5575050610fdd565b600080600460009054906101000a90046001600160a01b03166001600160a01b031663a173510c856000015186602001516040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060606040518083038186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6060811015610e9457600080fd5b50602081015160409091015190925090506000610ebd612710610eb788856128a1565b906128fa565b6001600160a01b038916600090815260096020526040902054909150610ee39082612961565b6001600160a01b0389166000908152600960205260409020558354610f089082612961565b84556003546040805163259b96eb60e11b81526001600160a01b038b811660048301528a811660248301526044820185905291516000939290921691634b372dd691606480820192869290919082900301818387803b158015610f6a57600080fd5b505af1158015610f7e573d6000803e3d6000fd5b5050604080518581526001600160a01b038d81166020830152818301899052606082018690529151918c1693507fd7e3f58ec4c0d19a3d235d47ecb087d7f364052eda1b689fd04b1c536491da74925081900360800190a25050505050505b50506001600b5550565b6003546001600160a01b031681565b600054600160a01b900460ff1690565b6005546001600160a01b031681565b80600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561107857600080fd5b505afa15801561108c573d6000803e3d6000fd5b505050506040513d60208110156110a257600080fd5b50516110df5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b60026001541415611125576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b600260015533321461117e576040805162461bcd60e51b815260206004820152601e60248201527f4f72656f426f6f737465723a3a6f6e6c79454f413a3a206e6f7420656f610000604482015290519081900360640190fd5b610aa5826129bb565b80600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156111ea57600080fd5b505afa1580156111fe573d6000803e3d6000fd5b505050506040513d602081101561121457600080fd5b50516112515760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b6001600160a01b038216600090815260086020526040812081611272612479565b6001600160a01b03908116825260208201929092526040016000908120600354909350909116630f208beb856112a6612479565b6040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060606040518083038186803b1580156112f357600080fd5b505afa158015611307573d6000803e3d6000fd5b505050506040513d606081101561131d57600080fd5b50514260018401556003549091506001600160a01b0316636382d9ad611341612479565b866040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561139157600080fd5b505af11580156113a5573d6000803e3d6000fd5b50505050836001600160a01b03166113bb612479565b6001600160a01b03167ff24ef89f38eadc1bde50701ad6e4d6d11a2dc24f7cf834a486991f3883328504836040518082815260200191505060405180910390a350505050565b611409612479565b6001600160a01b031661141a6115d9565b6001600160a01b031614611475576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6004546001600160a01b031681565b6114fa7f71840dc4906352362b0cdaf79870196c8e42acafade72d5d5a6d59291253ceb1610b56612479565b6115355760405162461bcd60e51b8152600401808060200182810382526031815260200180613bfd6031913960400191505060405180910390fd5b61153d610ff6565b15611582576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61158a612bcd565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b7f08367bb0e0d2abf304a79452b2b95f4dc75fda0fc6df55dca6e5ad183de10cf081565b6000546001600160a01b031690565b60008281526002602052604081206116009083612c56565b90505b92915050565b60008281526002602052604081206116009083612c62565b80600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561168457600080fd5b505afa158015611698573d6000803e3d6000fd5b505050506040513d60208110156116ae57600080fd5b50516116eb5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b60026001541415611731576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b60026001556003546000906001600160a01b0316630f208beb84611753612479565b6040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060606040518083038186803b1580156117a057600080fd5b505afa1580156117b4573d6000803e3d6000fd5b505050506040513d60608110156117ca57600080fd5b505190506117d88382612c77565b50506001805550565b600081565b600354604080516305ce7d7b60e41b81526001600160a01b0385811660048301528481166024830152915160009384931691635ce7d7b0916044808301926020929190829003018186803b15801561183d57600080fd5b505afa158015611851573d6000803e3d6000fd5b505050506040513d602081101561186757600080fd5b50519050611873613ad0565b506001600160a01b038085166000908152600a6020908152604080832087851684528252918290208251808401909352805490931680835260019093015490820152906118c557600092505050611603565b6000600460009054906101000a90046001600160a01b03166001600160a01b031663a173510c836000015184602001516040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060606040518083038186803b15801561193957600080fd5b505afa15801561194d573d6000803e3d6000fd5b505050506040513d606081101561196357600080fd5b5060400151905061197a612710610eb785846128a1565b9695505050505050565b60096020526000908152604090205481565b61199e610ff6565b156119e3576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b81600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611a4657600080fd5b505afa158015611a5a573d6000803e3d6000fd5b505050506040513d6020811015611a7057600080fd5b5051611aad5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b60026001541415611af3576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b600260015581611b345760405162461bcd60e51b8152600401808060200182810382526024815260200180613cf86024913960400191505060405180910390fd5b6001600160a01b038316600090815260086020526040812081611b55612479565b6001600160a01b03166001600160a01b031681526020019081526020016000209050611b88611b82612479565b8561247d565b426001820155600354611ba8906001600160a01b03868116911685612d72565b611bb28484612e8a565b6005546001600160a01b0385811691161415611c45576003546001600160a01b0316635813ded7611be1612479565b856040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611c2857600080fd5b505af1158015611c3c573d6000803e3d6000fd5b50505050611ccf565b6003546001600160a01b0316638340f549611c5e612479565b86866040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611cb657600080fd5b505af1158015611cca573d6000803e3d6000fd5b505050505b600354611cea906001600160a01b0386811691166000612d72565b836001600160a01b0316611cfc612479565b6001600160a01b03167f99039fcf0a98f484616c5196ee8b2ecfa971babf0b519848289ea4db381f85f7856040518082815260200191505060405180910390a35050600180555050565b611d4e610ff6565b15611d93576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b82600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611df657600080fd5b505afa158015611e0a573d6000803e3d6000fd5b505050506040513d6020811015611e2057600080fd5b5051611e5d5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b600480546040805163252b76e160e11b81526001600160a01b03808916948201949094528387166024820152604481018690529051879387938793911691634a56edc291606480820192602092909190829003018186803b158015611ec157600080fd5b505afa158015611ed5573d6000803e3d6000fd5b505050506040513d6020811015611eeb57600080fd5b5051611f285760405162461bcd60e51b8152600401808060200182810382526028815260200180613d486028913960400191505060405180910390fd5b60026001541415611f6e576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b6002600155333214611fc7576040805162461bcd60e51b815260206004820152601e60248201527f4f72656f426f6f737465723a3a6f6e6c79454f413a3a206e6f7420656f610000604482015290519081900360640190fd5b611fd2878787612fa5565b5050600180555050505050565b81600460009054906101000a90046001600160a01b03166001600160a01b03166304dcb746826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561204257600080fd5b505afa158015612056573d6000803e3d6000fd5b505050506040513d602081101561206c57600080fd5b50516120a95760405162461bcd60e51b815260040180806020018281038252602c815260200180613d1c602c913960400191505060405180910390fd5b600260015414156120ef576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b60026001556117d88383612c77565b612106610ff6565b1561214b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026001541415612191576040805162461bcd60e51b815260206004820152601f6024820152600080516020613b89833981519152604482015290519081900360640190fd5b600260015560005b818110156117d8576004546001600160a01b03166304dcb7468484848181106121be57fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561220b57600080fd5b505afa15801561221f573d6000803e3d6000fd5b505050506040513d602081101561223557600080fd5b50516122725760405162461bcd60e51b8152600401808060200182810382526025815260200180613d706025913960400191505060405180910390fd5b61229e61227d612479565b84848481811061228957fe5b905060200201356001600160a01b031661247d565b600101612199565b600b5481565b600081815260026020526040812061160390613263565b6006546001600160a01b031681565b600082815260026020819052604090912001546122f190610b56612479565b610bfb5760405162461bcd60e51b8152600401808060200182810382526030815260200180613c546030913960400191505060405180910390fd5b612334612479565b6001600160a01b03166123456115d9565b6001600160a01b0316146123a0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166123e55760405162461bcd60e51b8152600401808060200182810382526026815260200180613ba96026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f71840dc4906352362b0cdaf79870196c8e42acafade72d5d5a6d59291253ceb181565b6000611600836001600160a01b03841661326e565b3390565b60035460408051630f208beb60e01b81526001600160a01b038481166004830152858116602483015291516000939290921691630f208beb91604480820192606092909190829003018186803b1580156124d657600080fd5b505afa1580156124ea573d6000803e3d6000fd5b505050506040513d606081101561250057600080fd5b505190508061255b57816001600160a01b0316836001600160a01b03167fa0306f61d3fafe13787b78e276cb6b644382854a66cb46daae14227d3ec2679760006040518082815260200191505060405180910390a350610ba0565b600554604080516370a0823160e01b81526001600160a01b038681166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156125ac57600080fd5b505afa1580156125c0573d6000803e3d6000fd5b505050506040513d60208110156125d657600080fd5b5051600354604080516366cc185760e01b81526001600160a01b038881166004830152878116602483015291519394509116916366cc18579160448082019260009290919082900301818387803b15801561263057600080fd5b505af1158015612644573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b03167fa0306f61d3fafe13787b78e276cb6b644382854a66cb46daae14227d3ec2679761271584600560009054906101000a90046001600160a01b03166001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156126e357600080fd5b505afa1580156126f7573d6000803e3d6000fd5b505050506040513d602081101561270d57600080fd5b5051906132b8565b60408051918252519081900360200190a350505050565b60008281526002602052604090206127449082612464565b15610ba057612751612479565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526002602052604090206127ad9082613315565b15610ba0576127ba612479565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b612806610ff6565b61284e576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612884612479565b604080516001600160a01b039092168252519081900360200190a1565b6000826128b057506000611603565b828202828482816128bd57fe5b04146116005760405162461bcd60e51b8152600401808060200182810382526021815260200180613cd76021913960400191505060405180910390fd5b6000808211612950576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161295957fe5b049392505050565b600082820183811015611600576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6129c3613ad0565b6001600160a01b0382166000908152600a60205260408120906129e4612479565b6001600160a01b039081168252602080830193909352604091820160002082518084019093528054909116808352600190910154928201929092529150612a5c5760405162461bcd60e51b8152600401808060200182810382526025815260200180613b396025913960400191505060405180910390fd5b612a67610a9f612479565b604080518082018252600080825260208083018290526001600160a01b0386168252600a90529182209091612a9a612479565b6001600160a01b0390811682526020808301939093526040909101600020835181546001600160a01b03191690831617815592909101516001909201919091558151166342842e0e30612aeb612479565b84602001516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015612b4657600080fd5b505af1158015612b5a573d6000803e3d6000fd5b50505050816001600160a01b0316612b70612479565b6001600160a01b03167f3175a613ba875b0668807334a8febb316a3d07ddeeacfadc51d3c9f11ab04e878360000151846020015160405180836001600160a01b031681526020018281526020019250505060405180910390a35050565b612bd5610ff6565b15612c1a576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612884612479565b6000611600838361332a565b6000611600836001600160a01b03841661338e565b60008111612cb65760405162461bcd60e51b815260040180806020018281038252602a815260200180613de9602a913960400191505060405180910390fd5b6001600160a01b038216600090815260086020526040812081612cd7612479565b6001600160a01b03166001600160a01b031681526020019081526020016000209050612d0383836133a6565b426001820155612d1b83612d15612479565b846134d0565b826001600160a01b0316612d2d612479565b6001600160a01b03167f390b1276974b9463e5d66ab10df69b6f3d7b930eb066a0e66df327edd2cc811c846040518082815260200191505060405180910390a3505050565b801580612df8575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015612dca57600080fd5b505afa158015612dde573d6000803e3d6000fd5b505050506040513d6020811015612df457600080fd5b5051155b612e335760405162461bcd60e51b8152600401808060200182810382526036815260200180613e136036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052612e85908490613588565b505050565b3415612f88576007546001600160a01b03838116911614612edc5760405162461bcd60e51b8152600401808060200182810382526031815260200180613c846031913960400191505060405180910390fd5b348114612f1a5760405162461bcd60e51b815260040180806020018281038252602b815260200180613b5e602b913960400191505060405180910390fd5b600760009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015612f6a57600080fd5b505af1158015612f7e573d6000803e3d6000fd5b5050505050610ba0565b610ba0612f93612479565b6001600160a01b038416903084613639565b612fad613ad0565b6001600160a01b0384166000908152600a6020526040812090612fce612479565b6001600160a01b039081168252602080830193909352604091820160002082518084019093528054821680845260019091015493830193909352909250841614158061301e575081816020015114155b6130595760405162461bcd60e51b815260040180806020018281038252602a815260200180613d95602a913960400191505060405180910390fd5b613064611b82612479565b6040805180820182526001600160a01b03808616825260208083018690529087166000908152600a909152918220909161309c612479565b6001600160a01b0390811682526020808301939093526040909101600020835181546001600160a01b031916908316178155929091015160019092019190915583166342842e0e6130eb612479565b30856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561314357600080fd5b505af1158015613157573d6000803e3d6000fd5b505082516001600160a01b03161591506131fa90505780516001600160a01b03166342842e0e30613186612479565b84602001516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b1580156131e157600080fd5b505af11580156131f5573d6000803e3d6000fd5b505050505b836001600160a01b031661320c612479565b6001600160a01b03167fd67d4b97dc7c6e5fa998cb1b3082c6e978b70b682260065ffb3c6cf801f0163d858560405180836001600160a01b031681526020018281526020019250505060405180910390a350505050565b600061160382613699565b600061327a838361338e565b6132b057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611603565b506000611603565b60008282111561330f576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000611600836001600160a01b03841661369d565b8154600090821061336c5760405162461bcd60e51b8152600401808060200182810382526022815260200180613ae86022913960400191505060405180910390fd5b82600001828154811061337b57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b806133b057610ba0565b6005546001600160a01b0383811691161415613443576003546001600160a01b031663b0018f7c6133df612479565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561342657600080fd5b505af115801561343a573d6000803e3d6000fd5b50505050610ba0565b6003546001600160a01b031663d9caed1261345c612479565b84846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b1580156134b457600080fd5b505af11580156134c8573d6000803e3d6000fd5b505050505050565b6007546001600160a01b038481169116141561357457600654613500906001600160a01b03858116911683613763565b60065460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b15801561354d57600080fd5b505af1158015613561573d6000803e3d6000fd5b5050505061356f82826137b5565b612e85565b612e856001600160a01b0384168383613763565b60606135dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138b19092919063ffffffff16565b805190915015612e85578080602001905160208110156135fc57600080fd5b5051612e855760405162461bcd60e51b815260040180806020018281038252602a815260200180613dbf602a913960400191505060405180910390fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052613693908590613588565b50505050565b5490565b6000818152600183016020526040812054801561375957835460001980830191908101906000908790839081106136d057fe5b90600052602060002001549050808760000184815481106136ed57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061371d57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611603565b6000915050611603565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612e85908490613588565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106138015780518252601f1990920191602091820191016137e2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613863576040519150601f19603f3d011682016040523d82523d6000602084013e613868565b606091505b5050905080612e85576040805162461bcd60e51b815260206004820152601060248201526f042e6c2cccaa8e4c2dce6cccae48aa8960831b604482015290519081900360640190fd5b60606138c084846000856138ca565b90505b9392505050565b60608247101561390b5760405162461bcd60e51b8152600401808060200182810382526026815260200180613c2e6026913960400191505060405180910390fd5b61391485613a26565b613965576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106139a45780518252601f199092019160209182019101613985565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a06576040519150601f19603f3d011682016040523d82523d6000602084013e613a0b565b606091505b5091509150613a1b828286613a2c565b979650505050505050565b3b151590565b60608315613a3b5750816138c3565b825115613a4b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613a95578181015183820152602001613a7d565b50505050905090810190601f168015613ac25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60408051808201909152600080825260208201529056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e744f72656f426f6f737465723a3a7374616b654e46543a3a206e6f206e6674207374616b65644f72656f426f6f737465723a3a5f73616665577261703a3a2076616c756520213d206d73672e76616c75655265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f72656f426f6f737465723a3a696e457865633a3a206e6f742066726f6d20746865206d617374657220636865664f72656f426f6f737465723a3a6f6e6c79476f7665726e616e63653a3a6f6e6c7920474f5645524e414e434520726f6c65416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654f72656f426f6f737465723a3a5f73616665577261703a3a2062617365546f6b656e206973206e6f7420774e61746976654f72656f426f6f737465723a3a696e457865633a3a20696e2065786563206c6f636b536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f72656f426f6f737465723a3a7374616b653a3a6e6f7468696e6720746f207374616b654f72656f426f6f737465723a3a69735374616b65546f6b656e4f4b3a3a626164207374616b6520746f6b656e4f72656f426f6f737465723a3a69734f72656f426f6f737465724e66744f4b3a3a626164206e66744f72656f426f6f737465723a3a686172766573743a3a626164207374616b6520746f6b656e4f72656f426f6f737465723a3a7374616b654e46543a3a206e667420616c7265616479207374616b65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644f72656f426f6f737465723a3a5f756e7374616b653a3a757365206861727665737420696e73746561645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220fc76d834b2c6e0c8a965d134b479c4ac3798a04a084302536d8871d732cbb89264736f6c634300060c00334f72656f4e46544f66666572696e673a3a636f6e7374727563746f723a3a205f6d6173746572436865662063616e6e6f7420626520616464726573732830294f72656f4e46544f66666572696e673a3a636f6e7374727563746f723a3a205f6f72656f2063616e6e6f7420626520616464726573732830294f72656f426f6f737465723a3a636f6e7374727563746f723a3a205f774e61746976652063616e6e6f7420626520616464726573732830294f72656f4e46544f66666572696e673a3a636f6e7374727563746f723a3a205f774e617469766552656c617965722063616e6e6f7420626520616464726573732830294f72656f4e46544f66666572696e673a3a636f6e7374727563746f723a3a205f6f72656f626f6f73746572436f6e6669672063616e6e6f742062652061646472657373283029000000000000000000000000319e222de462ac959baf2aec848697aec2bbd770000000000000000000000000a481384653c484901b301634086c8625e550bbec000000000000000000000000ed10e067c1544e240b13e789b4124b3a9e2ed6e8000000000000000000000000d17ffcb0296f4b84d72222671d06a2881d4bc40d00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

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

000000000000000000000000319e222de462ac959baf2aec848697aec2bbd770000000000000000000000000a481384653c484901b301634086c8625e550bbec000000000000000000000000ed10e067c1544e240b13e789b4124b3a9e2ed6e8000000000000000000000000d17ffcb0296f4b84d72222671d06a2881d4bc40d00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

-----Decoded View---------------
Arg [0] : _oreo (address): 0x319e222de462ac959baf2aec848697aec2bbd770
Arg [1] : _masterChef (address): 0xa481384653c484901b301634086c8625e550bbec
Arg [2] : _oreoboosterConfig (address): 0xed10e067c1544e240b13e789b4124b3a9e2ed6e8
Arg [3] : _wNativeRelayer (address): 0xd17ffcb0296f4b84d72222671d06a2881d4bc40d
Arg [4] : _wNative (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000319e222de462ac959baf2aec848697aec2bbd770
Arg [1] : 000000000000000000000000a481384653c484901b301634086c8625e550bbec
Arg [2] : 000000000000000000000000ed10e067c1544e240b13e789b4124b3a9e2ed6e8
Arg [3] : 000000000000000000000000d17ffcb0296f4b84d72222671d06a2881d4bc40d
Arg [4] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.