Contract 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 13

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x24a72fa0f1db698d155877f0f166f8e116a4a397fce9d8af0f7850957d22ac07Claim Reward1951357632024-03-28 15:36:092 hrs 8 mins ago0xbc4ff71f3278c125950382bce1aafba1238af288 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000631 0.01
0x885013fae73c6b83daf0993b27b460bf1ac03856eadb478335367c3117455da9Claim Reward1950396812024-03-28 8:54:018 hrs 50 mins ago0x82738b0ebc1d667765cb9cdeb4a2a96da6e6a77a IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000575 0.010315
0xb5a0c62e26924eff11d7159bed01feb6785cb191e7303ab63ee90f1148a794eaClaim Reward1950095782024-03-28 6:48:3810 hrs 56 mins ago0xcdfb2604a29bf2a40606a04c1aba4277522bf29b IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000002180.01
0x39a56bb1417083cf32c5231a6c50c38a908968c42f83243cc5f8b9fcf1d3c037Claim Reward1950094912024-03-28 6:48:1610 hrs 56 mins ago0xcdfb2604a29bf2a40606a04c1aba4277522bf29b IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000003320.01
0x5a59751e31ea1225cfb518c790e2d2396430efd8253750b55eb1bb058e148c1fClaim Reward1950053262024-03-28 6:30:5611 hrs 13 mins ago0x577be3ed9a71e1c355f519bbdf5f09ba2018b1cc IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000210.01
0xdea3db93c6612f626a615c8c52f540847e7f07e8a9878d4027bd4c6c81392c03Claim Reward1948733062024-03-27 21:18:1220 hrs 26 mins ago0xb62a4c53017beebb5f146ce45b1455815c7f9a2a IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000798 0.01
0x6bb00d52f840e50f3876d7da5b2f89282eae4329492eb3d4404bb92ac5800691Exit1945004272024-03-26 19:19:211 day 22 hrs ago0x03d7df7f8060ca54a88a059efbea0028cf807dcb IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000172 0.01
0x29e519272e7c17cd3dab83cefd7a0838c4bae5bebbc91a5e2e4d87245c47a45cClaim Reward1943574632024-03-26 9:22:512 days 8 hrs ago0xbfe4b30e7074fb5033652866d227d7ad911626d1 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000270.01
0x432760c24a8f8464b630a85adece21233e66fa1487044b6f77c964d4949fded3Claim Reward1943571492024-03-26 9:21:322 days 8 hrs ago0xd2e7851dce6ecc9eae7027fe537d5a55e9565f75 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000004680.01
0x21a11985fa8ea58d191b19c86f76b6e1645c7b71c3779b3b1979c06be14d8c5cClaim Reward1943347862024-03-26 7:48:252 days 9 hrs ago0x7ab3e20dc5deb762f6a73e0c3249fa09bc57fc61 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000082 0.01
0x279262436b780959d74fe4cb75f571b911ee376b439dec7e376735a5e7729c15Claim Reward1941051232024-03-25 15:50:283 days 1 hr ago0x4761acdd82da42dd87e1ddcee375708b420ca5db IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000114 0.01
0x11440658ff90febdba20a1b676271ca9dac39253806eb584224334732df128f8Claim Reward1941042392024-03-25 15:46:473 days 1 hr ago0x4761acdd82da42dd87e1ddcee375708b420ca5db IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000398 0.01
0x3d44199a42f1d4b4d1b7b0dc4b901cd21246ea813c117e4b6e0ce6701dab4923Claim Reward1940870622024-03-25 14:35:103 days 3 hrs ago0x0003c33415742f673aad10f27abeb7d490dd8400 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00001623 0.042271
0x51aacc6f155fd19ce96d296fd959a2afd5f68c0dd0886fdd0077b31905c64ff2Claim Reward1939872582024-03-25 7:39:163 days 10 hrs ago0x848f8b6c67f4197a53ae3869d3200fac175a00af IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000004380.01
0x434ebf5e67ab7fab7cdbfe77948878c854e5ec8ec8db5b7425c3782b73c53f8bClaim Reward1939423262024-03-25 4:31:373 days 13 hrs ago0x31ec0546cbf58ce6dd3daa23e27767dd6628dd3e IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000327 0.01
0x5e3136ed4880b16697e865d94fcc95c61be35d46fa9fe1736ee14b4a3b627443Claim Reward1936966732024-03-24 11:25:364 days 6 hrs ago0x4837f53dcd09dca12a4761befad7a2398b96617a IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000002060.01
0x1edb6a15b1d0053fb121b4757c6f5755a7492d73c120f41243bd6b65a6841c2aClaim Reward1934283362024-03-23 16:43:475 days 1 hr ago0xc575b5e473ef412c78deacf11ad57e33e5c2639b IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000193 0.01
0x25207c3d78eb96af9c1bfa2fcf52952c338cd91b8d8f36296f471b6d37de8165Exit1933862132024-03-23 13:47:345 days 3 hrs ago0x77420e96f0e5f1dcfa8fcdd6ba6a3a9d3ad0c6c4 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000001290.01
0xea5856c13597d8b7dbe15ee1e61ece74b1e3978c9da7f3579d750b6e7f95b122Claim Reward1933113292024-03-23 8:35:175 days 9 hrs ago0xde9939e9c22c084f9d0d1d58b7640d6aa9503340 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000474 0.01
0xa456132c3cd3d4abd9cc3e135368139105063f6c02b2643f740c35249977745fClaim Reward1929444232024-03-22 7:03:146 days 10 hrs ago0x577be3ed9a71e1c355f519bbdf5f09ba2018b1cc IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000002920.01
0xd84c1b9f3fcc98e4843e57d0fc322546583842e380449e6e94d0bf7a1510b37eClaim Reward1928230122024-03-21 22:34:086 days 19 hrs ago0x21c74841d8857f88e244ae6e352cb41ab399a7b3 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000251 0.01
0x4e1a8a9d83032244d3e826992d3a525b9c485365441201c2c07811592b10964cClaim Reward1927410072024-03-21 16:50:447 days 53 mins ago0x1ebb73f5f47bcc3d7dc1dabf7284875e3ae40e07 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000003520.01
0xc5c0289c6d923714276888a9a33ea2f2551a3a275e28f03286aa71f4765ee043Claim Reward1925291602024-03-21 2:05:187 days 15 hrs ago0x1c68eb4bbeb66427e8e32f31b4231f1b675dd130 IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000005020.01
0x791e772aa9384af89fff4b9bd81db4a04c05e7eb99a684caa43d7e30d262bcbbClaim Reward1925143562024-03-21 1:03:257 days 16 hrs ago0x8d01ba30016c2ed9abaecf5bfc3124ed5f848ccc IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.000004840.01
0x129aa49c67ad792abe066a8a63b4f0aef6c68ed994cc2b5a416df311580fea1dClaim Reward1922930522024-03-20 9:34:538 days 8 hrs ago0x5d9b79799da858480719ceac013f5e84f7b0f38d IN  0xaefd22d0153e69f3316dca9095e7279b3a2f8af20 ETH0.00000244 0.01
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x48de3eeaeb034ecb036a2b42376df94760ccf34bd9d484b909c892cac370d9b3720696152023-03-21 9:08:32373 days 8 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0x48de3eeaeb034ecb036a2b42376df94760ccf34bd9d484b909c892cac370d9b3720696152023-03-21 9:08:32373 days 8 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0x43d655a018669fb7ffcc6b441000b00b0237d28fdf999e268cae4bf427df400a720630412023-03-21 8:41:44373 days 9 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0x43d655a018669fb7ffcc6b441000b00b0237d28fdf999e268cae4bf427df400a720630412023-03-21 8:41:44373 days 9 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0x59f07c3bafd10af07ef0d878dc4c082e45ee55a01ddc362d5ae2279aefae73a6720626892023-03-21 8:40:16373 days 9 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0x59f07c3bafd10af07ef0d878dc4c082e45ee55a01ddc362d5ae2279aefae73a6720626892023-03-21 8:40:16373 days 9 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xb30d4149008c443cc552c112e1ef27a212725a3487fb9f631dd8e6b42bd11d67720109892023-03-21 5:07:50373 days 12 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xb30d4149008c443cc552c112e1ef27a212725a3487fb9f631dd8e6b42bd11d67720109892023-03-21 5:07:50373 days 12 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0x6cf71a754eefbacda1d59e2db781844d415c55257ffb60849a70614889af79dd719875312023-03-21 3:30:27373 days 14 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 0x569061e2d807881f4a33e1cbe1063bc614cb75a40 ETH
0x8a681ed42a74ee9f5c6ebf053d85a1c8765f81a3769c6e49df2f1342ae6fb555719864892023-03-21 3:26:10373 days 14 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0x8a681ed42a74ee9f5c6ebf053d85a1c8765f81a3769c6e49df2f1342ae6fb555719864892023-03-21 3:26:10373 days 14 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xef0d56dc285f5cd6051eb8cf4ce5513a69e176a4cdfdc92dfef726d2fa6ecf9b719668912023-03-21 2:04:59373 days 15 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xef0d56dc285f5cd6051eb8cf4ce5513a69e176a4cdfdc92dfef726d2fa6ecf9b719668912023-03-21 2:04:59373 days 15 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xde14b536c1dd650ffdd10856b5762ebcce10d4986f0da2b8410fe61a9137ef44719581062023-03-21 1:27:41373 days 16 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xde14b536c1dd650ffdd10856b5762ebcce10d4986f0da2b8410fe61a9137ef44719581062023-03-21 1:27:41373 days 16 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xbb3d9efc58e5d5c1d9fbb494e8f5d0929c2ddee08c19039949529e917594745e719443952023-03-21 0:29:17373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xbb3d9efc58e5d5c1d9fbb494e8f5d0929c2ddee08c19039949529e917594745e719443952023-03-21 0:29:17373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xb1ff20c469cb505fa023e9327a153aa7b688833ddcee0877d9eb451d0e166be5719427792023-03-21 0:22:24373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xb1ff20c469cb505fa023e9327a153aa7b688833ddcee0877d9eb451d0e166be5719427792023-03-21 0:22:24373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0x713cf399fb9d4cce76d9c1c9ef531a6879e07431202f405da26c257e144b3054719424412023-03-21 0:20:56373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 0x569061e2d807881f4a33e1cbe1063bc614cb75a40 ETH
0xe6f6998c47abfba42bed85780d74721a807f7326b0f5f148bcf4b5e233adf360719380142023-03-21 0:01:58373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0xe6f6998c47abfba42bed85780d74721a807f7326b0f5f148bcf4b5e233adf360719380142023-03-21 0:01:58373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0x75ab786987c3aa03a029422d3d7f190f34593a459c07d851db4bfce806591122719365862023-03-20 23:55:53373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Wrapped Ether0 ETH
0x75ab786987c3aa03a029422d3d7f190f34593a459c07d851db4bfce806591122719365862023-03-20 23:55:53373 days 17 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 Y2K Finance: Y2K Token0 ETH
0xd000b8eb123e667d571d38ac04c570f51eb607624d5cccbdbc41a801be8eab4a719149892023-03-20 22:23:21373 days 19 hrs ago 0xaefd22d0153e69f3316dca9095e7279b3a2f8af2 0x569061e2d807881f4a33e1cbe1063bc614cb75a40 ETH
[ Download CSV Export 
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x387AA31840e00e04558e2d667Db53a7dF7AeF4fc
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
LockRewards

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : LockRewards.sol
// SPDX-License-Identifier: MIT 
pragma solidity ^0.8.15;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import "./interfaces/ILockRewards.sol";

/** @title Lock tokens and receive rewards in
 * 2 different tokens
 *  @author gcontarini jocorrei
 *  @notice The locking mechanism is based on epochs.
 * How long each epoch is going to last is up to the
 * contract owner to decide when setting an epoch with
 * the amount of rewards needed. To receive rewards, the
 * funds must be locked before the epoch start and will
 * become claimable at the epoch end. Relocking with 
 * more tokens increases the amount received moving forward.
 * But it also can relock ALL funds for longer periods.
 *  @dev Contract follows a simple owner access control implemented
 * by the Ownable contract. The contract deployer is the owner at 
 * start.
 */
contract LockRewards is ILockRewards, ReentrancyGuard, Ownable, Pausable {
    using SafeERC20 for IERC20;

    /// @dev Account hold all user information 
    mapping(address => Account) public accounts;
    /// @dev Total amount of lockTokes that the contract holds
    uint256 public totalAssets;
    address public lockToken;
    /// @dev Hold all rewardToken information like token address
    RewardToken[2] public rewardToken;
    
    /// @dev If false, allows users to withdraw their tokens before the locking end period
    bool    public enforceTime = true;
    
    /// @dev Hold all epoch information like rewards and balance locked for each user
    mapping(uint256 => Epoch) public epochs;
    uint256 public currentEpoch = 1;
    uint256 public nextUnsetEpoch = 1;
    uint256 public maxEpochs;
    uint256 public minEpochs;

    /// @dev Contract owner can whitelist an ERC20 token and withdraw its funds
    mapping(address => bool) public whitelistRecoverERC20;
    
    /**
     *  @notice maxEpochs can be changed afterwards by the contract owner
     *  @dev Owner is the deployer
     *  @param _lockToken: token address which users can deposit to receive rewards
     *  @param _rewardAddr1: token address used to pay users rewards (Governance token)
     *  @param _rewardAddr2: token address used to pay users rewards (WETH)
     *  @param _maxEpochs: max number of epochs an user can lock its funds 
     *  @param _minEpochs: min number of epochs an user can lock its funds
     */
    constructor(
        address _lockToken,
        address _rewardAddr1,
        address _rewardAddr2,
        uint256 _maxEpochs,
        uint256 _minEpochs
    ) {
        lockToken = _lockToken;
        rewardToken[0].addr  = _rewardAddr1;  
        rewardToken[1].addr  = _rewardAddr2;  
        maxEpochs = _maxEpochs;
        minEpochs = _minEpochs;
    }

    /* ========== VIEWS ========== */
    
    /**
     *  @notice Total deposited for address in lockTokens
     *  @dev Show the total balance, not necessary it's all locked
     *  @param owner: user address
     *  @return balance: total balance of address
     */
    function balanceOf(address owner) external view returns (uint256) {
        return accounts[owner].balance;
    }

    /**
     *  @notice Shows the total of tokens locked in an epoch for an user
     *  @param owner: user address
     *  @param epochId: the epoch number
     *  @return balance: total of tokens locked for an epoch 
     */
    function balanceOfInEpoch(address owner, uint256 epochId) external view returns (uint256) {
        return epochs[epochId].balanceLocked[owner];
    }

    /**
     *  @notice Total assets that contract holds
     *  @dev Not all tokens are actually locked
     *  @return totalAssets: amount of lock Tokens deposit in this contract
     */
    function totalLocked() external view returns (uint256) {
        return totalAssets;
    }

    /**
     *  @notice Show all information for on going epoch
     */
    function getCurrentEpoch() external view returns (
        uint256 start,
        uint256 finish,
        uint256 locked,
        uint256 rewards1,
        uint256 rewards2,
        bool    isSet
    ) {
        return _getEpoch(currentEpoch);
    }

    /**
     *  @notice Show all information for next epoch
     *  @dev If next epoch is not set, return all zeros and nulls
     */
    function getNextEpoch() external view returns (
        uint256 start,
        uint256 finish,
        uint256 locked,
        uint256 rewards1,
        uint256 rewards2,
        bool    isSet
    ) {
        if (currentEpoch == nextUnsetEpoch) 
            return (0, 0, 0, 0, 0, false);
        return _getEpoch(currentEpoch + 1);
    }

    /** 
     *  @notice Show information for a given epoch
     *  @dev Start and finish values are seconds 
     *  @param epochId: number of epoch
     */
    function getEpoch(uint256 epochId) external view returns (
        uint256 start,
        uint256 finish,
        uint256 locked,
        uint256 rewards1,
        uint256 rewards2,
        bool    isSet
    ) {
        return _getEpoch(epochId);
    }
    
    /** 
     *  @notice Show information for an account 
     *  @dev LastEpochPaid tell when was the last epoch in each
     * this accounts was updated, which means receive rewards. 
     *  @param owner: address for account 
     */
    function getAccount(
        address owner
    ) external view returns (
        uint256 balance,
        uint256 lockEpochs,
        uint256 lastEpochPaid,
        uint256 rewards1,
        uint256 rewards2
    ) {
        return _getAccount(owner);
    }

    /** 
     *  @notice Show account info for next epoch payout
     *  @param owner: address for account 
     *  @param epochId: index of epoch 
     */
    function getEpochAccountInfo(
        address owner,
        uint256 epochId
    ) external view returns (
        uint256 balance,
        uint256 start,
        uint256 finish,
        uint256 locked,
        uint256 userRewards1,
        uint256 userRewards2,
        bool isSet
    ) {
        start = epochs[epochId].start; 
        finish= epochs[epochId].finish;
        isSet= epochs[epochId].isSet;
        locked = epochs[epochId].totalLocked;
        uint256 rewards1 = epochs[epochId].rewards1;
        uint256 rewards2 = epochs[epochId].rewards2;

        balance = epochs[epochId].balanceLocked[owner];
        if(balance > 0) {
        uint256 share = balance * 1e18 / locked;

        userRewards1 += share * rewards1 / 1e18;
        userRewards2 += share * rewards2 / 1e18;
        }
    }
    
    /* ========== MUTATIVE FUNCTIONS ========== */

    /**
     *  @notice Update caller account state (grant rewards if available)
     */
    function updateAccount() external whenNotPaused updateEpoch updateReward(msg.sender) returns (
        uint256 balance,
        uint256 lockEpochs,
        uint256 lastEpochPaid,
        uint256 rewards1,
        uint256 rewards2
    ) {
        return _getAccount(msg.sender);
    }

    function updateEpochs() external whenNotPaused updateEpoch {
        // nothing to do
        emit UpdatedEpoch(currentEpoch);
    }

    /**
     *  @notice Deposit tokens to receive rewards.
     * In case of a relock, it will increase the total locked epochs
     * for the total amount of tokens deposited. The contract doesn't
     * allow different unlock periods for same address. Also, all
     * deposits will grant rewards for the next epoch, not the
     * current one if setted by the owner.
     *  @dev Allows relocking by setting amount to zero.
     * To increase amount locked without increasing
     * epochs locked, set lockEpochs to zero.
     *  @param amount: the amount of lock tokens to deposit
     *  @param lockEpochs: how many epochs funds will be locked.
     */
    function deposit(
        uint256 amount,
        uint256 lockEpochs
    ) external nonReentrant whenNotPaused updateEpoch updateReward(msg.sender) {
        if (lockEpochs > maxEpochs) revert LockEpochsMax(maxEpochs);
        if (lockEpochs < minEpochs && lockEpochs != 0) revert LockEpochsMin(minEpochs);
        if( lockEpochs == 0 && accounts[msg.sender].lockEpochs == 0) revert IncreaseLockEpochsNotGTZero();

        IERC20 lToken = IERC20(lockToken);

        uint256 oldLockEpochs = accounts[msg.sender].lockEpochs;
        // Increase lockEpochs for user
        accounts[msg.sender].lockEpochs += lockEpochs;
        
        // This is done to save gas in case of a relock
        // Also, emits a different event for deposit or relock
        if (amount > 0) {
            lToken.safeTransferFrom(msg.sender, address(this), amount);
            totalAssets += amount;
            accounts[msg.sender].balance += amount;
        
            emit Deposit(msg.sender, amount, lockEpochs);
        } else {
            emit Relock(msg.sender, accounts[msg.sender].balance, lockEpochs);
        }
        
        // Check if current epoch is in course
        // Then, set the deposit for the upcoming ones
        uint256 _currEpoch = currentEpoch; 
        uint256 next = epochs[_currEpoch].isSet ? _currEpoch + 1 : _currEpoch;
        if(_currEpoch == 1 && epochs[1].start > block.timestamp ) {
            next = 1;
        }

        // Since all funds will be locked for the same period
        // Update all future lock epochs for this new value
        uint256 lockBoundary;
        if (!epochs[_currEpoch].isSet || oldLockEpochs == 0)
            lockBoundary = accounts[msg.sender].lockEpochs;
        else 
            lockBoundary = accounts[msg.sender].lockEpochs - 1;
        uint256 newBalance = accounts[msg.sender].balance;
        for (uint256 i = 0; i < lockBoundary;) {
            epochs[i + next].totalLocked += newBalance - epochs[i + next].balanceLocked[msg.sender];
            epochs[i + next].balanceLocked[msg.sender] = newBalance;

            unchecked { ++i; }
        }
    }

    /**
     *  @notice Allows withdraw after lockEpochs is zero 
     *  @param amount: tokens to caller receive
     */
    function withdraw(
        uint256 amount
    ) external nonReentrant whenNotPaused updateEpoch updateReward(msg.sender) {
        _withdraw(amount);
    }

    /**
     *  @notice User can receive its claimable rewards 
     */
    function claimReward() external nonReentrant whenNotPaused updateEpoch updateReward(msg.sender) returns(uint256, uint256) {
        return _claim();
    }

    /**
     *  @notice User withdraw all its funds and receive all available rewards 
     *  @dev If user funds it's still locked, all transaction will revert
     */
    function exit() external nonReentrant whenNotPaused updateEpoch updateReward(msg.sender) returns(uint256, uint256) {
        _withdraw(accounts[msg.sender].balance);
        return _claim();
    }

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


    /**
     * @notice Pause contract. Can only be called by the contract owner.
     * @dev If contract is already paused, transaction will revert
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @notice Unpause contract. Can only be called by the contract owner.
     * @dev If contract is already unpaused, transaction will revert
     */
    function unpause() external onlyOwner {
        _unpause();
    }
    
    /**
     *  @notice Set a new epoch. The amount needed of tokens
     * should be transfered before calling setNextEpoch. Can only
     * have 2 epochs set, the on going one and the next.
     *  @dev Can set a start epoch different from now when there's
     * no epoch on going. If there's an epoch on going, can
     * only set the start after the finish of current epoch.
     *  @param reward1: the amount of rewards to be distributed
     * in token 1 for this epoch
     *  @param reward2: the amount of rewards to be distributed
     * in token 2 for this epoch
     *  @param epochDurationInDays: how long the epoch will last
     * in days
     *  @param epochStart: the epoch start date in unix epoch (seconds) 
     */
    function setNextEpoch_start(
        uint256 reward1,
        uint256 reward2,
        uint256 epochDurationInDays,
        uint256 epochStart
    ) external onlyOwner updateEpoch {
        _setEpoch(reward1, reward2, epochDurationInDays, epochStart);
    }

    /**
     *  @notice Set a new epoch. The amount needed of tokens
     * should be transfered before calling setNextEpoch. Can only
     * have 2 epochs set, the on going one and the next.
     *  @dev If epoch is finished and there isn't a new to start,
     * the contract will hold. But in that case, when the next 
     * epoch is set it'll already start (meaning: start will be
     * the current block timestamp).
     *  @param reward1: the amount of rewards to be distributed
     * in token 1 for this epoch
     *  @param reward2: the amount of rewards to be distributed
     * in token 2 for this epoch
     *  @param epochDurationInDays: how long the epoch will last
     * in days
     */
    function setNextEpoch(
        uint256 reward1,
        uint256 reward2,
        uint256 epochDurationInDays
    ) external onlyOwner updateEpoch {
        _setEpoch(reward1, reward2, epochDurationInDays, block.timestamp);
    }
    
    /**
     *  @notice To recover ERC20 sent by accident.
     * All funds are only transfered to contract owner.
     *  @dev To allow a withdraw, first the token must be whitelisted
     *  @param tokenAddress: token to transfer funds
     *  @param tokenAmount: the amount to transfer to owner
     */
    function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
        if (whitelistRecoverERC20[tokenAddress] == false) revert NotWhitelisted();
        
        uint balance = IERC20(tokenAddress).balanceOf(address(this));
        if (balance < tokenAmount) revert InsufficientBalance(); 

        IERC20(tokenAddress).safeTransfer(owner(), tokenAmount);
        emit RecoveredERC20(tokenAddress, tokenAmount);
    }

    /**
     *  @notice  Add or remove a token from recover whitelist,
     * cannot whitelist governance token
     *  @dev Only contract owner are allowed. Emits an event
     * allowing users to perceive the changes in contract rules.
     * The contract allows to whitelist the underlying tokens
     * (both lock token and rewards tokens). This can be exploited
     * by the owner to remove all funds deposited from all users.
     * This is done bacause the owner is mean to be a multisig or
     * treasury wallet from a DAO
     *  @param flag: set true to allow recover
     */
    function changeRecoverWhitelist(address tokenAddress, bool flag) external onlyOwner {
        if (tokenAddress == rewardToken[0].addr) revert CannotWhitelistGovernanceToken(rewardToken[0].addr);
        whitelistRecoverERC20[tokenAddress] = flag;
        emit ChangeERC20Whiltelist(tokenAddress, flag);
    }

    /**
     *  @notice Allows recover for NFTs 
     */
    function recoverERC721(address tokenAddress, uint256 tokenId) external onlyOwner {
        IERC721(tokenAddress).transferFrom(address(this), owner(), tokenId);
        emit RecoveredERC721(tokenAddress, tokenId);
    }

    /**
     *  @notice Allows owner change rule to allow users' withdraw
     * before the lock period is over
     *  @dev In case a major flaw, do this to prevent users from losing
     * their funds. Also, if no more epochs are going to be setted allows 
     * users to withdraw their assets
     *  @param flag: set false to allow withdraws
     */
    function changeEnforceTime(bool flag) external onlyOwner {
        enforceTime = flag;
        emit ChangeEnforceTime(block.timestamp, flag);
    }

    /**
     *  @notice Allows owner to change the max epochs an 
     * user can lock their funds
     *  @param _maxEpochs: new value for maxEpochs
     */
    function changeMaxEpochs(uint256 _maxEpochs) external onlyOwner {
        uint256 oldEpochs = maxEpochs;
        maxEpochs = _maxEpochs;
        emit ChangeMaxLockEpochs(block.timestamp, oldEpochs, _maxEpochs);
    }
    
    /* ========== INTERNAL FUNCTIONS ========== */
    
    /**
     *  @notice Implements internal setEpoch logic
     *  @dev Can only set 2 epochs, the on going and
     * the next one. This has to be done in 2 different
     * transactions.
     *  @param reward1: the amount of rewards to be distributed
     * in token 1 for this epoch
     *  @param reward2: the amount of rewards to be distributed
     * in token 2 for this epoch
     *  @param epochDurationInDays: how long the epoch will last
     * in days
     *  @param epochStart: the epoch start date in unix epoch (seconds) 
     */
    function _setEpoch(
        uint256 reward1,
        uint256 reward2,
        uint256 epochDurationInDays,
        uint256 epochStart
    ) internal {
        if (nextUnsetEpoch - currentEpoch > 1)
            revert EpochMaxReached(2);
        if (epochStart < block.timestamp)
            revert EpochStartInvalid(epochStart, block.timestamp);

        uint256[2] memory rewards = [reward1, reward2];

        for (uint256 i = 0; i < 2;) {
            uint256 unclaimed = rewardToken[i].rewards - rewardToken[i].rewardsPaid;
            uint256 balance = IERC20(rewardToken[i].addr).balanceOf(address(this));
            
            if (balance - unclaimed < rewards[i])
                revert InsufficientFundsForRewards(rewardToken[i].addr, balance - unclaimed, rewards[i]);
            
            rewardToken[i].rewards += rewards[i];

            unchecked { ++i; }
        }
        
        uint256 next = nextUnsetEpoch;
        
        if (currentEpoch == next || epochStart > epochs[next - 1].finish + 1) {
            epochs[next].start = epochStart;
        } else {
            epochs[next].start = epochs[next - 1].finish + 1;
        }
        epochs[next].finish = epochs[next].start + (epochDurationInDays * 86400); // Seconds in a day

        epochs[next].rewards1 = reward1;
        epochs[next].rewards2 = reward2;
        epochs[next].isSet = true;
        
        nextUnsetEpoch += 1;
        emit SetNextReward(next, reward1, reward2, epochs[next].start, epochs[next].finish);
    }
    
    /**
     *  @notice Implements internal withdraw logic
     *  @dev The withdraw is always done in name 
     * of caller for caller
     *  @param amount: amount of tokens to withdraw
     */
    function _withdraw(uint256 amount) internal {
        if (amount == 0 || accounts[msg.sender].balance < amount) revert InsufficientAmount();
        if (accounts[msg.sender].lockEpochs > 0 && enforceTime) revert FundsInLockPeriod(accounts[msg.sender].balance);

        IERC20(lockToken).safeTransfer(msg.sender, amount);
        totalAssets -= amount;
        accounts[msg.sender].balance -= amount;
        emit Withdrawn(msg.sender, amount);
    }

    /**
     *  @notice Implements internal claim rewards logic
     *  @dev The claim is always done in name 
     * of caller for caller
     *  @return amount of rewards transfer in token 1
     *  @return amount of rewards transfer in token 2
     */
    function _claim() internal returns(uint256, uint256) {
        uint256 reward1 = accounts[msg.sender].rewards1;
        uint256 reward2 = accounts[msg.sender].rewards2;

        if (reward1 > 0) {
            accounts[msg.sender].rewards1 = 0;
            IERC20(rewardToken[0].addr).safeTransfer(msg.sender, reward1);
            emit RewardPaid(msg.sender, rewardToken[0].addr, reward1);
        }
        if (reward2 > 0) {
            accounts[msg.sender].rewards2 = 0;
            IERC20(rewardToken[1].addr).safeTransfer(msg.sender, reward2);
            emit RewardPaid(msg.sender, rewardToken[1].addr, reward2);
        }
        return (reward1, reward2);
    }
    
    /**
     *  @notice Implements internal getAccount logic
     *  @param owner: address to check information§
     */
    function _getAccount(
        address owner
    ) internal view returns (
        uint256 balance,
        uint256 lockEpochs,
        uint256 lastEpochPaid,
        uint256 rewards1,
        uint256 rewards2
    ) {
        return (
            accounts[owner].balance,
            accounts[owner].lockEpochs,
            accounts[owner].lastEpochPaid,
            accounts[owner].rewards1,
            accounts[owner].rewards2
        );
    }
    
    /**
     *  @notice Implements internal getEpoch logic
     *  @param epochId: the number of the epoch
     */
    function _getEpoch(uint256 epochId) internal view returns (
        uint256 start,
        uint256 finish,
        uint256 locked,
        uint256 rewards1,
        uint256 rewards2,
        bool    isSet
    ) {
        return (
            epochs[epochId].start, 
            epochs[epochId].finish,
            epochs[epochId].totalLocked,
            epochs[epochId].rewards1,
            epochs[epochId].rewards2,
            epochs[epochId].isSet
            );
    }

    /* ========== MODIFIERS ========== */
    
    modifier updateEpoch {
        uint256 current = currentEpoch;

        while (epochs[current].finish <= block.timestamp && epochs[current].isSet == true)
            current++;
        currentEpoch = current;
        _;
    }

    modifier updateReward(address owner) {
        uint256 current = currentEpoch;
        uint256 lockEpochs = accounts[owner].lockEpochs;
        uint256 lastEpochPaid = accounts[owner].lastEpochPaid;
        
        // Solve edge case for first epoch
        // since epochs starts on value 1
        if (lastEpochPaid == 0) {
            accounts[owner].lastEpochPaid = 1;
            ++lastEpochPaid;
        }

        uint256 rewardPaid1 = 0;
        uint256 rewardPaid2 = 0;
        uint256 locks = 0;

        uint256 limit = lastEpochPaid + lockEpochs; 
        if (limit > current)
            limit = current;

        for (uint256 i = lastEpochPaid; i < limit;) {
            if (epochs[i].balanceLocked[owner] == 0) {
                unchecked { ++i; }
                continue;
            }

            uint256 share = epochs[i].balanceLocked[owner] * 1e18 / epochs[i].totalLocked;

            rewardPaid1 += share * epochs[i].rewards1 / 1e18;
            rewardPaid2 += share * epochs[i].rewards2 / 1e18;
            
            unchecked { ++locks; ++i; }
        }
        rewardToken[0].rewardsPaid += rewardPaid1;
        rewardToken[1].rewardsPaid += rewardPaid2;

        accounts[owner].rewards1 += rewardPaid1;
        accounts[owner].rewards2 += rewardPaid2;
        
        accounts[owner].lockEpochs -= locks;

        if (lastEpochPaid != current)
            accounts[owner].lastEpochPaid = current;
        _;
    }
}

