Contract 0x9af1f73518fa03627ccc0fdf148f45601551e8ff 2

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4cc2461fdc517e726e0f65bf3b8b9a7dcef4556cbf0d74e2fdf711e73ad1ee74Deposit111686702021-09-23 15:43:1739 mins ago0x6641ae09b917c40e36d6a9de405f9d7368ee65ca IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.000639055
0x1b163e07d0449c079dccdab82ab4f7f8462899b75f63798d0fa758dba0390d56Deposit111679542021-09-23 15:07:241 hr 15 mins ago0x213f7e7fe55e59b526b5255270fc0f665fb36b57 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0005805
0xc2010bfd4df9aaa7a2317b7221e6b0f6440c42375439deff959d0597a1ce7e0cDeposit111678832021-09-23 15:03:511 hr 18 mins ago0x213f7e7fe55e59b526b5255270fc0f665fb36b57 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.001161105
0x603a1a7ba25ff2fbd956d5099d46071bf665f07608dcd14cddac452aec336fa1Deposit111678272021-09-23 15:01:031 hr 21 mins ago0x605c10bc4346ee53d631e9e283573a0831da1753 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00139464
0x25051b6f12a306d2ab4a2019a431607d107fbf84a5569284bdee5df47bcd206cDeposit111663902021-09-23 13:46:492 hrs 35 mins ago0x213f7e7fe55e59b526b5255270fc0f665fb36b57 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.001161105
0x5025bb4a8d9109a07025b2cd6c043e0ea1cefb0954e8a44a09cbe99b5e275d8cDeposit111660292021-09-23 13:28:462 hrs 53 mins ago0x213f7e7fe55e59b526b5255270fc0f665fb36b57 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00131976
0x435713eed70626fe3d914e3dd1d6a9705e43bb090b86047fd70b540566d6469fDeposit111637082021-09-23 11:30:414 hrs 52 mins ago0x91e8e93f2a2d95d92363a5cdfa59718fb23ec885 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00115852
0x0d0514e24165d67c863afadb43f1277af47c1a321eb9740118e546e9eafad889Deposit111635942021-09-23 11:24:594 hrs 57 mins ago0x91e8e93f2a2d95d92363a5cdfa59718fb23ec885 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.000633485
0x5f47bf8f1351f2d69d7dce06168e867372eb81c02179d0dbac5304036991cb84Deposit111635582021-09-23 11:23:114 hrs 59 mins ago0x8e8a5aa82d3982a10fed24cf5aa343063691dac6 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0013947
0x2650d98504b5e48c5feac33fed545fb2d3f7d89d69630f201fe79079cabab9f8Deposit111630812021-09-23 10:59:205 hrs 23 mins ago0x9315e6f3a8b8b0915897a22c5804924908cdde24 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0013947
0x5890c9d093b0f8b5a20f4eac9bbeaf0e09e31be034fa1c093cee98a1efd45048Deposit111618712021-09-23 9:58:436 hrs 24 mins ago0x50352bd066821ba98ce623773fa6f255e15357c5 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0005805
0x8cffdc04a70375b6f63183402dcb6a6d39a8ad4e17e998cfefbab3919af8a403Deposit111614362021-09-23 9:36:586 hrs 45 mins ago0x6242942f7ccf35bce0c6b38a50c85764925671e5 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00131982
0x9e5949022455d813bf6282deb7cf99d67af6270dbb622a3fbf01939bb8d0b7bfDeposit111613782021-09-23 9:34:026 hrs 48 mins ago0x50352bd066821ba98ce623773fa6f255e15357c5 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0005805
0x4d9034488ed9eb3cd7d44e65da84733ebec43d157d77a2f58184928722832090Deposit111581202021-09-23 6:49:059 hrs 33 mins ago0xc2e0bc3e80c17ed8edb58395286322f65ce45421 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.001413915
0xc16f2f03b39b1b62cb38ea67cc91e1723e0ca7682ac59bbf9ca5dec9b7a31b71Deposit111581152021-09-23 6:48:509 hrs 33 mins ago0xc2e0bc3e80c17ed8edb58395286322f65ce45421 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00069624
0x4858ea3917aef594b4ef819457aba207143860b94b653a27195b22d4afa726ebDeposit111580152021-09-23 6:43:509 hrs 38 mins ago0x1d5716658085aedf45d23cfee7c7def226bd791e IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0006555
0xde32cb0241c3a7eb51c8f509ddf7fa99dee643dcf8a87b5b8906ec8a81c1a769Deposit111558452021-09-23 4:54:5511 hrs 27 mins ago0xb8638fd8c48f526663422f09be7d15c4921518b3 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00203158
0xd10e4d0e94b4b96045746fa565214c1173dd6057c8bb579b77321f4a5fbe9319Withdraw111554402021-09-23 4:34:3911 hrs 48 mins ago0xb8638fd8c48f526663422f09be7d15c4921518b3 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0008262255
0xfee001b3a5ea4d30d6d60bcc2e5e3c63370cbd808950ca72960f546f8cc9c8a5Withdraw111545812021-09-23 3:51:2512 hrs 31 mins ago0x689f201ca4c770a62d1eca6dae630ebf69459ac5 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.000688825
0x8c28fa384a721bd9ca996a42dc6a818a7c131455c4a5f4b0134c508925b19995Deposit111545732021-09-23 3:50:5512 hrs 31 mins ago0x689f201ca4c770a62d1eca6dae630ebf69459ac5 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00069624
0x283cf6f36d77f35741c985c73cc73381eb8b2f56fe34c9ea3891883bd6bf7499Deposit111540012021-09-23 3:22:0613 hrs ago0xda96d6406d76a70aa99325b9eef54393230a8ff7 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.0005805
0xe2fff0444db0d1e43df417dc33086325984fa6aa18f3e41b4775d5ba05c6cb56Deposit111537782021-09-23 3:10:5713 hrs 11 mins ago0xd9044e1e27769a02e913e355780c5e2c51e7bb91 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.00122382
0xa2ad2d882e24822d3be202cdbd4fa87dbe854252f2a2866a95e21184c96f8dc1Deposit111531842021-09-23 2:41:0813 hrs 41 mins ago0x30e2c2366cfed19f5925d324b91c821ebb5550ef IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.001161045
0x9a6874d01611c4c3ece905c3f93b482062429ccdaeb0d75c2232e4e40731928fDeposit111531752021-09-23 2:40:4113 hrs 42 mins ago0x30e2c2366cfed19f5925d324b91c821ebb5550ef IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.000550135
0x9dc64b59666ade59c0d7ef3c8e2daf7c908ee4be6d6a95fd0d855a3452ce743eDeposit111531002021-09-23 2:36:5613 hrs 45 mins ago0xcf68db2cbfbf03b49395c9b587da5a4b2e8fcd40 IN  0x9af1f73518fa03627ccc0fdf148f45601551e8ff0 BNB0.000740875
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4cc2461fdc517e726e0f65bf3b8b9a7dcef4556cbf0d74e2fdf711e73ad1ee74111686702021-09-23 15:43:1739 mins ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x6641ae09b917c40e36d6a9de405f9d7368ee65ca0.000003475914302792 BNB
0x1062945ba78e5412a9c776b67396f89c34eaf99875cf3c210817ebc94cf70027111513752021-09-23 1:10:0715 hrs 12 mins ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x64e81e1fff74d8efd4485b9e8f24e2750cb4cc5a0.000038691231557161 BNB
0x5467e0858294e20e001fa5df265a4c18b390db236368c960d622e3e5828b789b111055962021-09-21 10:43:132 days 5 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xa639a1fbaa31088cf8ccc53056ff8764dfbc36c10.000191433375 BNB
0xafaeb5d7a14a64d81e1cab0867f5258d217779440ae0ec1c313848b2efa509a5109385342021-09-15 15:01:168 days 1 hr ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xf50ff8e54e3ff15fea931903c372ca7c3089f2380.000017024982279226 BNB
0x8ac995c999a3673067d17ff62902a6c62877e7a360dbdee942da14f1049094c0108431852021-09-12 7:19:4511 days 9 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xff5fcec3ee94bc145f0b5f852a29f3ba88f790c70.000010463895895748 BNB
0x4cec0407673b444c99e4ac5491dd814f3902b38b0b084c5d06a31a223381899c107762512021-09-09 22:58:1913 days 17 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x83cfde7a14fc0d8bbddfcaaf3993a90a35d1dbc80.000153003433078861 BNB
0x4722fe4a7f09c4f7bd4b339588f6caf706a00c119dc70000d863a23b953671db107650482021-09-09 13:33:3914 days 2 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x151dee3166719debf561d02f75ede74e12095b530.000056486719462658 BNB
0x3a99f1378200f43a94cb246768520094e365392f796e1ed03f84df4ac97c2fc7107586692021-09-09 8:09:1614 days 8 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x642a26de4a2cbd276c4e30bc6e7e0b32c8547f5a0.000000251507218497 BNB
0xf624ddfcda1b0a352bc11d0f67b1ad5afd4456b0b8eafb5270a97170746530b4107428262021-09-08 18:50:4614 days 21 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x5d4bffba7270a7cb98bdc306a37a863a55b89e460.000553168442057914 BNB
0x18ed1d2d9b8c001b0a5d36308ce8d303bbab6232c6fd6d94aa5ee4ddb2aae660107394452021-09-08 16:00:0515 days 22 mins ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xd9624af7a54190b1d45cb1a4159795613ed5d1a00.000090242987659986 BNB
0x77164381e8b765f0b25c6365d2c55d967659c75942cd7e71cf862ab691a81c51107066152021-09-07 12:06:2716 days 4 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x16ac58f871c8b3ca54c6bc43c107710db8c1675b0.000014720082755388 BNB
0x08fb3e0d501facb18d1d85482e9043df32aa7a1f507890f6556eaa9769ec02a8105946182021-09-03 14:14:2120 days 2 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xaa8ac8043376f6b7def5d8b6df0984241019bd6f0.006817231817409138 BNB
0x9ccfbe8347b1622d64a7a1c4fea20e938ba0480ee5017f0bc2f6265230108258105782942021-09-03 0:23:0420 days 15 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xbeebc0c769a24f94681d05751fcda51fb780931f0.000000548824627747 BNB
0x7e9b3cd6e5e9fc5e2c2e206e1101b64e3fa943fd1a67908cf3cf8d566083dafc105730882021-09-02 20:00:5520 days 20 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x48d1b02054ca15d52bbc1444b9bf5a8b89d4f75b0.00023520456 BNB
0x187b54c414ce3d749c2efa6e25ffdc3015a6f8148fac413672e9e9c2d593fc22105438292021-09-01 19:22:4421 days 21 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xa77321490a2900352f144b28041f56f070b5811b0.000025607350302057 BNB
0xb9117b34fc9f00d2de8811ef11d0a65f5f5b9a8374dfa3e748d12db74121a9b6105383972021-09-01 14:48:3322 days 1 hr ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x1efbb4edf899bd4835cf2f68747cf744e2897c5c0.000033922370346109 BNB
0xf225065ee0171d84951be37d2a6ef31e54d2d1d71d2536109bfd0c594ac691b8105240132021-09-01 2:36:2822 days 13 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xb65faf27b8b0f98224ea7187fa5979a6374bd3310.253657126912885179 BNB
0xf225065ee0171d84951be37d2a6ef31e54d2d1d71d2536109bfd0c594ac691b8105240132021-09-01 2:36:2822 days 13 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xed024ef141382a3c3c5117ba3a2afddb55a4ca6c0.013350375100678167 BNB
0xf1226440296f6db21e7892843379a526f99f8cdda84868108bd10b595ab551e9105215062021-09-01 0:29:1122 days 15 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xaa89c8e5ba92542b6b06a97b1ffbb5e1e3dd86b10.00017386890031406 BNB
0xd3ab4acf2d8f2083abfba7e8399ea333f4a4b14c3a2c64c99bf6916dbb4d412a105064052021-08-31 11:41:4123 days 4 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x4fed1b00c25461d512c84ffd6e56a39cc6ecd5890.000818475346519725 BNB
0xd9061abbba64c3b53910cb047ef4e9694b3f4ff953906633c9396227ae0fed8e104630392021-08-29 22:56:4924 days 17 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0xef37fd6dfa2deb482d0c6f48468b9d5a72a689100.000191933399299099 BNB
0x5699e6edb09695db57d98bf90d2c4c8d1473328d5be6aec45d57001410b2a20c104611802021-08-29 21:23:5224 days 18 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x1f3c0409231ee009926a8b690959735ca48df5d90.00016029793491674 BNB
0x13058bd6c9caab5d8cc5c6d17d709d80ef7a1bb4d858a98c76d4012a97fee2d3104611562021-08-29 21:22:4024 days 19 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x1f3c0409231ee009926a8b690959735ca48df5d90.00016029793491674 BNB
0xf602751061e18a95ee73f959ad46198406d0e8f59d4aecb63ca95b30ad5ead39104575272021-08-29 18:20:2524 days 22 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x349f8ef5b5b23d8bc6fcb6fc16e563e9c72a55770.000230579657482099 BNB
0xf20551ac7f0e464d1bc0acd6cbf3dbbaf6d6c6c0ef3cd9d04e84a9d725cf511d104437902021-08-29 6:51:3925 days 9 hrs ago 0x9af1f73518fa03627ccc0fdf148f45601551e8ff0x2e868585b53122e187a64f29fdc37cbc4e8a41630.004143243819138709 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SCVFarm

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 17 : SCVFarm.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/Math.sol';