File 2 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.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'
        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));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

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`.
     *
     * 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;

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

File 4 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

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 making 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 5 of 12 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

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 Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        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 6 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 7 of 12 : ILockRewards.sol
// SPDX-License-Identifier: MIT 
pragma solidity ^0.8.15;

interface ILockRewards {
    // Functions
    function balanceOf(address owner) external view returns (uint256);
    function balanceOfInEpoch(address owner, uint256 epochId) external view returns (uint256);
    function totalLocked() external view returns (uint256);
    function getCurrentEpoch() external view returns (uint256 start, uint256 finish, uint256 locked, uint256 rewards1, uint256 rewards2, bool isSet);
    function getNextEpoch() external view returns (uint256 start, uint256 finish, uint256 locked, uint256 rewards1, uint256 rewards2, bool isSet);
    function getEpoch(uint256 epochId) external view returns (uint256 start, uint256 finish, uint256 locked, uint256 rewards1, uint256 rewards2, bool isSet);
    function getAccount(address owner) external view returns (uint256 balance, uint256 lockEpochs, uint256 lastEpochPaid, uint256 rewards1, uint256 rewards2);
    function getEpochAccountInfo(address owner, uint256 epochId) external view returns (uint256 balance, uint256 start, uint256 finish, uint256 locked, uint256 userRewards1, uint256 userRewards2, bool isSet);
    function updateAccount() external returns (uint256 balance, uint256 lockEpochs, uint256 lastEpochPaid, uint256 rewards1, uint256 rewards2);
    function deposit(uint256 amount, uint256 lockEpochs) external;
    function withdraw(uint256 amount) external;
    function claimReward() external returns(uint256, uint256);
    function exit() external returns(uint256, uint256);
    function setNextEpoch(uint256 reward1, uint256 reward2, uint256 epochDurationInDays) external;
    function setNextEpoch_start(uint256 reward1, uint256 reward2, uint256 epochDurationInDays, uint epochStart) external;
    function recoverERC20(address tokenAddress, uint256 tokenAmount) external;
    function changeRecoverWhitelist(address tokenAddress, bool flag) external;
    function recoverERC721(address tokenAddress, uint256 tokenId) external;
    function changeEnforceTime(bool flag) external;
    function changeMaxEpochs(uint256 _maxEpochs) external;
    
    // Events
    event Deposit(address indexed user, uint256 amount, uint256 lockedEpochs);
    event Relock(address indexed user, uint256 totalBalance, uint256 lockedEpochs);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, address token, uint256 reward);
    event SetNextReward(uint256 indexed epochId, uint256 reward1, uint256 reward2, uint256 start, uint256 finish);
    event RecoveredERC20(address token, uint256 amount);
    event RecoveredERC721(address token, uint256 tokenId);
    event ChangeERC20Whiltelist(address token, bool tokenState);
    event ChangeEnforceTime(uint256 indexed currentTime, bool flag);
    event ChangeMaxLockEpochs(uint256 indexed currentTime, uint256 oldEpochs, uint256 newEpochs);
    event UpdatedEpoch(uint currentId);
    // Errors
    error InsufficientAmount();
    error InsufficientBalance();
    error FundsInLockPeriod(uint256 balance);
    error InsufficientFundsForRewards(address token, uint256 available, uint256 rewardAmount);
    error LockEpochsMax(uint256 maxEpochs);
    error LockEpochsMin(uint256 minEpochs);
    error NotWhitelisted();
    error CannotWhitelistGovernanceToken(address governanceToken);
    error EpochMaxReached(uint256 maxEpochs);
    error EpochStartInvalid(uint256 epochStart, uint256 now);
    error IncreaseLockEpochsNotGTZero();
    
    // Structs
    struct Account {
        uint256 balance;
        uint256 lockEpochs;
        uint256 lastEpochPaid;
        uint256 rewards1;
        uint256 rewards2;
    }

    struct Epoch {
        mapping(address => uint256) balanceLocked;
        uint256 start;
        uint256 finish;
        uint256 totalLocked;
        uint256 rewards1;
        uint256 rewards2;
        bool    isSet;
    }

    struct RewardToken {
        address addr;
        uint256 rewards;
        uint256 rewardsPaid;
    }
}

File 8 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev 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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 9 of 12 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 10 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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");

        (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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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);
}

File 12 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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) {
        return msg.data;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lockToken","type":"address"},{"internalType":"address","name":"_rewardAddr1","type":"address"},{"internalType":"address","name":"_rewardAddr2","type":"address"},{"internalType":"uint256","name":"_maxEpochs","type":"uint256"},{"internalType":"uint256","name":"_minEpochs","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"governanceToken","type":"address"}],"name":"CannotWhitelistGovernanceToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxEpochs","type":"uint256"}],"name":"EpochMaxReached","type":"error"},{"inputs":[{"internalType":"uint256","name":"epochStart","type":"uint256"},{"internalType":"uint256","name":"now","type":"uint256"}],"name":"EpochStartInvalid","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"FundsInLockPeriod","type":"error"},{"inputs":[],"name":"IncreaseLockEpochsNotGTZero","type":"error"},{"inputs":[],"name":"InsufficientAmount","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"InsufficientFundsForRewards","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxEpochs","type":"uint256"}],"name":"LockEpochsMax","type":"error"},{"inputs":[{"internalType":"uint256","name":"minEpochs","type":"uint256"}],"name":"LockEpochsMin","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"tokenState","type":"bool"}],"name":"ChangeERC20Whiltelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"currentTime","type":"uint256"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"ChangeEnforceTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"currentTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldEpochs","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newEpochs","type":"uint256"}],"name":"ChangeMaxLockEpochs","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockedEpochs","type":"uint256"}],"name":"Deposit","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":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RecoveredERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RecoveredERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockedEpochs","type":"uint256"}],"name":"Relock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"finish","type":"uint256"}],"name":"SetNextReward","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":"currentId","type":"uint256"}],"name":"UpdatedEpoch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accounts","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockEpochs","type":"uint256"},{"internalType":"uint256","name":"lastEpochPaid","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"balanceOfInEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"flag","type":"bool"}],"name":"changeEnforceTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxEpochs","type":"uint256"}],"name":"changeMaxEpochs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"changeRecoverWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockEpochs","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enforceTime","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochs","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"finish","type":"uint256"},{"internalType":"uint256","name":"totalLocked","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"},{"internalType":"bool","name":"isSet","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getAccount","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockEpochs","type":"uint256"},{"internalType":"uint256","name":"lastEpochPaid","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"finish","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"},{"internalType":"bool","name":"isSet","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"getEpoch","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"finish","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"},{"internalType":"bool","name":"isSet","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"getEpochAccountInfo","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"finish","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"userRewards1","type":"uint256"},{"internalType":"uint256","name":"userRewards2","type":"uint256"},{"internalType":"bool","name":"isSet","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextEpoch","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"finish","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"},{"internalType":"bool","name":"isSet","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextUnsetEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"recoverERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardToken","outputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"rewards","type":"uint256"},{"internalType":"uint256","name":"rewardsPaid","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward1","type":"uint256"},{"internalType":"uint256","name":"reward2","type":"uint256"},{"internalType":"uint256","name":"epochDurationInDays","type":"uint256"}],"name":"setNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward1","type":"uint256"},{"internalType":"uint256","name":"reward2","type":"uint256"},{"internalType":"uint256","name":"epochDurationInDays","type":"uint256"},{"internalType":"uint256","name":"epochStart","type":"uint256"}],"name":"setNextEpoch_start","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateAccount","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockEpochs","type":"uint256"},{"internalType":"uint256","name":"lastEpochPaid","type":"uint256"},{"internalType":"uint256","name":"rewards1","type":"uint256"},{"internalType":"uint256","name":"rewards2","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateEpochs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistRecoverERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102325760003560e01c80638980f11f11610130578063bca7a9e2116100b8578063e746a3611161007c578063e746a36114610663578063e9fad8ee14610681578063efe97d05146106a0578063f2fde38b146106c3578063fbcbc0f1146106df57610232565b8063bca7a9e2146105a2578063c6b61e4c146105c0578063cfc9b09c146105f5578063e2bbb1581461062b578063e32fb1201461064757610232565b806399dfb8dc116100ff57806399dfb8dc146104f15780639ce88a2b1461050f578063b88a802f1461052b578063b97dd9e21461054a578063bc0bc6ba1461056d57610232565b80638980f11f1461047d5780638da5cb5b146104995780638daf78af146104b7578063901643e9146104e757610232565b80635bb2a6c5116101be578063715018a611610182578063715018a614610411578063766718081461041b5780637e6547c314610439578063819d4cc6146104575780638456cb591461047357610232565b80635bb2a6c5146103515780635c975abb1461036d5780635e5c06e21461038b57806369995128146103bf57806370a08231146103e157610232565b8063256399cd11610205578063256399cd146102bf5780632e1a7d4d146102db5780633f4ba83a146102f7578063509b6c3f14610301578063568914121461033357610232565b806301e1d114146102375780630b21744e146102555780630fb7719e1461027357806321c3f616146102a3575b600080fd5b61023f610713565b60405161024c919061469f565b60405180910390f35b61025d610719565b60405161026a919061469f565b60405180910390f35b61028d60048036038101906102889190614749565b61071f565b60405161029a919061469f565b60405180910390f35b6102bd60048036038101906102b89190614789565b61077d565b005b6102d960048036038101906102d49190614828565b61080c565b005b6102f560048036038101906102f09190614855565b610869565b005b6102ff610dba565b005b61031b60048036038101906103169190614855565b610dcc565b60405161032a93929190614891565b60405180910390f35b61033b610e1c565b604051610348919061469f565b60405180910390f35b61036b60048036038101906103669190614855565b610e26565b005b610375610e7a565b60405161038291906148d7565b60405180910390f35b6103a560048036038101906103a091906148f2565b610e91565b6040516103b695949392919061491f565b60405180910390f35b6103c7610ec7565b6040516103d895949392919061491f565b60405180910390f35b6103fb60048036038101906103f691906148f2565b6113d9565b604051610408919061469f565b60405180910390f35b610419611425565b005b610423611439565b604051610430919061469f565b60405180910390f35b61044161143f565b60405161044e919061469f565b60405180910390f35b610471600480360381019061046c9190614749565b611445565b005b61047b611500565b005b61049760048036038101906104929190614749565b611512565b005b6104a16116cc565b6040516104ae9190614972565b60405180910390f35b6104d160048036038101906104cc91906148f2565b6116f6565b6040516104de91906148d7565b60405180910390f35b6104ef611716565b005b6104f96117ce565b60405161050691906148d7565b60405180910390f35b6105296004803603810190610524919061498d565b6117e1565b005b61053361186f565b6040516105419291906149e0565b60405180910390f35b610552611dc7565b60405161056496959493929190614a09565b60405180910390f35b61058760048036038101906105829190614855565b611def565b60405161059996959493929190614a09565b60405180910390f35b6105aa611e16565b6040516105b79190614972565b60405180910390f35b6105da60048036038101906105d59190614855565b611e3c565b6040516105ec96959493929190614a09565b60405180910390f35b61060f600480360381019061060a9190614749565b611e85565b6040516106229796959493929190614a6a565b60405180910390f35b61064560048036038101906106409190614ad9565b612021565b005b610661600480360381019061065c9190614b19565b612b9b565b005b61066b612d1f565b604051610678919061469f565b60405180910390f35b610689612d25565b6040516106979291906149e0565b60405180910390f35b6106a86132c8565b6040516106ba96959493929190614a09565b60405180910390f35b6106dd60048036038101906106d891906148f2565b613322565b005b6106f960048036038101906106f491906148f2565b6133a5565b60405161070a95949392919061491f565b60405180910390f35b60035481565b600f5481565b6000600c600083815260200190815260200160002060000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107856133c9565b6000600d5490505b42600c600083815260200190815260200160002060020154111580156107da575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b156107f25780806107ea90614b88565b91505061078d565b80600d8190555061080585858585613447565b5050505050565b6108146133c9565b80600b60006101000a81548160ff021916908315150217905550427f97626772d0df3585db34af437b81fad1b55eeb3d36998702f3ca251da12b29618260405161085e91906148d7565b60405180910390a250565b6002600054036108ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a590614c2d565b60405180910390fd5b60026000819055506108be613915565b6000600d5490505b42600c60008381526020019081526020016000206002015411158015610913575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b1561092b57808061092390614b88565b9150506108c6565b80600d81905550336000600d5490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905060008103610a25576001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555080610a2290614b88565b90505b6000806000808585610a379190614c4d565b905086811115610a45578690505b60008590505b81811015610bdc576000600c600083815260200190815260200160002060000160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610ab957806001019050610bd7565b6000600c600083815260200190815260200160002060030154670de0b6b3a7640000600c600085815260200190815260200160002060000160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b399190614ca3565b610b439190614d2c565b9050670de0b6b3a7640000600c60008481526020019081526020016000206004015482610b709190614ca3565b610b7a9190614d2c565b86610b859190614c4d565b9550670de0b6b3a7640000600c60008481526020019081526020016000206005015482610bb29190614ca3565b610bbc9190614d2c565b85610bc79190614c4d565b9450836001019350816001019150505b610a4b565b50836005600060028110610bf357610bf2614d5d565b5b600302016002016000828254610c099190614c4d565b92505081905550826005600160028110610c2657610c25614d5d565b5b600302016002016000828254610c3c9190614c4d565b9250508190555083600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254610c959190614c4d565b9250508190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254610cee9190614c4d565b9250508190555081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254610d479190614d8c565b92505081905550868514610d9d5786600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b610da68a61395f565b505050505050505050600160008190555050565b610dc26133c9565b610dca613bd8565b565b60058160028110610ddc57600080fd5b600302016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154905083565b6000600354905090565b610e2e6133c9565b6000600f54905081600f81905550427f0e210cbca35ce5c19fd3bb43bdfc98855016f4e203b162eb5246e9037a509a368284604051610e6e9291906149e0565b60405180910390a25050565b6000600160149054906101000a900460ff16905090565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154905085565b6000806000806000610ed7613915565b6000600d5490505b42600c60008381526020019081526020016000206002015411158015610f2c575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b15610f44578080610f3c90614b88565b915050610edf565b80600d81905550336000600d5490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490506000810361103e576001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508061103b90614b88565b90505b60008060008085856110509190614c4d565b90508681111561105e578690505b60008590505b818110156111f5576000600c600083815260200190815260200160002060000160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036110d2578060010190506111f0565b6000600c600083815260200190815260200160002060030154670de0b6b3a7640000600c600085815260200190815260200160002060000160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111529190614ca3565b61115c9190614d2c565b9050670de0b6b3a7640000600c600084815260200190815260200160002060040154826111899190614ca3565b6111939190614d2c565b8661119e9190614c4d565b9550670de0b6b3a7640000600c600084815260200190815260200160002060050154826111cb9190614ca3565b6111d59190614d2c565b856111e09190614c4d565b9450836001019350816001019150505b611064565b5083600560006002811061120c5761120b614d5d565b5b6003020160020160008282546112229190614c4d565b9250508190555082600560016002811061123f5761123e614d5d565b5b6003020160020160008282546112559190614c4d565b9250508190555083600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282546112ae9190614c4d565b9250508190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282546113079190614c4d565b9250508190555081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282546113609190614d8c565b925050819055508685146113b65786600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b6113bf33613c3b565b9d509d509d509d509d505050505050505050509091929394565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b61142d6133c9565b6114376000613da5565b565b600d5481565b60105481565b61144d6133c9565b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd306114726116cc565b846040518463ffffffff1660e01b815260040161149193929190614dc0565b600060405180830381600087803b1580156114ab57600080fd5b505af11580156114bf573d6000803e3d6000fd5b505050507f57519b6a0997d7d44511836bcee0a36871aa79d445816f6c464abb0cd9d3f3e882826040516114f4929190614df7565b60405180910390a15050565b6115086133c9565b611510613e6b565b565b61151a6133c9565b60001515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515036115a4576040517f584a793800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016115df9190614972565b602060405180830381865afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116209190614e35565b90508181101561165c576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61168e6116676116cc565b838573ffffffffffffffffffffffffffffffffffffffff16613ecd9092919063ffffffff16565b7f55350610fe57096d8c0ffa30beede987326bccfcb0b4415804164d0dd50ce8b183836040516116bf929190614df7565b60405180910390a1505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60116020528060005260406000206000915054906101000a900460ff1681565b61171e613915565b6000600d5490505b42600c60008381526020019081526020016000206002015411158015611773575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b1561178b57808061178390614b88565b915050611726565b80600d819055507f6a6305f993b15b9f94089151e64277bf23935bf751f70b65dd951e890e0cc3b1600d546040516117c3919061469f565b60405180910390a150565b600b60009054906101000a900460ff1681565b6117e96133c9565b6000600d5490505b42600c6000838152602001908152602001600020600201541115801561183e575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b1561185657808061184e90614b88565b9150506117f1565b80600d8190555061186984848442613447565b50505050565b6000806002600054036118b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ae90614c2d565b60405180910390fd5b60026000819055506118c7613915565b6000600d5490505b42600c6000838152602001908152602001600020600201541115801561191c575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b1561193457808061192c90614b88565b9150506118cf565b80600d81905550336000600d5490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905060008103611a2e576001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555080611a2b90614b88565b90505b6000806000808585611a409190614c4d565b905086811115611a4e578690505b60008590505b81811015611be5576000600c600083815260200190815260200160002060000160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403611ac257806001019050611be0565b6000600c600083815260200190815260200160002060030154670de0b6b3a7640000600c600085815260200190815260200160002060000160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b429190614ca3565b611b4c9190614d2c565b9050670de0b6b3a7640000600c60008481526020019081526020016000206004015482611b799190614ca3565b611b839190614d2c565b86611b8e9190614c4d565b9550670de0b6b3a7640000600c60008481526020019081526020016000206005015482611bbb9190614ca3565b611bc59190614d2c565b85611bd09190614c4d565b9450836001019350816001019150505b611a54565b50836005600060028110611bfc57611bfb614d5d565b5b600302016002016000828254611c129190614c4d565b92505081905550826005600160028110611c2f57611c2e614d5d565b5b600302016002016000828254611c459190614c4d565b9250508190555083600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254611c9e9190614c4d565b9250508190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254611cf79190614c4d565b9250508190555081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254611d509190614d8c565b92505081905550868514611da65786600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b611dae613f53565b9a509a5050505050505050505060016000819055509091565b600080600080600080611ddb600d5461427a565b955095509550955095509550909192939495565b600080600080600080611e018761427a565b95509550955095509550955091939550919395565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090508060010154908060020154908060030154908060040154908060050154908060060160009054906101000a900460ff16905086565b6000806000806000806000600c6000898152602001908152602001600020600101549550600c6000898152602001908152602001600020600201549450600c600089815260200190815260200160002060060160009054906101000a900460ff169050600c60008981526020019081526020016000206003015493506000600c60008a81526020019081526020016000206004015490506000600c60008b8152602001908152602001600020600501549050600c60008b815260200190815260200160002060000160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549850600089111561201357600086670de0b6b3a76400008b611fad9190614ca3565b611fb79190614d2c565b9050670de0b6b3a76400008382611fce9190614ca3565b611fd89190614d2c565b86611fe39190614c4d565b9550670de0b6b3a76400008282611ffa9190614ca3565b6120049190614d2c565b8561200f9190614c4d565b9450505b505092959891949750929550565b600260005403612066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205d90614c2d565b60405180910390fd5b6002600081905550612076613915565b6000600d5490505b42600c600083815260200190815260200160002060020154111580156120cb575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b156120e35780806120db90614b88565b91505061207e565b80600d81905550336000600d5490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050600081036121dd576001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550806121da90614b88565b90505b60008060008085856121ef9190614c4d565b9050868111156121fd578690505b60008590505b81811015612394576000600c600083815260200190815260200160002060000160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036122715780600101905061238f565b6000600c600083815260200190815260200160002060030154670de0b6b3a7640000600c600085815260200190815260200160002060000160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122f19190614ca3565b6122fb9190614d2c565b9050670de0b6b3a7640000600c600084815260200190815260200160002060040154826123289190614ca3565b6123329190614d2c565b8661233d9190614c4d565b9550670de0b6b3a7640000600c6000848152602001908152602001600020600501548261236a9190614ca3565b6123749190614d2c565b8561237f9190614c4d565b9450836001019350816001019150505b612203565b508360056000600281106123ab576123aa614d5d565b5b6003020160020160008282546123c19190614c4d565b925050819055508260056001600281106123de576123dd614d5d565b5b6003020160020160008282546123f49190614c4d565b9250508190555083600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825461244d9190614c4d565b9250508190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282546124a69190614c4d565b9250508190555081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282546124ff9190614d8c565b925050819055508685146125555786600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b600f548a111561259e57600f546040517f67b161d9000000000000000000000000000000000000000000000000000000008152600401612595919061469f565b60405180910390fd5b6010548a1080156125b0575060008a14155b156125f4576010546040517fb172f0dd0000000000000000000000000000000000000000000000000000000081526004016125eb919061469f565b60405180910390fd5b60008a14801561264657506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154145b1561267d576040517f5ccc05ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490508b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825461273d9190614c4d565b9250508190555060008d11156128415761277a33308f8573ffffffffffffffffffffffffffffffffffffffff1661432f909392919063ffffffff16565b8c6003600082825461278c9190614c4d565b925050819055508c600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282546127e59190614c4d565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158e8e6040516128349291906149e0565b60405180910390a26128d4565b3373ffffffffffffffffffffffffffffffffffffffff167f732bb053e7a01aa5bdddd99623a4babbb36177debb85cff06592a420c4270a7d600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548e6040516128cb9291906149e0565b60405180910390a25b6000600d5490506000600c600083815260200190815260200160002060060160009054906101000a900460ff1661290b5781612919565b6001826129189190614c4d565b5b9050600182148015612941575042600c60006001815260200190815260200160002060010154115b1561294b57600190505b6000600c600084815260200190815260200160002060060160009054906101000a900460ff16158061297d5750600084145b156129cc57600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050612a1e565b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154612a1b9190614d8c565b90505b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154905060005b82811015612b7f57600c60008583612a809190614c4d565b815260200190815260200160002060000160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612ada9190614d8c565b600c60008684612aea9190614c4d565b81526020019081526020016000206003016000828254612b0a9190614c4d565b9250508190555081600c60008684612b229190614c4d565b815260200190815260200160002060000160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001019050612a68565b5050505050505050505050505050505060016000819055505050565b612ba36133c9565b6005600060028110612bb857612bb7614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612c8b576005600060028110612c2757612c26614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040517fab03cfc8000000000000000000000000000000000000000000000000000000008152600401612c829190614972565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f72131619bbb217e78b2690a418146a852904ec241faf022ceda0a138283926598282604051612d13929190614e62565b60405180910390a15050565b600e5481565b600080600260005403612d6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d6490614c2d565b60405180910390fd5b6002600081905550612d7d613915565b6000600d5490505b42600c60008381526020019081526020016000206002015411158015612dd2575060011515600c600083815260200190815260200160002060060160009054906101000a900460ff161515145b15612dea578080612de290614b88565b915050612d85565b80600d81905550336000600d5490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905060008103612ee4576001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555080612ee190614b88565b90505b6000806000808585612ef69190614c4d565b905086811115612f04578690505b60008590505b8181101561309b576000600c600083815260200190815260200160002060000160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403612f7857806001019050613096565b6000600c600083815260200190815260200160002060030154670de0b6b3a7640000600c600085815260200190815260200160002060000160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ff89190614ca3565b6130029190614d2c565b9050670de0b6b3a7640000600c6000848152602001908152602001600020600401548261302f9190614ca3565b6130399190614d2c565b866130449190614c4d565b9550670de0b6b3a7640000600c600084815260200190815260200160002060050154826130719190614ca3565b61307b9190614d2c565b856130869190614c4d565b9450836001019350816001019150505b612f0a565b508360056000600281106130b2576130b1614d5d565b5b6003020160020160008282546130c89190614c4d565b925050819055508260056001600281106130e5576130e4614d5d565b5b6003020160020160008282546130fb9190614c4d565b9250508190555083600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282546131549190614c4d565b9250508190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282546131ad9190614c4d565b9250508190555081600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282546132069190614d8c565b9250508190555086851461325c5786600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b6132a7600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461395f565b6132af613f53565b9a509a5050505050505050505060016000819055509091565b600080600080600080600e54600d54036132f65760008060008060008095509550955095509550955061331a565b61330d6001600d546133089190614c4d565b61427a565b9550955095509550955095505b909192939495565b61332a6133c9565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161339090614efd565b60405180910390fd5b6133a281613da5565b50565b60008060008060006133b686613c3b565b9450945094509450945091939590929450565b6133d16143b8565b73ffffffffffffffffffffffffffffffffffffffff166133ef6116cc565b73ffffffffffffffffffffffffffffffffffffffff1614613445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161343c90614f69565b60405180910390fd5b565b6001600d54600e546134599190614d8c565b111561349d5760026040517f3ef3dda20000000000000000000000000000000000000000000000000000000081526004016134949190614fce565b60405180910390fd5b428110156134e45780426040517f230303bd0000000000000000000000000000000000000000000000000000000081526004016134db9291906149e0565b60405180910390fd5b6000604051806040016040528086815260200185815250905060005b60028110156137265760006005826002811061351f5761351e614d5d565b5b60030201600201546005836002811061353b5761353a614d5d565b5b600302016001015461354d9190614d8c565b905060006005836002811061356557613564614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016135c59190614972565b602060405180830381865afa1580156135e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136069190614e35565b905083836002811061361b5761361a614d5d565b5b6020020151828261362c9190614d8c565b10156136d0576005836002811061364657613645614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828261367a9190614d8c565b85856002811061368d5761368c614d5d565b5b60200201516040517f25ae95020000000000000000000000000000000000000000000000000000000081526004016136c793929190614891565b60405180910390fd5b8383600281106136e3576136e2614d5d565b5b6020020151600584600281106136fc576136fb614d5d565b5b6003020160010160008282546137129190614c4d565b925050819055508260010192505050613500565b506000600e54905080600d54148061376b57506001600c600060018461374c9190614d8c565b8152602001908152602001600020600201546137689190614c4d565b83115b156137905782600c6000838152602001908152602001600020600101819055506137da565b6001600c60006001846137a39190614d8c565b8152602001908152602001600020600201546137bf9190614c4d565b600c6000838152602001908152602001600020600101819055505b62015180846137e99190614ca3565b600c60008381526020019081526020016000206001015461380a9190614c4d565b600c60008381526020019081526020016000206002018190555085600c60008381526020019081526020016000206004018190555084600c6000838152602001908152602001600020600501819055506001600c600083815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506001600e600082825461389c9190614c4d565b92505081905550807f635e25c995593866243dcfac408047d4d65bfd01e25fb32f6c694b0e0976ff788787600c600086815260200190815260200160002060010154600c6000878152602001908152602001600020600201546040516139059493929190614fe9565b60405180910390a2505050505050565b61391d610e7a565b1561395d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139549061507a565b60405180910390fd5b565b60008114806139af575080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154105b156139e6576040517f5945ea5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154118015613a445750600b60009054906101000a900460ff165b15613ac857600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546040517fb19e6e26000000000000000000000000000000000000000000000000000000008152600401613abf919061469f565b60405180910390fd5b613b153382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613ecd9092919063ffffffff16565b8060036000828254613b279190614d8c565b9250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254613b809190614d8c565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d582604051613bcd919061469f565b60405180910390a250565b613be06143c0565b6000600160146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613c246143b8565b604051613c319190614972565b60405180910390a1565b6000806000806000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401549450945094509450945091939590929450565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b613e73613915565b60018060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613eb66143b8565b604051613ec39190614972565b60405180910390a1565b613f4e8363a9059cbb60e01b8484604051602401613eec929190614df7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614409565b505050565b6000806000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015490506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490506000821115614129576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061409c3383600560006002811061404f5761404e614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613ecd9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e60056000600281106140e9576140e8614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051614120929190614df7565b60405180910390a25b600081111561426e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506141e13382600560016002811061419457614193614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613ecd9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e600560016002811061422e5761422d614d5d565b5b6003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683604051614265929190614df7565b60405180910390a25b81819350935050509091565b600080600080600080600c600088815260200190815260200160002060010154600c600089815260200190815260200160002060020154600c60008a815260200190815260200160002060030154600c60008b815260200190815260200160002060040154600c60008c815260200190815260200160002060050154600c60008d815260200190815260200160002060060160009054906101000a900460ff1695509550955095509550955091939550919395565b6143b2846323b872dd60e01b85858560405160240161435093929190614dc0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614409565b50505050565b600033905090565b6143c8610e7a565b614407576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016143fe906150e6565b60405180910390fd5b565b600061446b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166144d09092919063ffffffff16565b90506000815111156144cb578080602001905181019061448b919061511b565b6144ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016144c1906151ba565b60405180910390fd5b5b505050565b60606144df84846000856144e8565b90509392505050565b60608247101561452d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016145249061524c565b60405180910390fd5b614536856145fc565b614575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161456c906152b8565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161459e9190615352565b60006040518083038185875af1925050503d80600081146145db576040519150601f19603f3d011682016040523d82523d6000602084013e6145e0565b606091505b50915091506145f082828661461f565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6060831561462f5782905061467f565b6000835111156146425782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161467691906153be565b60405180910390fd5b9392505050565b6000819050919050565b61469981614686565b82525050565b60006020820190506146b46000830184614690565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006146ea826146bf565b9050919050565b6146fa816146df565b811461470557600080fd5b50565b600081359050614717816146f1565b92915050565b61472681614686565b811461473157600080fd5b50565b6000813590506147438161471d565b92915050565b600080604083850312156147605761475f6146ba565b5b600061476e85828601614708565b925050602061477f85828601614734565b9150509250929050565b600080600080608085870312156147a3576147a26146ba565b5b60006147b187828801614734565b94505060206147c287828801614734565b93505060406147d387828801614734565b92505060606147e487828801614734565b91505092959194509250565b60008115159050919050565b614805816147f0565b811461481057600080fd5b50565b600081359050614822816147fc565b92915050565b60006020828403121561483e5761483d6146ba565b5b600061484c84828501614813565b91505092915050565b60006020828403121561486b5761486a6146ba565b5b600061487984828501614734565b91505092915050565b61488b816146df565b82525050565b60006060820190506148a66000830186614882565b6148b36020830185614690565b6148c06040830184614690565b949350505050565b6148d1816147f0565b82525050565b60006020820190506148ec60008301846148c8565b92915050565b600060208284031215614908576149076146ba565b5b600061491684828501614708565b91505092915050565b600060a0820190506149346000830188614690565b6149416020830187614690565b61494e6040830186614690565b61495b6060830185614690565b6149686080830184614690565b9695505050505050565b60006020820190506149876000830184614882565b92915050565b6000806000606084860312156149a6576149a56146ba565b5b60006149b486828701614734565b93505060206149c586828701614734565b92505060406149d686828701614734565b9150509250925092565b60006040820190506149f56000830185614690565b614a026020830184614690565b9392505050565b600060c082019050614a1e6000830189614690565b614a2b6020830188614690565b614a386040830187614690565b614a456060830186614690565b614a526080830185614690565b614a5f60a08301846148c8565b979650505050505050565b600060e082019050614a7f600083018a614690565b614a8c6020830189614690565b614a996040830188614690565b614aa66060830187614690565b614ab36080830186614690565b614ac060a0830185614690565b614acd60c08301846148c8565b98975050505050505050565b60008060408385031215614af057614aef6146ba565b5b6000614afe85828601614734565b9250506020614b0f85828601614734565b9150509250929050565b60008060408385031215614b3057614b2f6146ba565b5b6000614b3e85828601614708565b9250506020614b4f85828601614813565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614b9382614686565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614bc557614bc4614b59565b5b600182019050919050565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614c17601f83614bd0565b9150614c2282614be1565b602082019050919050565b60006020820190508181036000830152614c4681614c0a565b9050919050565b6000614c5882614686565b9150614c6383614686565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c9857614c97614b59565b5b828201905092915050565b6000614cae82614686565b9150614cb983614686565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614cf257614cf1614b59565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614d3782614686565b9150614d4283614686565b925082614d5257614d51614cfd565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614d9782614686565b9150614da283614686565b925082821015614db557614db4614b59565b5b828203905092915050565b6000606082019050614dd56000830186614882565b614de26020830185614882565b614def6040830184614690565b949350505050565b6000604082019050614e0c6000830185614882565b614e196020830184614690565b9392505050565b600081519050614e2f8161471d565b92915050565b600060208284031215614e4b57614e4a6146ba565b5b6000614e5984828501614e20565b91505092915050565b6000604082019050614e776000830185614882565b614e8460208301846148c8565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614ee7602683614bd0565b9150614ef282614e8b565b604082019050919050565b60006020820190508181036000830152614f1681614eda565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614f53602083614bd0565b9150614f5e82614f1d565b602082019050919050565b60006020820190508181036000830152614f8281614f46565b9050919050565b6000819050919050565b6000819050919050565b6000614fb8614fb3614fae84614f89565b614f93565b614686565b9050919050565b614fc881614f9d565b82525050565b6000602082019050614fe36000830184614fbf565b92915050565b6000608082019050614ffe6000830187614690565b61500b6020830186614690565b6150186040830185614690565b6150256060830184614690565b95945050505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000615064601083614bd0565b915061506f8261502e565b602082019050919050565b6000602082019050818103600083015261509381615057565b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006150d0601483614bd0565b91506150db8261509a565b602082019050919050565b600060208201905081810360008301526150ff816150c3565b9050919050565b600081519050615115816147fc565b92915050565b600060208284031215615131576151306146ba565b5b600061513f84828501615106565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006151a4602a83614bd0565b91506151af82615148565b604082019050919050565b600060208201905081810360008301526151d381615197565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615236602683614bd0565b9150615241826151da565b604082019050919050565b6000602082019050818103600083015261526581615229565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006152a2601d83614bd0565b91506152ad8261526c565b602082019050919050565b600060208201905081810360008301526152d181615295565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561530c5780820151818401526020810190506152f1565b8381111561531b576000848401525b50505050565b600061532c826152d8565b61533681856152e3565b93506153468185602086016152ee565b80840191505092915050565b600061535e8284615321565b915081905092915050565b600081519050919050565b6000601f19601f8301169050919050565b600061539082615369565b61539a8185614bd0565b93506153aa8185602086016152ee565b6153b381615374565b840191505092915050565b600060208201905081810360008301526153d88184615385565b90509291505056fea2646970667358221220ce527a493ac4659786d6af02786b0f4f3cf2879864b022537586e23633d6cf4464736f6c634300080f0033

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