import './libraries/OpenableNFT.sol';
import './interfaces/IStrategy.sol';
import './NFTSpecSupport.sol';
import './RewardSupport.sol';

contract SCVFarm is Ownable, ReentrancyGuard, NFTSpecSupport, Pausable, RewardSupport {
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 shares; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        // NFT spec
        bool hasNFT;
        uint256 nftSpecId;
        address nftInviter;
        uint256 weightedShare;
        uint256 bnbRewardDebt;
        uint256 lastRewardWindow; // last updated window
    }

    struct PoolInfo {
        IERC20 want; // Address of the want token.
        uint256 allocPoint; // How many allocation points assigned to this pool. AUTO to distribute per block.
        uint256 bnbAllocPoint;
        uint256 lastRewardBlock; // Last block number that distribution occurs.
        uint256 accRewardPerShare; // Accumulated per weighted share, times 1e12. See below.
        address strat; // Strategy address that will auto compound want tokens
        uint256 weightedShareTotal; // weightedShareTotal
        uint256 lastUpdatedWindow;
    }

    struct BNBRewardWindow {
        uint256 startBlock; // [startBlock, endBlock)
        uint256 endBlock;
        uint256 totalRewards;
        uint256 rewardPerBlock; // totalRewards / (startBlock - endBlock)
    }

    address public burnAddress = 0x000000000000000000000000000000000000dEaD;
    address public constant emptyAddress = address(0);

    address public feeWallet;

    uint256 public accReward = 0; // accumulated SCV reward
    uint256 public maxReward = 3_370_000_000 * 1e18; // max SCV reward
    uint256 public rewardPerBlock = 600 * 1e18; // scv reward per block for the whole farm

    uint256 public startBlock;

    PoolInfo[] public poolInfo; // Info of each pool.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo; // poolId -> (user address -> User Info)
    BNBRewardWindow[] public bnbRewardWindows;
    mapping(uint256 => mapping(uint256 => uint256)) public accBNBRewardPerWeightShare; // poolId -> wid -> value (*1e12)

    uint256 public totalAllocPoint = 0; // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalBNBAllocPoint = 0; // ditto

    uint256 public inviterSharePct = 50000; // 5%, percentage rate for inviter (scale to 1e6)
    uint256 public depositFeePct = 1000; // 0.1% percentage rate for deposit fee (scale to 1e6)
    uint256 public constant pctBase = 1e6;

    // --------------------------------
    // events

    event Deposit(
        address indexed user,
        uint256 indexed pid,
        uint256 amount,
        address token,
        uint256 tokenId
    );
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event MigrateFarmTo(address indexed to, uint256 indexed amount);
    event BurnNFT(address indexed nft, uint256 indexed tokenId);
    event UpdateInviterShare(uint256 pct);
    event UpdateDepositFee(uint256 pct);
    event UpdateRewardPerBlock(uint256 pct);
    event AddRewardWindow(uint256 indexed startBlock, uint256 indexed endBlock, uint256 amount);
    event Claim(address indexed user, uint256 indexed pid, uint256 scvReward, uint256 bnbReward);

    constructor(
        uint256 startBlock_,
        address feeWallet_,
        address scv_,
        address specAddr_
    ) {
        startBlock = startBlock_;
        feeWallet = feeWallet_;
        scv = scv_;

        specAddress = INFTSpec(specAddr_);
    }

    receive() external payable {}

    function pause() external onlyOwner {
        _pause();
    }

    function unpause() external onlyOwner {
        _unpause();
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    function windowLength() external view returns (uint256) {
        return bnbRewardWindows.length;
    }

    function updateInviterSharePct(uint256 newValue) public onlyOwner {
        inviterSharePct = newValue;
        emit UpdateInviterShare(newValue);
    }

    function updateDepositFeePct(uint256 newValue) public onlyOwner {
        depositFeePct = newValue;
        emit UpdateDepositFee(newValue);
    }

    function updateRewardPerBlock(uint256 newValue, bool _withUpdate) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        rewardPerBlock = newValue;
        emit UpdateRewardPerBlock(newValue);
    }

    function updateSpecAddress(address addr) public onlyOwner {
        _updateSpecAddress(addr);
    }

    function updateFeeWallet(address addr) public onlyOwner {
        feeWallet = addr;
    }

    function addSupportedNFT(address addr) public onlyOwner {
        _addSupportedNFT(addr);
    }

    function removeSupportedNFT(address addr) public onlyOwner {
        _removeSupportedNFT(addr);
    }

    function add(
        uint256 _allocPoint,
        uint256 _bnbAllocPoint,
        IERC20 _want,
        bool _withUpdate,
        address _strat
    ) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint += _allocPoint;
        totalBNBAllocPoint += _bnbAllocPoint;
        poolInfo.push(
            PoolInfo({
                want: _want,
                allocPoint: _allocPoint,
                bnbAllocPoint: _bnbAllocPoint,
                lastRewardBlock: lastRewardBlock,
                accRewardPerShare: 0,
                strat: _strat,
                weightedShareTotal: 0,
                lastUpdatedWindow: 0
            })
        );
    }

    function set(
        uint256 _pid,
        uint256 _allocPoint,
        uint256 _bnbAllocPoint,
        bool _withUpdate
    ) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;
        totalBNBAllocPoint = totalBNBAllocPoint - poolInfo[_pid].bnbAllocPoint + _bnbAllocPoint;

        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].bnbAllocPoint = _bnbAllocPoint;
    }

    // create a new sliding window for BNB rewards
    function addBNBRewardWindow(uint256 _startBlock, uint256 _endBlock) public payable onlyOwner {
        require(_endBlock > _startBlock, 'endBlock > startBlock');
        require(msg.value > 0, 'non-zero totalRewards');
        uint256 _rewardPerBlock = msg.value / (_endBlock - _startBlock);
        require(_rewardPerBlock > 0, 'non-zero rewardPerBlock');

        // also the index of the new window (to be pushed into the pool-windows)
        uint256 _windows = bnbRewardWindows.length;
        if (_windows > 0) {
            BNBRewardWindow storage prev = bnbRewardWindows[_windows - 1];
            require(_startBlock > prev.endBlock, 'startBlock overlaps with the previous block');
        }
        bnbRewardWindows.push(
            BNBRewardWindow({
                startBlock: _startBlock,
                endBlock: _endBlock,
                totalRewards: msg.value,
                rewardPerBlock: _rewardPerBlock
            })
        );
        emit AddRewardWindow(_startBlock, _endBlock, msg.value);
    }

    function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
        if (accReward >= maxReward) {
            return 0;
        }
        return _to - _from;
    }

    function pendingReward(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accRewardPerShare = pool.accRewardPerShare;
        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        if (block.number > pool.lastRewardBlock && sharesTotal != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 _rewardAmt = (multiplier * rewardPerBlock * pool.allocPoint) / totalAllocPoint;
            accRewardPerShare += (_rewardAmt * 1e12) / pool.weightedShareTotal;
        }
        return (user.weightedShare * accRewardPerShare) / 1e12 - user.rewardDebt;
    }

    function pendingBNBReward(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        if (user.weightedShare > 0 && pool.weightedShareTotal > 0) {
            uint256 pending = 0;
            for (uint256 _wid = user.lastRewardWindow; _wid < bnbRewardWindows.length; _wid++) {
                BNBRewardWindow storage w = bnbRewardWindows[_wid];
                if (w.startBlock > block.number) {
                    break;
                }
                if (pool.lastRewardBlock >= w.endBlock) {
                    // already updated
                    pending += (accBNBRewardPerWeightShare[_pid][_wid] * user.weightedShare) / 1e12;
                } else {
                    uint256 accRewardPerShare = accBNBRewardPerWeightShare[_pid][_wid];
                    uint256 multiplier =
                        Math.min(w.endBlock, block.number) -
                            Math.max(w.startBlock, pool.lastRewardBlock);
                    uint256 _rewardAmt =
                        (multiplier * w.rewardPerBlock * pool.bnbAllocPoint) / totalBNBAllocPoint;
                    accRewardPerShare += (_rewardAmt * 1e12) / pool.weightedShareTotal;
                    pending += (accRewardPerShare * user.weightedShare) / 1e12;
                }
            }
            pending -= user.bnbRewardDebt;
            return pending;
        }
        return 0;
    }

    function stakedWantTokens(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        uint256 wantLockedTotal = IStrategy(poolInfo[_pid].strat).wantLockedTotal();

        if (sharesTotal == 0) {
            return 0;
        }
        return (user.shares * wantLockedTotal) / sharesTotal;
    }

    function massUpdatePools() public whenNotPaused {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    function updatePool(uint256 _pid) public whenNotPaused {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }

        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        if (sharesTotal == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }

        _updatePoolSCV(_pid);
        if (pool.bnbAllocPoint > 0) {
            _updatePoolBNB(_pid);
        }

        pool.lastRewardBlock = block.number;
    }

    // close the farm and we don't need the upgradable
    function migrateTo(address _to, bool _withUpdate) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 rewardLeft = maxReward - accReward;
        maxReward = accReward;
        _safeTransferReward(_to, rewardLeft);
        emit MigrateFarmTo(_to, rewardLeft);
    }

    function _updatePoolSCV(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        if (multiplier > 0) {
            uint256 rewardAmt = (multiplier * rewardPerBlock * pool.allocPoint) / totalAllocPoint;
            accReward += rewardAmt;
            pool.accRewardPerShare += ((rewardAmt * 1e12) / pool.weightedShareTotal);
        }
    }

    function _updatePoolBNB(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        uint256 totalWindows = bnbRewardWindows.length;
        for (uint256 _wid = pool.lastUpdatedWindow; _wid < totalWindows; _wid++) {
            BNBRewardWindow storage win = bnbRewardWindows[_wid];
            if (win.startBlock > block.number) {
                // haven't been there yet
                break;
            }
            if (pool.lastRewardBlock >= win.endBlock) {
                // rewarded, shouldn't happen but
                continue;
            }
            // number of blocks to reward: endingBlock - startingBlock
            // endingBlock: the smaller one of endBlock or current Block
            // staringBlock: the larger one of startBlock or lastRewardBlock
            // would be 0 if already accumulated
            uint256 multiplier =
                Math.min(win.endBlock, block.number) -
                    Math.max(win.startBlock, pool.lastRewardBlock);
            uint256 _rewardAmt =
                (multiplier * win.rewardPerBlock * pool.bnbAllocPoint) / totalBNBAllocPoint;
            accBNBRewardPerWeightShare[_pid][_wid] += (_rewardAmt * 1e12) / pool.weightedShareTotal;

            // set to the last active window
            pool.lastUpdatedWindow = _wid;
        }
    }

    function depositNFT(
        uint256 _pid,
        IERC721 nft,
        uint256 nftTokenId
    ) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        require(
            nftUsable(address(nft), nftTokenId),
            'NFT not supported, not opened or non-exist specId'
        );
        // transfer to a address that no one own
        nft.transferFrom(msg.sender, burnAddress, nftTokenId);
        emit BurnNFT(address(nft), nftTokenId);

        user.hasNFT = true;
        user.nftSpecId = ISCVBot(address(nft)).getSpecId(nftTokenId);
        address inviter = nftOpener(nft, nftTokenId);
        user.nftInviter = emptyAddress;
        if (inviter != emptyAddress && inviter != msg.sender) {
            user.nftInviter = inviter;
        }

        uint256 _wshare = _toWeightedShares(user.shares, user.nftSpecId);
        pool.weightedShareTotal = pool.weightedShareTotal - user.weightedShare + _wshare;
        user.weightedShare = _wshare;
    }

    // returns pending SCV reward, assumes pool has been updated
    function _pendingSCV(uint256 _pid) internal view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        return (user.weightedShare * pool.accRewardPerShare) / 1e12 - user.rewardDebt;
    }

    // returns pending BNB reward, assumes pool has been updated
    function _pendingBNB(uint256 _pid) internal view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 amount = 0;

        for (uint256 _wid = user.lastRewardWindow; _wid <= pool.lastUpdatedWindow; _wid++) {
            amount += (user.weightedShare * accBNBRewardPerWeightShare[_pid][_wid]) / 1e12;
        }
        amount -= user.bnbRewardDebt;
        return amount;
    }

    function _rewardSCV(uint256 _pid, uint256 amount) internal {
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 inviterAmount = 0;
        if (user.hasNFT && user.nftInviter != emptyAddress) {
            inviterAmount = (amount * inviterSharePct) / pctBase;
            _safeTransferReward(user.nftInviter, inviterAmount);
        }
        _safeTransferReward(msg.sender, amount - inviterAmount);
    }

    function _rewardBNB(uint256 _pid, uint256 amount) internal {
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 inviterAmount = 0;
        if (user.hasNFT && user.nftInviter != emptyAddress) {
            inviterAmount = (amount * inviterSharePct) / pctBase;
            _safeTransferBNB(user.nftInviter, inviterAmount);
        }
        _safeTransferBNB(msg.sender, amount - inviterAmount);
    }

    function deposit(
        uint256 _pid,
        uint256 _wantAmt,
        IERC721 nft,
        uint256 nftTokenId
    ) public nonReentrant whenNotPaused {
        updatePool(_pid);
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        require(user.shares > 0 || _wantAmt > 0, 'show me the money');

        // distribute earning before new deposit
        if (user.shares > 0) {
            uint256 pending = _pendingSCV(_pid);
            _rewardSCV(_pid, pending);
            uint256 pendingBNB = _pendingBNB(_pid);
            _rewardBNB(_pid, pendingBNB);
            emit Claim(msg.sender, _pid, pending, pendingBNB);
        }

        // set new NFT
        if (address(nft) != emptyAddress) {
            depositNFT(_pid, nft, nftTokenId);
        }

        // deposit new tokens
        if (_wantAmt > 0) {
            pool.want.safeTransferFrom(address(msg.sender), address(this), _wantAmt);
            uint256 rateBase = specAddress.percentageBaseRate();
            uint256 reductionRate = 0;
            if (user.hasNFT) {
                reductionRate = uint256(specAddress.getDepositFeeReductionRate(user.nftSpecId));
            }

            uint256 feePct = depositFeePct - (depositFeePct * reductionRate) / rateBase;
            uint256 depositFee = (_wantAmt * feePct) / pctBase;
            if (depositFee > 0) {
                pool.want.transfer(feeWallet, depositFee);
            }

            // transfer to strategy
            uint256 _depositAmt = _wantAmt - depositFee;
            pool.want.safeIncreaseAllowance(pool.strat, _depositAmt);
            uint256 sharesAdded = IStrategy(poolInfo[_pid].strat).deposit(msg.sender, _depositAmt);
            user.shares = user.shares + sharesAdded;

            uint256 _share = user.shares;
            if (user.hasNFT) {
                _share = _toWeightedShares(user.shares, user.nftSpecId);
            }
            pool.weightedShareTotal = pool.weightedShareTotal - user.weightedShare + _share;
            user.weightedShare = _share;
        }

        user.rewardDebt = (user.weightedShare * pool.accRewardPerShare) / 1e12;
        user.bnbRewardDebt =
            (user.weightedShare * accBNBRewardPerWeightShare[_pid][pool.lastUpdatedWindow]) /
            1e12;
        user.lastRewardWindow = pool.lastUpdatedWindow;

        emit Deposit(msg.sender, _pid, _wantAmt, address(nft), nftTokenId);
    }

    function withdraw(uint256 _pid, uint256 _wantAmt) public nonReentrant whenNotPaused {
        updatePool(_pid);

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        uint256 wantLockedTotal = IStrategy(poolInfo[_pid].strat).wantLockedTotal();
        uint256 sharesTotal = IStrategy(poolInfo[_pid].strat).sharesTotal();

        require(user.shares > 0, 'user.shares is 0');
        require(sharesTotal > 0, 'sharesTotal is 0');

        uint256 pending = _pendingSCV(_pid);
        _rewardSCV(_pid, pending);
        uint256 pendingBNB = _pendingBNB(_pid);
        _rewardBNB(_pid, pendingBNB);

        emit Claim(msg.sender, _pid, pending, pendingBNB);

        // Withdraw want tokens
        uint256 amount = (user.shares * wantLockedTotal) / sharesTotal;

        if (_wantAmt > amount) {
            _wantAmt = amount;
        }

        if (_wantAmt > 0) {
            uint256 sharesRemoved = IStrategy(poolInfo[_pid].strat).withdraw(msg.sender, _wantAmt);

            if (sharesRemoved > user.shares) {
                user.shares = 0;
                pool.weightedShareTotal = pool.weightedShareTotal - user.weightedShare;
                user.weightedShare = 0;
            } else {
                // remove NFT next
                user.shares = user.shares - sharesRemoved;
                pool.weightedShareTotal =
                    pool.weightedShareTotal -
                    user.weightedShare +
                    user.shares;
                user.weightedShare = user.shares;
            }

            uint256 wantBal = IERC20(pool.want).balanceOf(address(this));

            if (wantBal < _wantAmt) {
                _wantAmt = wantBal;
            }
            pool.want.safeTransfer(address(msg.sender), _wantAmt);
        }

        user.rewardDebt = (user.weightedShare * pool.accRewardPerShare) / 1e12;
        user.bnbRewardDebt =
            (user.weightedShare * accBNBRewardPerWeightShare[_pid][pool.lastUpdatedWindow]) /
            1e12;
        user.lastRewardWindow = pool.lastUpdatedWindow;

        emit Withdraw(msg.sender, _pid, _wantAmt);

        // reset NFT
        user.hasNFT = false;
        user.nftInviter = emptyAddress;
        user.nftSpecId = 0;
    }

    function withdrawAll(uint256 _pid) public whenNotPaused {
        withdraw(_pid, type(uint256).max);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public nonReentrant whenNotPaused {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        uint256 wantLockedTotal = IStrategy(poolInfo[_pid].strat).wantLockedTotal();
        uint256 sharesTotal = IStrategy(poolInfo[_pid].strat).sharesTotal();
        uint256 amount = (user.shares * wantLockedTotal) / sharesTotal;

        IStrategy(poolInfo[_pid].strat).withdraw(msg.sender, amount);

        pool.want.safeTransfer(address(msg.sender), amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount);
        user.shares = 0;

        // reset debt
        user.rewardDebt = 0;
        user.bnbRewardDebt = 0;
        user.lastRewardWindow = 0;

        // reset NFT
        user.hasNFT = false;
        pool.weightedShareTotal -= user.weightedShare;
        user.weightedShare = 0;
        user.nftInviter = emptyAddress;
    }

    function inCaseBNBGetStuck(uint256 _amount) external onlyOwner {
        payable(msg.sender).transfer(_amount);
    }

    function inCaseTokensGetStuck(address _token, uint256 _amount) public onlyOwner {
        IERC20(_token).safeTransfer(msg.sender, _amount);
    }

    function _toWeightedShares(uint256 shares, uint256 specId) public view returns (uint256) {
        uint64 boost = specAddress.getBoostRate(specId);
        uint256 base = specAddress.percentageBaseRate();
        return (shares * boost) / base;
    }
}

File 2 of 17 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        _balances[account] = accountBalance - amount;
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 3 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 4 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.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 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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

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

pragma solidity ^0.8.0;

import "../../utils/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 6 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 () {
        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 7 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 () {
        _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 8 of 17 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/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 () {
        _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 9 of 17 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

File 10 of 17 : OpenableNFT.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

interface INFTSpec {
    function hasSpecId(uint256 specId) external view returns (bool);

    function totalSpecs() external view returns (uint256);

    function percentageBaseRate() external view returns (uint256);

    function getBoostRate(uint256 specId) external view returns (uint64);

    function getDepositFeeReductionRate(uint256 specId) external view returns (uint64);

    function isPro(uint256 specId) external view returns (bool);
}

interface ISCVBot is IERC721 {
    function getSpecId(uint256 tokenId) external view returns (uint256);

    function specAddress() external view returns (address);
}

interface ISCVOpenableNFT {
    function openerOf(uint256 tokenId) external view returns (address);

    function opened(uint256 tokenId) external view returns (bool);
}

library OpenableNFT {
    function isOpenableNFT(IERC721 nftAddress) internal view returns (bool) {
        bytes4 iopener = ISCVOpenableNFT.openerOf.selector; // bytes4(keccak256('openerOf(uint256)'));
        bytes4 iopened = ISCVOpenableNFT.opened.selector; // bytes4(keccak256('opened(uint256)'));
        return nftAddress.supportsInterface(iopener) && nftAddress.supportsInterface(iopened);
    }

    function opened(IERC721 nftAddress, uint256 tokenId) internal view returns (bool) {
        if (isOpenableNFT(nftAddress)) {
            return ISCVOpenableNFT(address(nftAddress)).opened(tokenId);
        } else {
            // defaults to 'true' for non-ISCVOpenableNFT
            return true;
        }
    }

    function openerOf(IERC721 nftAddress, uint256 tokenId) internal view returns (address) {
        if (isOpenableNFT(nftAddress)) {
            return ISCVOpenableNFT(address(nftAddress)).openerOf(tokenId);
        }
        return address(0);
    }
}

File 11 of 17 : IStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

// For interacting with our own strategy
interface IStrategy {
    // Total want tokens managed by stratfegy
    function wantLockedTotal() external view returns (uint256);

    // Sum of all shares of users to wantLockedTotal
    function sharesTotal() external view returns (uint256);

    // Main want token compounding function
    function earn() external;

    // Transfer want tokens autoFarm -> strategy
    function deposit(address _userAddress, uint256 _wantAmt) external returns (uint256);

    // Transfer want tokens strategy -> autoFarm
    function withdraw(address _userAddress, uint256 _wantAmt) external returns (uint256);

    function inCaseTokensGetStuck(
        address _token,
        uint256 _amount,
        address _to
    ) external;
}

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

pragma solidity ^0.8.4;

import './libraries/OpenableNFT.sol';

abstract contract NFTSpecSupport {
    using OpenableNFT for IERC721;

    event SpecAddressUpdate(address newAddress);
    event SpecNFTSupportUpdate(address nft, bool support);

    INFTSpec public specAddress;
    mapping(address => bool) public supportedNFTs;

    function _updateSpecAddress(address specAddress_) internal {
        specAddress = INFTSpec(specAddress_);
        emit SpecAddressUpdate(specAddress_);
    }

    function _addSupportedNFT(address specNFTAddress_) internal {
        supportedNFTs[specNFTAddress_] = true;
        emit SpecNFTSupportUpdate(specNFTAddress_, true);
    }

    function _removeSupportedNFT(address specNFTAddress_) internal {
        delete supportedNFTs[specNFTAddress_];
        emit SpecNFTSupportUpdate(specNFTAddress_, false);
    }

    function nftUsable(address nftAddress_, uint256 tokenId_) public view returns (bool) {
        return
            supportedNFTs[nftAddress_] &&
            IERC721(nftAddress_).opened(tokenId_) &&
            specAddress.hasSpecId(ISCVBot(nftAddress_).getSpecId(tokenId_));
    }

    function nftOpener(IERC721 nftAddress_, uint256 tokenId_) public view returns (address) {
        return nftAddress_.openerOf(tokenId_);
    }
}

File 13 of 17 : RewardSupport.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/math/Math.sol';

abstract contract RewardSupport {
    using SafeERC20 for IERC20;
    address public scv;

    function _safeTransferReward(address _to, uint256 _amount) internal {
        uint256 amt = Math.min(IERC20(scv).balanceOf(address(this)), _amount);
        if (amt == 0) {
            return;
        }
        IERC20(scv).safeTransfer(_to, amt);
    }

    function _safeTransferBNB(address _to, uint256 _amount) internal {
        uint256 amt = Math.min(address(this).balance, _amount);
        if (amt == 0) {
            return;
        }
        payable(_to).transfer(amt);
    }
}

File 14 of 17 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

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

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

File 16 of 17 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^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 17 of 17 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"startBlock_","type":"uint256"},{"internalType":"address","name":"feeWallet_","type":"address"},{"internalType":"address","name":"scv_","type":"address"},{"internalType":"address","name":"specAddr_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"endBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddRewardWindow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"BurnNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"scvReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bnbReward","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MigrateFarmTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SpecAddressUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"bool","name":"support","type":"bool"}],"name":"SpecNFTSupportUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pct","type":"uint256"}],"name":"UpdateDepositFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pct","type":"uint256"}],"name":"UpdateInviterShare","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pct","type":"uint256"}],"name":"UpdateRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"specId","type":"uint256"}],"name":"_toWeightedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"accBNBRewardPerWeightShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_bnbAllocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_want","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"address","name":"_strat","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"name":"addBNBRewardWindow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"addSupportedNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bnbRewardWindows","outputs":[{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"uint256","name":"totalRewards","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"},{"internalType":"contract IERC721","name":"nft","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositFeePct","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emptyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"inCaseBNBGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"inviterSharePct","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"migrateTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"nftAddress_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"nftOpener","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"nftUsable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"pctBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingBNBReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"want","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"bnbAllocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"address","name":"strat","type":"address"},{"internalType":"uint256","name":"weightedShareTotal","type":"uint256"},{"internalType":"uint256","name":"lastUpdatedWindow","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"removeSupportedNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scv","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_bnbAllocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"specAddress","outputs":[{"internalType":"contract INFTSpec","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"stakedWantTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedNFTs","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBNBAllocPoint","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":"uint256","name":"newValue","type":"uint256"}],"name":"updateDepositFeePct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"updateFeeWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateInviterSharePct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"updateRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"updateSpecAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"bool","name":"hasNFT","type":"bool"},{"internalType":"uint256","name":"nftSpecId","type":"uint256"},{"internalType":"address","name":"nftInviter","type":"address"},{"internalType":"uint256","name":"weightedShare","type":"uint256"},{"internalType":"uint256","name":"bnbRewardDebt","type":"uint256"},{"internalType":"uint256","name":"lastRewardWindow","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"windowLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600580546001600160a01b03191661dead179055600060078190556b0ae399421055b0296a000000600855682086ac351052600000600955600f81905560105561c3506011556103e86012553480156200005d57600080fd5b50604051620044e2380380620044e283398101604081905262000080916200013a565b600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001805560048054600a95909555600680546001600160a01b03199081166001600160a01b03968716179091556001600160a81b031990951661010093851693909302929092179091556002805490931691161790556200018d565b80516001600160a01b03811681146200013557600080fd5b919050565b6000806000806080858703121562000150578384fd5b8451935062000162602086016200011d565b925062000172604086016200011d565b915062000182606086016200011d565b905092959194509250565b614345806200019d6000396000f3fe60806040526004361061031e5760003560e01c806378644003116101ab57806393f1a40b116100f7578063c6d758cb11610095578063ebd31f201161006f578063ebd31f20146109e3578063f25f4b5614610a08578063f2fde38b14610a28578063f94290e014610a4857600080fd5b8063c6d758cb14610983578063c8312a54146109a3578063e78f0949146109c357600080fd5b8063ae485c1b116100d1578063ae485c1b146108f3578063b48e366f14610913578063b727a6c214610933578063bb1fc55d1461096357600080fd5b806393f1a40b146107f2578063958e2d31146108b357806398969e82146108d357600080fd5b80638862445a116101645780638d9a0a7e1161013e5780638d9a0a7e146107545780638da5cb5b146107945780638dbb1e3a146107b25780638e4c1c80146107d257600080fd5b80638862445a146106fe5780638ae39cac1461071e5780638c6222f61461073457600080fd5b8063786440031461065d5780637b2c3a851461067d5780637b84daec1461069d5780637c70b205146106bd57806383496144146106d25780638456cb59146106e957600080fd5b806348cd4cb11161026a5780635c975abb1161022357806366a78e6c116101fd57806366a78e6c146105f257806370d5ae0514610608578063715018a614610628578063773a70231461063d57600080fd5b80635c975abb14610599578063630b5ba1146105bd57806366718524146105d257600080fd5b806348cd4cb1146105045780634f727f5e1461051a57806351eb05a61461052d578063528670df1461054d5780635312ea8e14610563578063562975cb1461058357600080fd5b806317fd00be116102d757806330341e38116102b157806330341e3814610499578063383e44d6146104b95780633f4ba83a146104cf578063441a3e70146104e457600080fd5b806317fd00be146104395780631f66b77d146104595780631f6d9c4f1461047957600080fd5b8063032ca3d41461032a578063081e3eda1461035c57806309f199511461037b5780631526fe271461039d578063169b28011461040d57806317caf6f11461042357600080fd5b3661032557005b600080fd5b34801561033657600080fd5b5061033f600081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561036857600080fd5b50600b545b604051908152602001610353565b34801561038757600080fd5b5061039b610396366004614038565b610a80565b005b3480156103a957600080fd5b506103bd6103b8366004613f9f565b610cba565b604080516001600160a01b03998a16815260208101989098528701959095526060860193909352608085019190915290931660a083015260c082019290925260e081019190915261010001610353565b34801561041957600080fd5b5061036d60115481565b34801561042f57600080fd5b5061036d600f5481565b34801561044557600080fd5b5060025461033f906001600160a01b031681565b34801561046557600080fd5b5061036d610474366004614017565b610d1c565b34801561048557600080fd5b5061039b610494366004613f20565b610e53565b3480156104a557600080fd5b5061039b6104b4366004613ee8565b610eea565b3480156104c557600080fd5b5061036d60105481565b3480156104db57600080fd5b5061039b610f20565b3480156104f057600080fd5b5061039b6104ff366004614017565b610f54565b34801561051057600080fd5b5061036d600a5481565b61039b610528366004614017565b61151c565b34801561053957600080fd5b5061039b610548366004613f9f565b6117fa565b34801561055957600080fd5b5061036d60125481565b34801561056f57600080fd5b5061039b61057e366004613f9f565b611917565b34801561058f57600080fd5b5061036d60075481565b3480156105a557600080fd5b5060045460ff165b6040519015158152602001610353565b3480156105c957600080fd5b5061039b611c96565b3480156105de57600080fd5b5061039b6105ed366004613ee8565b611ce4565b3480156105fe57600080fd5b5061036d60085481565b34801561061457600080fd5b5060055461033f906001600160a01b031681565b34801561063457600080fd5b5061039b611d30565b34801561064957600080fd5b506105ad610658366004613f58565b611da4565b34801561066957600080fd5b5061033f610678366004613f58565b611edc565b34801561068957600080fd5b5061039b610698366004613ee8565b611ef1565b3480156106a957600080fd5b5061036d6106b8366004613fcf565b611f24565b3480156106c957600080fd5b50600d5461036d565b3480156106de57600080fd5b5061036d620f424081565b3480156106f557600080fd5b5061039b6120d4565b34801561070a57600080fd5b5061039b6107193660046140d4565b612106565b34801561072a57600080fd5b5061036d60095481565b34801561074057600080fd5b5061039b61074f366004613f9f565b612254565b34801561076057600080fd5b5061077461076f366004613f9f565b6122ba565b604080519485526020850193909352918301526060820152608001610353565b3480156107a057600080fd5b506000546001600160a01b031661033f565b3480156107be57600080fd5b5061036d6107cd366004614017565b6122f4565b3480156107de57600080fd5b5061039b6107ed366004613f9f565b612313565b3480156107fe57600080fd5b5061086961080d366004613fcf565b600c602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600586015460068701546007909701549596949560ff9094169492936001600160a01b0390921692909188565b6040805198895260208901979097529415159587019590955260608601929092526001600160a01b0316608085015260a084015260c083019190915260e082015261010001610353565b3480156108bf57600080fd5b5061039b6108ce366004613f9f565b612372565b3480156108df57600080fd5b5061036d6108ee366004613fcf565b6123a1565b3480156108ff57600080fd5b5061039b61090e366004613ff3565b61252b565b34801561091f57600080fd5b5061039b61092e366004613f9f565b61259f565b34801561093f57600080fd5b506105ad61094e366004613ee8565b60036020526000908152604090205460ff1681565b34801561096f57600080fd5b5061036d61097e366004613fcf565b6125f6565b34801561098f57600080fd5b5061039b61099e366004613f58565b612824565b3480156109af57600080fd5b5061039b6109be366004613ee8565b612862565b3480156109cf57600080fd5b5061039b6109de366004614096565b612895565b3480156109ef57600080fd5b5060045461033f9061010090046001600160a01b031681565b348015610a1457600080fd5b5060065461033f906001600160a01b031681565b348015610a3457600080fd5b5061039b610a43366004613ee8565b612e3f565b348015610a5457600080fd5b5061036d610a63366004614017565b600e60209081526000928352604080842090915290825290205481565b6000546001600160a01b03163314610ab35760405162461bcd60e51b8152600401610aaa906141b5565b60405180910390fd5b8115610ac157610ac1611c96565b6000600a544311610ad457600a54610ad6565b435b905085600f6000828254610aea9190614221565b925050819055508460106000828254610b039190614221565b909155505060408051610100810182526001600160a01b039586168152602081019788529081019586526060810191825260006080820181815293861660a0830190815260c0830182815260e08401838152600b80546001810182559452935160089093027f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db981018054948a166001600160a01b031995861617905599517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba8b015597517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb8a015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc89015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd88015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbe87018054919095169216919091179092555090517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbf830155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dc090910155565b600b8181548110610cca57600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b03968716985094969395929491939216919088565b60025460405163f0577c6d60e01b81526004810183905260009182916001600160a01b039091169063f0577c6d9060240160206040518083038186803b158015610d6557600080fd5b505afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190614114565b90506000600260009054906101000a90046001600160a01b03166001600160a01b0316630b146fce6040518163ffffffff1660e01b815260040160206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e279190613fb7565b905080610e3e67ffffffffffffffff841687614259565b610e489190614239565b925050505b92915050565b6000546001600160a01b03163314610e7d5760405162461bcd60e51b8152600401610aaa906141b5565b8015610e8b57610e8b611c96565b6000600754600854610e9d9190614278565b6007546008559050610eaf8382612f29565b60405181906001600160a01b038516907f4e43ecf8151eaafb11c767471564e45a4302314b6cbef319a16dd1953d001b2490600090a3505050565b6000546001600160a01b03163314610f145760405162461bcd60e51b8152600401610aaa906141b5565b610f1d81612fe4565b50565b6000546001600160a01b03163314610f4a5760405162461bcd60e51b8152600401610aaa906141b5565b610f52613032565b565b60026001541415610f775760405162461bcd60e51b8152600401610aaa906141ea565b600260015560045460ff1615610f9f5760405162461bcd60e51b8152600401610aaa9061418b565b610fa8826117fa565b6000600b8381548110610fcb57634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600c82526040808520338652909252908320600b80546008909402909201945092918690811061101857634e487b7160e01b600052603260045260246000fd5b600091825260209182902060056008909202010154604080516342da4eb360e01b815290516001600160a01b03909216926342da4eb392600480840193829003018186803b15801561106957600080fd5b505afa15801561107d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a19190613fb7565b90506000600b86815481106110c657634e487b7160e01b600052603260045260246000fd5b60009182526020918290206005600890920201015460408051632251caaf60e11b815290516001600160a01b03909216926344a3955e92600480840193829003018186803b15801561111757600080fd5b505afa15801561112b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114f9190613fb7565b83549091506111935760405162461bcd60e51b815260206004820152601060248201526f0757365722e73686172657320697320360841b6044820152606401610aaa565b600081116111d65760405162461bcd60e51b815260206004820152601060248201526f0736861726573546f74616c20697320360841b6044820152606401610aaa565b60006111e1876130c5565b90506111ed878261314f565b60006111f8886131e0565b905061120488826132b0565b6040805183815260208101839052899133917f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef1910160405180910390a36000838587600001546112549190614259565b61125e9190614239565b90508088111561126c578097505b871561143c576000600b8a8154811061129557634e487b7160e01b600052603260045260246000fd5b600091825260209091206008909102016005015460405163f3fef3a360e01b8152336004820152602481018b90526001600160a01b039091169063f3fef3a390604401602060405180830381600087803b1580156112f257600080fd5b505af1158015611306573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132a9190613fb7565b875490915081111561135f57600087556005870154600689015461134e9190614278565b60068901556000600588015561139a565b865461136c908290614278565b808855600588015460068a01546113839190614278565b61138d9190614221565b6006890155865460058801555b87546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156113dd57600080fd5b505afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114159190613fb7565b905089811015611423578099505b8854611439906001600160a01b0316338c61333b565b50505b64e8d4a51000876004015487600501546114569190614259565b6114609190614239565b60018701556000898152600e6020908152604080832060078b01548452909152902054600587015464e8d4a510009161149891614259565b6114a29190614239565b600687015560078781015490870155604051888152899033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350505060028301805460ff1916905550506004810180546001600160a01b0319169055600060039091015550506001805550565b6000546001600160a01b031633146115465760405162461bcd60e51b8152600401610aaa906141b5565b81811161158d5760405162461bcd60e51b8152602060048201526015602482015274656e64426c6f636b203e207374617274426c6f636b60581b6044820152606401610aaa565b600034116115d55760405162461bcd60e51b81526020600482015260156024820152746e6f6e2d7a65726f20746f74616c5265776172647360581b6044820152606401610aaa565b60006115e18383614278565b6115eb9034614239565b90506000811161163d5760405162461bcd60e51b815260206004820152601760248201527f6e6f6e2d7a65726f20726577617264506572426c6f636b0000000000000000006044820152606401610aaa565b600d5480156116ec576000600d611655600184614278565b8154811061167357634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402019050806001015485116116ea5760405162461bcd60e51b815260206004820152602b60248201527f7374617274426c6f636b206f7665726c6170732077697468207468652070726560448201526a76696f757320626c6f636b60a81b6064820152608401610aaa565b505b6040805160808101825285815260208082018681523483850181815260608501888152600d805460018101825560009190915295517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb560049097029687015592517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb6860155517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb785015590517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb8909301929092559151908152849186917f6ae1635270536b980260e936166176b664793243bb82b2bb8a13fd6549bde682910160405180910390a350505050565b60045460ff161561181d5760405162461bcd60e51b8152600401610aaa9061418b565b6000600b828154811061184057634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020190508060030154431161185f575050565b600581015460408051632251caaf60e11b815290516000926001600160a01b0316916344a3955e916004808301926020929190829003018186803b1580156118a657600080fd5b505afa1580156118ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118de9190613fb7565b9050806118f057504360039091015550565b6118f98361339e565b60028201541561190c5761190c8361346a565b504360039091015550565b6002600154141561193a5760405162461bcd60e51b8152600401610aaa906141ea565b600260015560045460ff16156119625760405162461bcd60e51b8152600401610aaa9061418b565b6000600b828154811061198557634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600c82526040808520338652909252908320600b8054600890940290920194509291859081106119d257634e487b7160e01b600052603260045260246000fd5b600091825260209182902060056008909202010154604080516342da4eb360e01b815290516001600160a01b03909216926342da4eb392600480840193829003018186803b158015611a2357600080fd5b505afa158015611a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5b9190613fb7565b90506000600b8581548110611a8057634e487b7160e01b600052603260045260246000fd5b60009182526020918290206005600890920201015460408051632251caaf60e11b815290516001600160a01b03909216926344a3955e92600480840193829003018186803b158015611ad157600080fd5b505afa158015611ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b099190613fb7565b9050600081838560000154611b1e9190614259565b611b289190614239565b9050600b8681548110611b4b57634e487b7160e01b600052603260045260246000fd5b600091825260209091206008909102016005015460405163f3fef3a360e01b8152336004820152602481018390526001600160a01b039091169063f3fef3a390604401602060405180830381600087803b158015611ba857600080fd5b505af1158015611bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be09190613fb7565b508454611bf7906001600160a01b0316338361333b565b604051818152869033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a360008085556001850181905560068086018290556007860182905560028601805460ff191690556005860154908701805491929091611c6e908490614278565b90915550506000600585015550505060040180546001600160a01b0319169055505060018055565b60045460ff1615611cb95760405162461bcd60e51b8152600401610aaa9061418b565b600b5460005b81811015611ce057611cd0816117fa565b611cd9816142bb565b9050611cbf565b5050565b6000546001600160a01b03163314611d0e5760405162461bcd60e51b8152600401610aaa906141b5565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314611d5a5760405162461bcd60e51b8152600401610aaa906141b5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b03821660009081526003602052604081205460ff168015611dda5750611dda6001600160a01b038416836135d3565b8015611ed55750600254604051637545e7a560e11b8152600481018490526001600160a01b039182169163cdfad04a919086169063ea8bcf4a9060240160206040518083038186803b158015611e2f57600080fd5b505afa158015611e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e679190613fb7565b6040518263ffffffff1660e01b8152600401611e8591815260200190565b60206040518083038186803b158015611e9d57600080fd5b505afa158015611eb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed59190613f83565b9392505050565b6000611ed56001600160a01b0384168361366a565b6000546001600160a01b03163314611f1b5760405162461bcd60e51b8152600401610aaa906141b5565b610f1d816136fb565b600080600b8481548110611f4857634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600c825260408085206001600160a01b03808a16875290845281862060056008909602909301948501548251632251caaf60e11b815292519597509295949216926344a3955e92600480840193829003018186803b158015611fb657600080fd5b505afa158015611fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fee9190613fb7565b90506000600b878154811061201357634e487b7160e01b600052603260045260246000fd5b600091825260209182902060056008909202010154604080516342da4eb360e01b815290516001600160a01b03909216926342da4eb392600480840193829003018186803b15801561206457600080fd5b505afa158015612078573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209c9190613fb7565b9050816120b0576000945050505050610e4d565b825482906120bf908390614259565b6120c99190614239565b979650505050505050565b6000546001600160a01b031633146120fe5760405162461bcd60e51b8152600401610aaa906141b5565b610f52613756565b6000546001600160a01b031633146121305760405162461bcd60e51b8152600401610aaa906141b5565b801561213e5761213e611c96565b82600b858154811061216057634e487b7160e01b600052603260045260246000fd5b906000526020600020906008020160010154600f5461217f9190614278565b6121899190614221565b600f8190555081600b85815481106121b157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060080201600201546010546121d09190614278565b6121da9190614221565b60108190555082600b858154811061220257634e487b7160e01b600052603260045260246000fd5b90600052602060002090600802016001018190555081600b858154811061223957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600802016002018190555050505050565b6000546001600160a01b0316331461227e5760405162461bcd60e51b8152600401610aaa906141b5565b60128190556040518181527f721c401ac1df6aa6d76f66c40109ef145b3789fc067202fd5e3194ea0c2a4985906020015b60405180910390a150565b600d81815481106122ca57600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b60006008546007541061230957506000610e4d565b611ed58383614278565b6000546001600160a01b0316331461233d5760405162461bcd60e51b8152600401610aaa906141b5565b60118190556040518181527f6abaa41aec75c256dc30d1e82800f83ac6802f71d36f0c88d7c02c40213707d6906020016122af565b60045460ff16156123955760405162461bcd60e51b8152600401610aaa9061418b565b610f1d81600019610f54565b600080600b84815481106123c557634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600c825260408085206001600160a01b03898116875290845281862060089590950290920160048181015460058301548451632251caaf60e11b815294519399509697909690959416936344a3955e9380830193919290829003018186803b15801561243d57600080fd5b505afa158015612451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124759190613fb7565b905083600301544311801561248957508015155b156124fc57600061249e8560030154436122f4565b90506000600f548660010154600954846124b89190614259565b6124c29190614259565b6124cc9190614239565b60068701549091506124e38264e8d4a51000614259565b6124ed9190614239565b6124f79085614221565b935050505b826001015464e8d4a510008385600501546125179190614259565b6125219190614239565b6120c99190614278565b6000546001600160a01b031633146125555760405162461bcd60e51b8152600401610aaa906141b5565b801561256357612563611c96565b60098290556040518281527fc606f355efeddd89e42e997e575220501445590def6dd71bf081c2c51d6c0a4d9060200160405180910390a15050565b6000546001600160a01b031633146125c95760405162461bcd60e51b8152600401610aaa906141b5565b604051339082156108fc029083906000818181858888f19350505050158015611ce0573d6000803e3d6000fd5b600080600b848154811061261a57634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600c825260408085206001600160a01b0389168652909252922060058101546008909202909201925015801590612662575060008260060154115b156128195760078101546000905b600d548110156127fe576000600d828154811061269d57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905043816000015411156126bf57506127fe565b80600101548560030154106127185760058401546000898152600e6020908152604080832086845290915290205464e8d4a51000916126fd91614259565b6127079190614239565b6127119084614221565b92506127eb565b6000888152600e602090815260408083208584529091528120548254600388015491929161274691906137ae565b6127548460010154436137c5565b61275e9190614278565b90506000601054886002015485600301548461277a9190614259565b6127849190614259565b61278e9190614239565b60068901549091506127a58264e8d4a51000614259565b6127af9190614239565b6127b99084614221565b925064e8d4a510008760050154846127d19190614259565b6127db9190614239565b6127e59087614221565b95505050505b50806127f6816142bb565b915050612670565b50600682015461280e9082614278565b9350610e4d92505050565b506000949350505050565b6000546001600160a01b0316331461284e5760405162461bcd60e51b8152600401610aaa906141b5565b611ce06001600160a01b038316338361333b565b6000546001600160a01b0316331461288c5760405162461bcd60e51b8152600401610aaa906141b5565b610f1d816137d4565b600260015414156128b85760405162461bcd60e51b8152600401610aaa906141ea565b600260015560045460ff16156128e05760405162461bcd60e51b8152600401610aaa9061418b565b6128e9846117fa565b6000600b858154811061290c57634e487b7160e01b600052603260045260246000fd5b60009182526020808320888452600c8252604080852033865290925292208054600890920290920192501515806129435750600085115b6129835760405162461bcd60e51b815260206004820152601160248201527073686f77206d6520746865206d6f6e657960781b6044820152606401610aaa565b8054156129f8576000612995876130c5565b90506129a1878261314f565b60006129ac886131e0565b90506129b888826132b0565b6040805183815260208101839052899133917f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef1910160405180910390a350505b6001600160a01b03841615612a1257612a1286858561382b565b8415612d72578154612a2f906001600160a01b0316333088613ac0565b6002546040805163058a37e760e11b815290516000926001600160a01b031691630b146fce916004808301926020929190829003018186803b158015612a7457600080fd5b505afa158015612a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aac9190613fb7565b600283015490915060009060ff1615612b53576002546003840154604051635887395d60e01b81526001600160a01b0390921691635887395d91612af69160040190815260200190565b60206040518083038186803b158015612b0e57600080fd5b505afa158015612b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b469190614114565b67ffffffffffffffff1690505b60008282601254612b649190614259565b612b6e9190614239565b601254612b7b9190614278565b90506000620f4240612b8d838b614259565b612b979190614239565b90508015612c2857855460065460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b158015612bee57600080fd5b505af1158015612c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c269190613f83565b505b6000612c34828b614278565b60058801548854919250612c55916001600160a01b03908116911683613af8565b6000600b8c81548110612c7857634e487b7160e01b600052603260045260246000fd5b60009182526020909120600890910201600501546040516311f9fbc960e21b8152336004820152602481018490526001600160a01b03909116906347e7ef2490604401602060405180830381600087803b158015612cd557600080fd5b505af1158015612ce9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d0d9190613fb7565b8754909150612d1d908290614221565b808855600288015460ff1615612d4257612d3f88600001548960030154610d1c565b90505b8088600501548a60060154612d579190614278565b612d619190614221565b60068a015560058801555050505050505b64e8d4a5100082600401548260050154612d8c9190614259565b612d969190614239565b60018201556000868152600e6020908152604080832060078601548452909152902054600582015464e8d4a5100091612dce91614259565b612dd89190614239565b600682015560078281015490820155604080518681526001600160a01b0386166020820152908101849052869033907eab9ea1934a18c419ebd648dfd54350d24ab746230b97428774bd8d923f4eaf9060600160405180910390a350506001805550505050565b6000546001600160a01b03163314612e695760405162461bcd60e51b8152600401610aaa906141b5565b6001600160a01b038116612ece5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610aaa565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600480546040516370a0823160e01b81523092810192909252600091612fb79161010090046001600160a01b0316906370a082319060240160206040518083038186803b158015612f7957600080fd5b505afa158015612f8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb19190613fb7565b836137c5565b905080612fc357505050565b600454612fdf9061010090046001600160a01b0316848361333b565b505050565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f470d96707cd52135d10f38994fef7b4670829b31d609fb1bc983b2b4edcebe66906020016122af565b60045460ff1661307b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610aaa565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080600b83815481106130e957634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600c82526040808520338652909252922060018101546008929092029092016004810154600584015491945064e8d4a51000916131339190614259565b61313d9190614239565b6131479190614278565b949350505050565b6000828152600c602090815260408083203384529091528120600281015490919060ff16801561318b575060048201546001600160a01b031615155b156131c757620f4240601154846131a29190614259565b6131ac9190614239565b60048301549091506131c7906001600160a01b031682612f29565b6131da336131d58386614278565b612f29565b50505050565b600080600b838154811061320457634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600c8252604080852033865290925290832060078101546008909302909101935091905b83600701548111613297576000868152600e60209081526040808320848452909152902054600584015464e8d4a510009161326f91614259565b6132799190614239565b6132839083614221565b91508061328f816142bb565b915050613235565b5060068201546132a79082614278565b95945050505050565b6000828152600c602090815260408083203384529091528120600281015490919060ff1680156132ec575060048201546001600160a01b031615155b1561332857620f4240601154846133039190614259565b61330d9190614239565b6004830154909150613328906001600160a01b031682613bb9565b6131da336133368386614278565b613bb9565b6040516001600160a01b038316602482015260448101829052612fdf90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613c07565b6000600b82815481106133c157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060080201905060006133e18260030154436122f4565b90508015612fdf576000600f548360010154600954846134019190614259565b61340b9190614259565b6134159190614239565b905080600760008282546134299190614221565b909155505060068301546134428264e8d4a51000614259565b61344c9190614239565b83600401600082825461345f9190614221565b909155505050505050565b6000600b828154811061348d57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600d5460089092020160078101549092505b818110156131da576000600d82815481106134d457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905043816000015411156134f657506131da565b806001015484600301541061350b57506135c1565b600061351f826000015486600301546137ae565b61352d8360010154436137c5565b6135379190614278565b9050600060105486600201548460030154846135539190614259565b61355d9190614259565b6135679190614239565b600687015490915061357e8264e8d4a51000614259565b6135889190614239565b6000888152600e60209081526040808320888452909152812080549091906135b1908490614221565b9091555050505060078401829055505b806135cb816142bb565b9150506134a9565b60006135de83613cd9565b156136625760405163f1ea5cd360e01b8152600481018390526001600160a01b0384169063f1ea5cd39060240160206040518083038186803b15801561362357600080fd5b505afa158015613637573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365b9190613f83565b9050610e4d565b506001610e4d565b600061367583613cd9565b156136f2576040516307fcf89160e11b8152600481018390526001600160a01b03841690630ff9f1229060240160206040518083038186803b1580156136ba57600080fd5b505afa1580156136ce573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365b9190613f04565b50600092915050565b6001600160a01b038116600081815260036020908152604091829020805460ff191660019081179091558251938452908301527f10371af012cb9b724aa336e417b4c7afac0b95642bacca0a85dce4ad1bae4ced91016122af565b60045460ff16156137795760405162461bcd60e51b8152600401610aaa9061418b565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586130a83390565b6000818310156137be5781611ed5565b5090919050565b60008183106137be5781611ed5565b6001600160a01b0381166000818152600360209081526040808320805460ff191690558051938452908301919091527f10371af012cb9b724aa336e417b4c7afac0b95642bacca0a85dce4ad1bae4ced91016122af565b6000600b848154811061384e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600c825260408085203386529092529220600890910290910191506138808484611da4565b6138e65760405162461bcd60e51b815260206004820152603160248201527f4e4654206e6f7420737570706f727465642c206e6f74206f70656e6564206f72604482015270081b9bdb8b595e1a5cdd081cdc1958d259607a1b6064820152608401610aaa565b6005546040516323b872dd60e01b81523360048201526001600160a01b03918216602482015260448101859052908516906323b872dd90606401600060405180830381600087803b15801561393a57600080fd5b505af115801561394e573d6000803e3d6000fd5b50506040518592506001600160a01b03871691507f75545f6382d0aabef706b679ce2782000b9041109764f6774fc711d0854e11f890600090a360028101805460ff19166001179055604051637545e7a560e11b8152600481018490526001600160a01b0385169063ea8bcf4a9060240160206040518083038186803b1580156139d757600080fd5b505afa1580156139eb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0f9190613fb7565b60038201556000613a208585611edc565b6004830180546001600160a01b031916905590506001600160a01b03811615801590613a5557506001600160a01b0381163314155b15613a78576004820180546001600160a01b0319166001600160a01b0383161790555b6000613a8c83600001548460030154610d1c565b90508083600501548560060154613aa39190614278565b613aad9190614221565b6006909401939093555060050155505050565b6040516001600160a01b03808516602483015283166044820152606481018290526131da9085906323b872dd60e01b90608401613367565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b158015613b4457600080fd5b505afa158015613b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b7c9190613fb7565b613b869190614221565b6040516001600160a01b0385166024820152604481018290529091506131da90859063095ea7b360e01b90606401613367565b6000613bc547836137c5565b905080613bd157505050565b6040516001600160a01b0384169082156108fc029083906000818181858888f193505050501580156131da573d6000803e3d6000fd5b6000613c5c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613ded9092919063ffffffff16565b805190915015612fdf5780806020019051810190613c7a9190613f83565b612fdf5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610aaa565b6040516301ffc9a760e01b81526307fcf89160e11b6004820181905260009163f1ea5cd360e01b906001600160a01b038516906301ffc9a79060240160206040518083038186803b158015613d2d57600080fd5b505afa158015613d41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d659190613f83565b801561314757506040516301ffc9a760e01b81526001600160e01b0319821660048201526001600160a01b038516906301ffc9a79060240160206040518083038186803b158015613db557600080fd5b505afa158015613dc9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131479190613f83565b6060613147848460008585843b613e465760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aaa565b600080866001600160a01b03168587604051613e62919061413c565b60006040518083038185875af1925050503d8060008114613e9f576040519150601f19603f3d011682016040523d82523d6000602084013e613ea4565b606091505b50915091506120c982828660608315613ebe575081611ed5565b825115613ece5782518084602001fd5b8160405162461bcd60e51b8152600401610aaa9190614158565b600060208284031215613ef9578081fd5b8135611ed5816142ec565b600060208284031215613f15578081fd5b8151611ed5816142ec565b60008060408385031215613f32578081fd5b8235613f3d816142ec565b91506020830135613f4d81614301565b809150509250929050565b60008060408385031215613f6a578182fd5b8235613f75816142ec565b946020939093013593505050565b600060208284031215613f94578081fd5b8151611ed581614301565b600060208284031215613fb0578081fd5b5035919050565b600060208284031215613fc8578081fd5b5051919050565b60008060408385031215613fe1578182fd5b823591506020830135613f4d816142ec565b60008060408385031215614005578182fd5b823591506020830135613f4d81614301565b60008060408385031215614029578182fd5b50508035926020909101359150565b600080600080600060a0868803121561404f578081fd5b85359450602086013593506040860135614068816142ec565b9250606086013561407881614301565b91506080860135614088816142ec565b809150509295509295909350565b600080600080608085870312156140ab578384fd5b843593506020850135925060408501356140c4816142ec565b9396929550929360600135925050565b600080600080608085870312156140e9578182fd5b843593506020850135925060408501359150606085013561410981614301565b939692955090935050565b600060208284031215614125578081fd5b815167ffffffffffffffff81168114611ed5578182fd5b6000825161414e81846020870161428f565b9190910192915050565b602081526000825180602084015261417781604085016020870161428f565b601f01601f19169190910160400192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115614234576142346142d6565b500190565b60008261425457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614273576142736142d6565b500290565b60008282101561428a5761428a6142d6565b500390565b60005b838110156142aa578181015183820152602001614292565b838111156131da5750506000910152565b60006000198214156142cf576142cf6142d6565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610f1d57600080fd5b8015158114610f1d57600080fdfea26469706673582212206e4291213a858077897d6528278d6c4d91bc77d5f3c8bd11af2858a4c102fa5864736f6c634300080400330000000000000000000000000000000000000000000000000000000000797d9000000000000000000000000017234b45f283635fa29b74515a2869550bc753580000000000000000000000001ecec64957a7f83f90e77bd1b1816ab40df4f615000000000000000000000000aacb683a934a5e1aee846286049f1a5dd38bdfb9

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

0000000000000000000000000000000000000000000000000000000000797d9000000000000000000000000017234b45f283635fa29b74515a2869550bc753580000000000000000000000001ecec64957a7f83f90e77bd1b1816ab40df4f615000000000000000000000000aacb683a934a5e1aee846286049f1a5dd38bdfb9

-----Decoded View---------------
Arg [0] : startBlock_ (uint256): 7962000
Arg [1] : feeWallet_ (address): 0x17234b45f283635fa29b74515a2869550bc75358
Arg [2] : scv_ (address): 0x1ecec64957a7f83f90e77bd1b1816ab40df4f615
Arg [3] : specAddr_ (address): 0xaacb683a934a5e1aee846286049f1a5dd38bdfb9

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000797d90
Arg [1] : 00000000000000000000000017234b45f283635fa29b74515a2869550bc75358
Arg [2] : 0000000000000000000000001ecec64957a7f83f90e77bd1b1816ab40df4f615
Arg [3] : 000000000000000000000000aacb683a934a5e1aee846286049f1a5dd38bdfb9


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