Contract 0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc8294ff20ecbe83304cfcfcc2f5ece336d2a948f8a97f3af1affa66e2f45b199Claim Avic Rewar...202563682022-09-25 11:17:551 min ago0xc581af28bb9ff37389ba166e792ad9460f696bb5 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002818245145 27.2795
0x899cbdbb913878e1c7b90c0e1b626745c513038a2eaa4127bcf21ae49af71620Deposit202554882022-09-25 10:47:0732 mins ago0x1fa0dbb3343523c4a372dc1984a7db253780f4aa IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.005514597 26.5
0x7cbedfe41cd1085a8ff27e0f88e9177557b8e8404978260b60f9717ca9bfdd34Claim Avic Rewar...202554562022-09-25 10:45:5933 mins ago0xc09752d7aa32db555d0b9e794dd385bb9be2e70e IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0xbbf201ed97d479e69b82ddab9229e03cbecf48e9e5104e10e6fa3884506dccb0Deposit202552122022-09-25 10:37:1142 mins ago0x06ee62d4ce8c1b2c169b348b5dc3ec4fec5e1258 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.005061765 26.5
0x7125686455d11c38dbbab37e3a040c480bffe1966d56ba47c52809700663ed33Claim Avic Rewar...202548062022-09-25 10:23:0256 mins ago0x1fa0dbb3343523c4a372dc1984a7db253780f4aa IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0x531488e67f62afdc658ecb8153ec903f8fe5c00af4f7a92e389acb79c307c70eClaim Cham Rewar...202548012022-09-25 10:22:5256 mins ago0x1fa0dbb3343523c4a372dc1984a7db253780f4aa IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002656837 26.5
0x681ccf363b84252b0e174eef8abff841abf0092d80783c279be144682bc59621Claim Avic Rewar...202545962022-09-25 10:15:511 hr 3 mins ago0x9dded5066b2aec18202b25dbd1877850813a9d66 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0x0eca713698f3d7a399fdd5f24d8f9c9867711ca9fc45af9865bb5fd3f1674fc3Claim Avic Rewar...202540482022-09-25 9:56:541 hr 22 mins ago0x3122706601c04d579c777fdf0ceefcca19b825f2 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002786732755 26.97447251
0x94fe67b22c65d8e75d1dd5e15ea8a48dde09dd0853c10d3b5127e795c4d30bf6Claim Avic Rewar...202534182022-09-25 9:34:481 hr 44 mins ago0xf29ec84193e399253b8bc86380c4dfc9bd569919 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.0028926828
0xa3302407b672456d3cbba6d0feaaa520f77d44f46280e41c0bb4dd356a9a1e8cClaim Cham Rewar...202534122022-09-25 9:34:331 hr 44 mins ago0xf29ec84193e399253b8bc86380c4dfc9bd569919 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.00316866627
0xac59b5eb4b0b164228ff96407a5ccbb4ba8baa42e0600945f9e49ed6d31eeedbClaim Avic Rewar...202532382022-09-25 9:28:281 hr 50 mins ago0x66d3d79665b906d816246302d13c497385f2d8c5 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0xb907150846a96f696a3376e199089e37000fef959e80d3edc676f27953a89a65Claim Avic Rewar...202525682022-09-25 9:05:242 hrs 14 mins ago0xe7480405a747b3cc61a4a12bfa55ec5e61fc8a5c IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0xa37a37299577bd111ee7315bd5129bf0b153d81226b62e25f585dfe4cd06bbe2Claim Cham Rewar...202525532022-09-25 9:04:512 hrs 14 mins ago0xe7480405a747b3cc61a4a12bfa55ec5e61fc8a5c IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002656837 26.5
0x373b88e36bcc0b1cb4927d7b1dfc9e60949174fc6b4d2d4cfea47dd6dad5ac0bClaim Cham Rewar...202524802022-09-25 9:02:192 hrs 17 mins ago0xb7db55e85e9ab2b800a52c936ce4ab33adb5fe6b IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002656837 26.5
0xbebf4e2abeb329bfd94b3b8a847ae64f1d7c87db4e72d5fb13b0d042ccf6b3ecClaim Avic Rewar...202524722022-09-25 9:02:032 hrs 17 mins ago0xb7db55e85e9ab2b800a52c936ce4ab33adb5fe6b IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.003190865 26.5
0x644d3579a92247fe01fdc04132f4594ef0460aa9cac6072b47afd4a97a835bd9Claim Avic Rewar...202519712022-09-25 8:44:262 hrs 34 mins ago0xee9c8fd5b30bd32782fe3faa93f515d9a5228a1b IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0xc9c5113c1406f948f028693f3cc14331257795cd252674d40405bf1beef0014bClaim Extra Rewa...202513022022-09-25 8:20:532 hrs 58 mins ago0x83eb947228e2db9c96ef6665d21c8e075aa2c618 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002764427 26.5
0x224e318af85d545f992e8c9a7973203649ddfbd9d4b9b907ad616545a9d13d57Claim Avic Rewar...202512952022-09-25 8:20:392 hrs 58 mins ago0x83eb947228e2db9c96ef6665d21c8e075aa2c618 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002737715 26.5
0xb448ccbecb5b18f7567388f6cf65721bedc37367586e1b7acbf4bc921b7399fbClaim Cham Rewar...202511002022-09-25 8:13:393 hrs 5 mins ago0xfd5ff07c22ffe7064e6c3f0ca212bbcda7f86933 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002616733826.1
0x58a3ea92c9e2aec4b2bf13df3b8399a15af0e63890dae8e130d3b3b802b4cd4bDeposit202510112022-09-25 8:10:323 hrs 8 mins ago0xfe4c082d320882a4133bb0d951254d6c083cb854 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.006275147 26.5
0x8fb03253ea5bf756cb0c3332f47251f4ec7709dd3dddfd8624676fb59984f750Update Total Avi...202510022022-09-25 8:10:143 hrs 9 mins agoChampion Finance: Deployer IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.0013902525
0x89e0a5c897285597e8fda29cc208a8876e9f76db05737cc5302c2411aead474cClaim Avic Rewar...202509072022-09-25 8:06:593 hrs 12 mins ago0xfe4c082d320882a4133bb0d951254d6c083cb854 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.003190865 26.5
0x48b6245b3fba96bb8528461830fbeae4179743575c666321ca1dddda83268064Distribute Extra...202508892022-09-25 8:06:223 hrs 13 mins agoChampion Finance: Deployer IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.00166967525
0xe5e5f155952f99f7c473bcfa771636a0cecbdebd06d2ec9762c29d9affb3437cClaim Cham Rewar...202507532022-09-25 8:01:413 hrs 17 mins ago0x83eb947228e2db9c96ef6665d21c8e075aa2c618 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.002656837 26.5
0x8b0ff11d53357c988d86ef4ed70a7e87f990a6c197a979ca6e16d4b983250144Deposit202501322022-09-25 7:40:033 hrs 39 mins ago0x06ee62d4ce8c1b2c169b348b5dc3ec4fec5e1258 IN  0x8e7ad05fe711054dc4dc19e336272fc43c7a51ca0 AVAX0.00517577527.5
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AVICPool

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
byzantium EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : AVICPool.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "./lib/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./utils/ContractGuard.sol";

contract AVICPool is Ownable, ContractGuard {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    
    struct UserInfo {
        uint256 amount; // How many tokens the user has provided.
        uint256 rewardAvicDebt; // Reward debt. See explanation below.
        uint256 rewardChamDebt; // Reward debt. See explanation below.

        uint256 lastSnapshotIndex;
        uint256 rewardEarned;
        uint256 epochTimerStart;
    }

    struct DistributeSnapshot {
        uint256 time;
        uint256 rewardReceived;
        uint256 rewardPerShare;
    }

    DistributeSnapshot[] public distributeHistory;
    mapping(address => UserInfo) public userInfo;
    mapping(uint256 => uint256) public totalAvicSupplyEpoch;

    uint256 public constant PERIOD = 6 hours;
    uint256 public epoch;

    IERC20 private avicToken;
    IERC20 private chamToken;
    IERC20 private yw30Token;

    uint256 public poolStartTime;
    uint256 public poolEndTime;

    uint256 public constant runningTime = 30 days;
    uint256 public constant TOTAL_AVIC_REWARD = 70000 ether;
    uint256 public constant TOTAL_CHAM_REWARD = 500 ether;
    uint256 public avicTokenPerSecond;
    uint256 public chamTokenPerSecond;
    uint256 private accAvicTokenPerShare = 0;
    uint256 private accChamTokenPerShare = 0;
    uint256 private avicLastRewardTime = 0;
    uint256 private chamLastRewardTime = 0;

    uint256 public emergencyWithdrawFeePercent = 50; // 50%

    address public polWallet;
    address public adminAddress;
    address public operator;

    event Deposit(address indexed _user, uint256 _amount);
    event EmergencyWithdraw(address indexed _user, uint256 _amount);
    event AvicRewardPaid(address indexed _user, uint256 _amount);
    event ChamRewardPaid(address indexed _user, uint256 _amount);
    event Withdraw(address indexed _user, uint256 _amount);
    event SetEmergencyWithdrawFeePercent(uint256 oldValue, uint256 newValue);
    event DistributedReward(address indexed user, uint256 reward);
    event ExtraRewardPaid(address indexed _user, uint256 _amount);

    /* ========== INITIALIZER ========== */
    constructor(
        address _avicToken, 
        address _chamToken,
        address _yw30Token,
        address _polWallet,
        address _adminAddress,
        uint256 _poolStartTime
    ) {
        require(block.timestamp < _poolStartTime, "late");
        require(_avicToken != address(0), "!_avicToken");
        require(_chamToken != address(0), "!_chamToken");
        require(_yw30Token != address(0), "!_yw30Token");
        require(_polWallet != address(0), "!_polWallet");
        require(_adminAddress != address(0), "!_adminAddress");

        operator = msg.sender;
        adminAddress = _adminAddress;
        polWallet = _polWallet;

        avicToken = IERC20(_avicToken);
        chamToken = IERC20(_chamToken);
        yw30Token = IERC20(_yw30Token);

        poolStartTime = _poolStartTime;
        poolEndTime = poolStartTime + runningTime;
        avicLastRewardTime = poolStartTime;
        chamLastRewardTime = poolStartTime;

        avicTokenPerSecond = TOTAL_AVIC_REWARD.div(runningTime);
        chamTokenPerSecond = TOTAL_CHAM_REWARD.div(runningTime);

        DistributeSnapshot memory genesisSnapshot = DistributeSnapshot({time: block.number, rewardReceived: 0, rewardPerShare: 0});
        distributeHistory.push(genesisSnapshot);
    }

    modifier onlyOperator() {
        require(operator == msg.sender, "AVICPool: caller is not the operator");
        _;
    }

    modifier checkEpoch() {
        require(block.timestamp >= nextEpochPoint(), "AVICPool: not opened yet");
        _;
        epoch = epoch.add(1);
    }

    modifier updateExtraReward(address _member) {
        if (_member != address(0)) {
            UserInfo storage user = userInfo[_member];
            user.rewardEarned = earned(_member);
            user.lastSnapshotIndex = latestSnapshotIndex();
            userInfo[_member] = user;
        }
        _;
    }

    // WRITE FUNCTIONS
    function deposit(uint256 _amount) external onlyOneBlock updateExtraReward(msg.sender) {
        address _sender = msg.sender;
        UserInfo storage user = userInfo[_sender];
        updateAvicReward();
        updateChamReward();
        if (user.amount > 0) {
            uint256 pendingAvicReward = user.amount.mul(accAvicTokenPerShare).div(1e18).sub(user.rewardAvicDebt);
            uint256 pendingChamReward = user.amount.mul(accChamTokenPerShare).div(1e18).sub(user.rewardChamDebt);
            if (pendingAvicReward > 0) {
                safeAvicTokenTransfer(_sender, pendingAvicReward);
                emit AvicRewardPaid(_sender, pendingAvicReward);
            }

            if (pendingChamReward > 0) {
                safeChamTokenTransfer(_sender, pendingChamReward);
                emit ChamRewardPaid(_sender, pendingChamReward);
            }
        }

        if (_amount > 0) {
            user.epochTimerStart = epoch; 
            yw30Token.safeTransferFrom(_sender, address(this), _amount);
            user.amount = user.amount.add(_amount);
        }

        user.rewardAvicDebt = user.amount.mul(accAvicTokenPerShare).div(1e18);
        user.rewardChamDebt = user.amount.mul(accChamTokenPerShare).div(1e18);
        emit Deposit(_sender, _amount);
    }

    function withdraw() external onlyOneBlock updateExtraReward(msg.sender) {
        require(block.timestamp > poolEndTime, "AVICPool: locked!");
        address _sender = msg.sender;
        UserInfo storage user = userInfo[_sender];
        uint256 amount = user.amount;
        if (amount > 0) {
            claimExtraReward();
            updateAvicReward();
            updateChamReward();
            uint256 pendingAvicReward = amount.mul(accAvicTokenPerShare).div(1e18).sub(user.rewardAvicDebt);
            uint256 pendingChamReward = amount.mul(accChamTokenPerShare).div(1e18).sub(user.rewardChamDebt);

            if (pendingAvicReward > 0) {
                safeAvicTokenTransfer(_sender, pendingAvicReward);
                emit AvicRewardPaid(_sender, pendingAvicReward);
            }

            if (pendingChamReward > 0) {
                safeChamTokenTransfer(_sender, pendingChamReward);
                emit ChamRewardPaid(_sender, pendingChamReward);
            }

            user.amount = 0;
            user.rewardAvicDebt = 0;
            user.rewardChamDebt = 0;
            yw30Token.safeTransfer(_sender, amount);
        }
        
        emit Withdraw(_sender, amount);
    }
    
    function emergencyWithdraw() external onlyOneBlock updateExtraReward(msg.sender) {
        UserInfo storage user = userInfo[msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardAvicDebt = 0;
        user.rewardChamDebt = 0;
        if (amount > 0) {
            uint256 reward = userInfo[msg.sender].rewardEarned;
            if (reward > 0) {
                userInfo[msg.sender].epochTimerStart = epoch;
                userInfo[msg.sender].rewardEarned = 0;
            }
            uint256 feeAmount = amount.mul(emergencyWithdrawFeePercent).div(100);
            uint256 withdrawAmount = amount.sub(feeAmount);
            yw30Token.safeTransfer(polWallet, feeAmount);
            yw30Token.safeTransfer(msg.sender, withdrawAmount);
        }

        emit EmergencyWithdraw(msg.sender, amount);
    }

    function claimExtraReward() public updateExtraReward(msg.sender) {
        uint256 reward = userInfo[msg.sender].rewardEarned;
        if (reward > 0) {
            userInfo[msg.sender].epochTimerStart = epoch;
            userInfo[msg.sender].rewardEarned = 0;
            avicToken.safeTransfer(msg.sender, reward);
            emit ExtraRewardPaid(msg.sender, reward);
        }
    }

    function claimAvicReward() external onlyOneBlock {
        address _sender = msg.sender;
        UserInfo storage user = userInfo[_sender];
        updateAvicReward();
        uint256 _pending = user.amount.mul(accAvicTokenPerShare).div(1e18).sub(user.rewardAvicDebt);
        if (_pending > 0) {
            safeAvicTokenTransfer(_sender, _pending);
        }

        user.rewardAvicDebt = user.amount.mul(accAvicTokenPerShare).div(1e18);
        emit AvicRewardPaid(_sender, _pending);
    }

    function claimChamReward() external onlyOneBlock {
        address _sender = msg.sender;
        UserInfo storage user = userInfo[_sender];
        updateChamReward();
        uint256 _pending = user.amount.mul(accChamTokenPerShare).div(1e18).sub(user.rewardChamDebt);
        if (_pending > 0) {
            safeChamTokenTransfer(_sender, _pending);
        }

        user.rewardChamDebt = user.amount.mul(accChamTokenPerShare).div(1e18);
        emit ChamRewardPaid(_sender, _pending);
    }

    function updateAvicReward() internal {
        if (block.timestamp <= avicLastRewardTime) {
            return;
        }
        uint256 tokenSupply = yw30Token.balanceOf(address(this));
        if (tokenSupply == 0) {
            avicLastRewardTime = block.timestamp;
            return;
        }

        uint256 _generatedReward = getAvicGeneratedReward(avicLastRewardTime, block.timestamp);
        accAvicTokenPerShare = accAvicTokenPerShare.add(_generatedReward.mul(1e18).div(tokenSupply));
        avicLastRewardTime = block.timestamp;
    }

    function updateChamReward() internal {
        if (block.timestamp <= chamLastRewardTime) {
            return;
        }
        uint256 tokenSupply = yw30Token.balanceOf(address(this));
        if (tokenSupply == 0) {
            chamLastRewardTime = block.timestamp;
            return;
        }

        uint256 _generatedReward = getChamGeneratedReward(chamLastRewardTime, block.timestamp);
        accChamTokenPerShare = accChamTokenPerShare.add(_generatedReward.mul(1e18).div(tokenSupply));
        chamLastRewardTime = block.timestamp;
    }

    function safeAvicTokenTransfer(address _to, uint256 _amount) internal {
        uint256 avicTokenBalance = avicToken.balanceOf(address(this));
        if (avicTokenBalance > 0) {
            if (_amount > avicTokenBalance) {
                avicToken.safeTransfer(_to, avicTokenBalance);
            } else {
                avicToken.safeTransfer(_to, _amount);
            }
        }
    }

    function safeChamTokenTransfer(address _to, uint256 _amount) internal {
        uint256 chamTokenBalance = chamToken.balanceOf(address(this));
        if (chamTokenBalance > 0) {
            if (_amount > chamTokenBalance) {
                chamToken.safeTransfer(_to, chamTokenBalance);
            } else {
                chamToken.safeTransfer(_to, _amount);
            }
        }
    }

    function setEmergencyWithdrawFeePercent(uint256 _value) external onlyOperator {
        require(_value <= 50, 'AVICPool: Max percent is 50%');
        emit SetEmergencyWithdrawFeePercent(emergencyWithdrawFeePercent, _value);
        emergencyWithdrawFeePercent = _value;
    }

    function adminWithdraw(address _token, uint256 _amount) external onlyOperator {
        require(_token == address(avicToken) || _token == address(chamToken), "Only withdraw AVIC, CHAM");
        IERC20(_token).safeTransfer(adminAddress, _amount);
    }

    function distributeExtraReward() external checkEpoch onlyOneBlock {
        require(block.timestamp < poolEndTime, "AVICPool: Pool is ended!");
        if (epoch > 0) {
            uint256 tokenSupply = yw30Token.balanceOf(address(this));
            if (tokenSupply <= 0) return;
            
            uint256 avicAmount = getExtraReward();
            if (avicAmount <= 0) return;
            
            // Create & add new snapshot
            uint256 prevRPS = getLatestSnapshot().rewardPerShare;
            uint256 nextRPS = prevRPS.add(avicAmount.mul(1e18).div(tokenSupply));

            DistributeSnapshot memory newSnapshot = DistributeSnapshot({time: block.number, rewardReceived: avicAmount, rewardPerShare: nextRPS});
            distributeHistory.push(newSnapshot);

            emit DistributedReward(msg.sender, avicAmount);
        }
    }

    function updateTotalAvicSupplyEpoch() external {
        require(block.timestamp < nextEpochPoint(), "AVICPool: set before epoch start");
        totalAvicSupplyEpoch[epoch] = avicToken.totalSupply();
    }

    // READ FUNCTIONS
    function getAvicGeneratedReward(uint256 _fromTime, uint256 _toTime) public view returns (uint256) {
        if (_fromTime >= _toTime) return 0;
        if (_toTime >= poolEndTime) {
            if (_fromTime >= poolEndTime) return 0;
            if (_fromTime <= poolStartTime) return poolEndTime.sub(poolStartTime).mul(avicTokenPerSecond);
            return poolEndTime.sub(_fromTime).mul(avicTokenPerSecond);
        } else {
            if (_toTime <= poolStartTime) return 0;
            if (_fromTime <= poolStartTime) return _toTime.sub(poolStartTime).mul(avicTokenPerSecond);
            return _toTime.sub(_fromTime).mul(avicTokenPerSecond);
        }
    }

    function getChamGeneratedReward(uint256 _fromTime, uint256 _toTime) public view returns (uint256) {
        if (_fromTime >= _toTime) return 0;
        if (_toTime >= poolEndTime) {
            if (_fromTime >= poolEndTime) return 0;
            if (_fromTime <= poolStartTime) return poolEndTime.sub(poolStartTime).mul(chamTokenPerSecond);
            return poolEndTime.sub(_fromTime).mul(chamTokenPerSecond);
        } else {
            if (_toTime <= poolStartTime) return 0;
            if (_fromTime <= poolStartTime) return _toTime.sub(poolStartTime).mul(chamTokenPerSecond);
            return _toTime.sub(_fromTime).mul(chamTokenPerSecond);
        }
    }

    function pendingAvic(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[_user];
        uint256 accTokenPerShare = accAvicTokenPerShare;
        uint256 tokenSupply = yw30Token.balanceOf(address(this));
        if (block.timestamp > avicLastRewardTime && tokenSupply != 0) {
            uint256 _generatedReward = getAvicGeneratedReward(avicLastRewardTime, block.timestamp);
            accTokenPerShare = accTokenPerShare.add(_generatedReward.mul(1e18).div(tokenSupply));
        }

        return user.amount.mul(accTokenPerShare).div(1e18).sub(user.rewardAvicDebt);
    }

    function pendingCham(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[_user];
        uint256 accTokenPerShare = accChamTokenPerShare;
        uint256 tokenSupply = yw30Token.balanceOf(address(this));
        if (block.timestamp > chamLastRewardTime && tokenSupply != 0) {
            uint256 _generatedReward = getChamGeneratedReward(chamLastRewardTime, block.timestamp);
            accTokenPerShare = accTokenPerShare.add(_generatedReward.mul(1e18).div(tokenSupply));
        }

        return user.amount.mul(accTokenPerShare).div(1e18).sub(user.rewardChamDebt);
    }

    function nextEpochPoint() public view returns (uint256) {
        return poolStartTime.add(epoch.mul(PERIOD));
    }

    function getLatestSnapshot() internal view returns (DistributeSnapshot memory) {
        return distributeHistory[latestSnapshotIndex()];
    }

    function latestSnapshotIndex() public view returns (uint256) {
        return distributeHistory.length.sub(1);
    }

    function earned(address _member) public view returns (uint256) {
        uint256 latestRPS = getLatestSnapshot().rewardPerShare;
        uint256 storedRPS = getLastSnapshotOf(_member).rewardPerShare;

        return userInfo[_member].amount.mul(latestRPS.sub(storedRPS)).div(1e18).add(userInfo[_member].rewardEarned);
    }

    function getLastSnapshotIndexOf(address _member) public view returns (uint256) {
        return userInfo[_member].lastSnapshotIndex;
    }

    function getLastSnapshotOf(address _member) internal view returns (DistributeSnapshot memory) {
        return distributeHistory[getLastSnapshotIndexOf(_member)];
    }

    function getExtraReward() public view returns (uint256) {
        if (epoch == 0) return 0;

        uint256 totalAvicSupplyCurrentEpoch = totalAvicSupplyEpoch[epoch];
        uint256 totalAvicSupplyPrevEpoch = totalAvicSupplyEpoch[epoch - 1];
        if (totalAvicSupplyPrevEpoch == 0 || totalAvicSupplyPrevEpoch > totalAvicSupplyCurrentEpoch) return 0;

        return totalAvicSupplyCurrentEpoch.sub(totalAvicSupplyPrevEpoch).mul(10).div(100);
    }
}

File 2 of 8 : ContractGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

contract ContractGuard {
    mapping(uint256 => mapping(address => bool)) private _status;

    function checkSameOriginReentranted() internal view returns (bool) {
        return _status[block.number][tx.origin];
    }

    function checkSameSenderReentranted() internal view returns (bool) {
        return _status[block.number][msg.sender];
    }

    modifier onlyOneBlock() {
        require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
        require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");

        _status[block.number][tx.origin] = true;
        _status[block.number][msg.sender] = true;

        _;
    }
}

File 3 of 8 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity 0.8.13;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

File 4 of 8 : 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;
    }
}

File 5 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 6 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `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);

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

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

File 8 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

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

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

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_avicToken","type":"address"},{"internalType":"address","name":"_chamToken","type":"address"},{"internalType":"address","name":"_yw30Token","type":"address"},{"internalType":"address","name":"_polWallet","type":"address"},{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"uint256","name":"_poolStartTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"AvicRewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ChamRewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"DistributedReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ExtraRewardPaid","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":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"SetEmergencyWithdrawFeePercent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_AVIC_REWARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_CHAM_REWARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"avicTokenPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chamTokenPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAvicReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimChamReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimExtraReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeExtraReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"distributeHistory","outputs":[{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"uint256","name":"rewardReceived","type":"uint256"},{"internalType":"uint256","name":"rewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_member","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTime","type":"uint256"},{"internalType":"uint256","name":"_toTime","type":"uint256"}],"name":"getAvicGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTime","type":"uint256"},{"internalType":"uint256","name":"_toTime","type":"uint256"}],"name":"getChamGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExtraReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_member","type":"address"}],"name":"getLastSnapshotIndexOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestSnapshotIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingAvic","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingCham","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"polWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"runningTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setEmergencyWithdrawFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalAvicSupplyEpoch","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":"updateTotalAvicSupplyEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardAvicDebt","type":"uint256"},{"internalType":"uint256","name":"rewardChamDebt","type":"uint256"},{"internalType":"uint256","name":"lastSnapshotIndex","type":"uint256"},{"internalType":"uint256","name":"rewardEarned","type":"uint256"},{"internalType":"uint256","name":"epochTimerStart","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600d556000600e556000600f55600060105560326011553480156200002a57600080fd5b5060405162002e7c38038062002e7c8339810160408190526200004d9162000529565b6200007362000064640100000000620004a3810204565b640100000000620004a7810204565b804210620000e9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000e09060208082526004908201527f6c61746500000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390fd5b600160a060020a0386166200015b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f215f61766963546f6b656e0000000000000000000000000000000000000000006044820152606401620000e0565b600160a060020a038516620001cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f215f6368616d546f6b656e0000000000000000000000000000000000000000006044820152606401620000e0565b600160a060020a0384166200023f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f215f79773330546f6b656e0000000000000000000000000000000000000000006044820152606401620000e0565b600160a060020a038316620002b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f215f706f6c57616c6c65740000000000000000000000000000000000000000006044820152606401620000e0565b600160a060020a03821662000323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f215f61646d696e416464726573730000000000000000000000000000000000006044820152606401620000e0565b6014805433600160a060020a031991821617909155601380548216600160a060020a03858116919091179091556012805483168683161790556006805483168983161790556007805483168883161790556008805490921690861617905560098190556200039562278d0082620005a1565b600a55600954600f819055601055620003ca690ed2b525841adfc0000062278d0064010000000062001d8c620004f782021704565b600b55620003f3681b1ae4d6e2ef50000062278d0064010000000062001d8c620004f782021704565b600c5550506040805160608101825243815260006020820181815292820181815260028054600181018255925291517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60039092029182015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf830155517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad090910155506200061d92505050565b3390565b60008054600160a060020a03838116600160a060020a0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000620005058284620005e1565b9392505050565b8051600160a060020a03811681146200052457600080fd5b919050565b60008060008060008060c087890312156200054357600080fd5b6200054e876200050c565b95506200055e602088016200050c565b94506200056e604088016200050c565b93506200057e606088016200050c565b92506200058e608088016200050c565b915060a087015190509295509295509295565b60008219821115620005dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b60008262000618577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b61284f806200062d6000396000f3fe608060405234801561001057600080fd5b506004361061024d576000357c0100000000000000000000000000000000000000000000000000000000900480637961a3511161014d578063b6b55f25116100d5578063f2fde38b11610099578063f2fde38b146104d7578063f403de29146104ea578063f8df0c8f146104fd578063fc6f94681461050d578063fd23a2661461052057600080fd5b8063b6b55f25146104a3578063be1bda16146104b6578063c5967c26146104be578063d4711f81146104c6578063db2e21bc146104cf57600080fd5b8063900cf0cf1161011c578063900cf0cf14610461578063943f013d1461046a5780639a8af5ae14610474578063af9c921514610487578063b4d1d7951461049a57600080fd5b80637961a351146104065780637df1f3941461043457806387d7087b146104475780638da5cb5b1461045057600080fd5b80633ccfd60b116101db5780635f96dc111161019f5780635f96dc11146103b75780636e271dd5146103c057806370932f79146103c9578063714b4658146103d1578063715018a6146103fe57600080fd5b80633ccfd60b146103705780633f9e3f0414610378578063401d4482146103805780634dbee80f14610393578063570ca735146103a457600080fd5b806314bb800c1161022257806314bb800c146102aa5780631959a002146102bd57806329d9e005146103345780633379984a1461035f578063383875de1461036857600080fd5b8062486a3c146102525780628cc2621461025c578063019521f2146102825780630a6bcb6c1461028a575b600080fd5b61025a610528565b005b61026f61026a366004612542565b61063b565b6040519081526020015b60405180910390f35b61025a6106cc565b61026f61029836600461255d565b60046020526000908152604090205481565b61026f6102b8366004612542565b6107d1565b6103076102cb366004612542565b60036020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610279565b60125461034790600160a060020a031681565b604051600160a060020a039091168152602001610279565b61026f60115481565b61025a6108df565b61025a610a49565b61026f610d7f565b61025a61038e366004612576565b610d95565b61026f690ed2b525841adfc0000081565b60145461034790600160a060020a031681565b61026f60095481565b61026f600a5481565b61026f610e54565b61026f6103df366004612542565b600160a060020a03166000908152600360208190526040909120015490565b61025a610ed7565b61041961041436600461255d565b610f40565b60408051938452602084019290925290820152606001610279565b61025a61044236600461255d565b610f73565b61026f600b5481565b600054600160a060020a0316610347565b61026f60055481565b61026f62278d0081565b61026f610482366004612542565b611035565b61026f6104953660046125a0565b61112d565b61026f61546081565b61025a6104b136600461255d565b6111ec565b61025a61150e565b61026f611834565b61026f600c5481565b61025a611859565b61025a6104e5366004612542565b611a91565b61026f6104f83660046125a0565b611b79565b61026f681b1ae4d6e2ef50000081565b60135461034790600160a060020a031681565b61025a611c2b565b3380156105af57600160a060020a03811660009081526003602052604090206105508261063b565b600482015561055d610d7f565b6003808301918255600160a060020a0384166000908152602082905260409020835481556001808501549082015560028085015490820155915490820155600480830154908201556005918201549101555b33600090815260036020526040902060040154801561063757600580543360008181526003602052604081209384019290925560049092015560065461060191600160a060020a039091169083611d9f565b60405181815233907fda7b7bb10a2a0310f6c2c5ce35deaff3f419cc6e541924f3d26248180385e8d09060200160405180910390a25b5050565b600080610646611e4d565b604001519050600061065784611ec7565b604090810151600160a060020a0386166000908152600360205291909120600401549091506106c4906106be670de0b6b3a76400006106b86106998787611f5e565b600160a060020a038a1660009081526003602052604090205490611f6a565b90611d8c565b90611f76565b949350505050565b6106d4611834565b421061072a5760405160e560020a62461bcd02815260206004820181905260248201527f41564943506f6f6c3a20736574206265666f72652065706f636820737461727460448201526064015b60405180910390fd5b600660009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381865afa158015610799573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bd91906125c2565b600554600090815260046020526040902055565b600160a060020a03818116600090815260036020526040808220600d54600854925160e060020a6370a08231028152306004820152939491939092859216906370a0823190602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a91906125c2565b9050600f544211801561086c57508015155b156108a557600061087f600f5442611b79565b90506108a161089a836106b884670de0b6b3a7640000611f6a565b8490611f76565b9250505b6108d683600101546108d0670de0b6b3a76400006106b8868860000154611f6a90919063ffffffff16565b90611f5e565b95945050505050565b43600090815260016020908152604080832032845290915290205460ff161561091d5760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff161561095b5760405160e560020a62461bcd028152600401610721906125db565b4360009081526001602081815260408084203285528252808420805460ff199081168517909155338086528286208054909216909417905560039091529091206109a3611f82565b60006109d282600101546108d0670de0b6b3a76400006106b8600d548760000154611f6a90919063ffffffff16565b905080156109e4576109e4838261204b565b600d548254610a0091670de0b6b3a7640000916106b891611f6a565b6001830155604051818152600160a060020a038416907f24d0ab5b06b63063080f522edb1dcdad5006b3c95d07fd69a40ac2f71be0efb3906020015b60405180910390a2505050565b43600090815260016020908152604080832032845290915290205460ff1615610a875760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff1615610ac55760405160e560020a62461bcd028152600401610721906125db565b436000908152600160208181526040808420328552909152808320805460ff199081168417909155338085529190932080549093169091179091558015610b8657600160a060020a0381166000908152600360205260409020610b278261063b565b6004820155610b34610d7f565b6003808301918255600160a060020a0384166000908152602082905260409020835481556001808501549082015560028085015490820155915490820155600480830154908201556005918201549101555b600a544211610bda5760405160e560020a62461bcd02815260206004820152601160248201527f41564943506f6f6c3a206c6f636b6564210000000000000000000000000000006044820152606401610721565b33600081815260036020526040902080548015610d3657610bf9610528565b610c01611f82565b610c096120f9565b6000610c3483600101546108d0670de0b6b3a76400006106b8600d5487611f6a90919063ffffffff16565b90506000610c6184600201546108d0670de0b6b3a76400006106b8600e5488611f6a90919063ffffffff16565b90508115610cb757610c73858361204b565b84600160a060020a03167f24d0ab5b06b63063080f522edb1dcdad5006b3c95d07fd69a40ac2f71be0efb383604051610cae91815260200190565b60405180910390a25b8015610d0b57610cc785826121c2565b84600160a060020a03167fd2f33dd5633d5bce528bf0d7d806fb1fecaf06f6f6594e484f4f53e08f39aef082604051610d0291815260200190565b60405180910390a25b6000808555600185018190556002850155600854610d3390600160a060020a03168685611d9f565b50505b82600160a060020a03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436482604051610d7191815260200190565b60405180910390a250505050565b600254600090610d90906001611f5e565b905090565b601454600160a060020a03163314610dc25760405160e560020a62461bcd02815260040161072190612638565b600654600160a060020a0383811691161480610deb5750600754600160a060020a038381169116145b610e3a5760405160e560020a62461bcd02815260206004820152601860248201527f4f6e6c7920776974686472617720415649432c204348414d00000000000000006044820152606401610721565b60135461063790600160a060020a03848116911683611d9f565b6000600554600003610e665750600090565b6005546000818152600460208190526040822054928290610e89906001906126c4565b81526020019081526020016000205490508060001480610ea857508181115b15610eb65760009250505090565b610ed060646106b8600a610eca8686611f5e565b90611f6a565b9250505090565b600054600160a060020a03163314610f345760405160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610721565b610f3e6000612270565b565b60028181548110610f5057600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b601454600160a060020a03163314610fa05760405160e560020a62461bcd02815260040161072190612638565b6032811115610ff45760405160e560020a62461bcd02815260206004820152601c60248201527f41564943506f6f6c3a204d61782070657263656e7420697320353025000000006044820152606401610721565b60115460408051918252602082018390527f3b68bda6c3c08a2dc920d3b63eb91e9b51fa73bf180314f4276819721a01c405910160405180910390a1601155565b600160a060020a03818116600090815260036020526040808220600e54600854925160e060020a6370a08231028152306004820152939491939092859216906370a0823190602401602060405180830381865afa15801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be91906125c2565b9050601054421180156110d057508015155b156111025760006110e36010544261112d565b90506110fe61089a836106b884670de0b6b3a7640000611f6a565b9250505b6108d683600201546108d0670de0b6b3a76400006106b8868860000154611f6a90919063ffffffff16565b600081831061113e575060006111e6565b600a5482106111a057600a548310611158575060006111e6565b60095483116111855761117e600c54610eca600954600a54611f5e90919063ffffffff16565b90506111e6565b61117e600c54610eca85600a54611f5e90919063ffffffff16565b60095482116111b1575060006111e6565b60095483116111d55761117e600c54610eca60095485611f5e90919063ffffffff16565b600c5461117e90610eca8486611f5e565b92915050565b43600090815260016020908152604080832032845290915290205460ff161561122a5760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff16156112685760405160e560020a62461bcd028152600401610721906125db565b436000908152600160208181526040808420328552909152808320805460ff19908116841790915533808552919093208054909316909117909155801561132957600160a060020a03811660009081526003602052604090206112ca8261063b565b60048201556112d7610d7f565b6003808301918255600160a060020a0384166000908152602082905260409020835481556001808501549082015560028085015490820155915490820155600480830154908201556005918201549101555b336000818152600360205260409020611340611f82565b6113486120f9565b80541561145c57600061137e82600101546108d0670de0b6b3a76400006106b8600d548760000154611f6a90919063ffffffff16565b905060006113af83600201546108d0670de0b6b3a76400006106b8600e548860000154611f6a90919063ffffffff16565b90508115611405576113c1848361204b565b83600160a060020a03167f24d0ab5b06b63063080f522edb1dcdad5006b3c95d07fd69a40ac2f71be0efb3836040516113fc91815260200190565b60405180910390a25b80156114595761141584826121c2565b83600160a060020a03167fd2f33dd5633d5bce528bf0d7d806fb1fecaf06f6f6594e484f4f53e08f39aef08260405161145091815260200190565b60405180910390a25b50505b831561149157600580549082015560085461148290600160a060020a03168330876122cd565b805461148e9085611f76565b81555b600d5481546114ad91670de0b6b3a7640000916106b891611f6a565b6001820155600e5481546114ce91670de0b6b3a7640000916106b891611f6a565b6002820155604051848152600160a060020a038316907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c90602001610d71565b611516611834565b4210156115685760405160e560020a62461bcd02815260206004820152601860248201527f41564943506f6f6c3a206e6f74206f70656e65642079657400000000000000006044820152606401610721565b43600090815260016020908152604080832032845290915290205460ff16156115a65760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff16156115e45760405160e560020a62461bcd028152600401610721906125db565b436000908152600160208181526040808420328552909152808320805460ff19908116841790915533845292208054909216179055600a54421061166d5760405160e560020a62461bcd02815260206004820152601860248201527f41564943506f6f6c3a20506f6f6c20697320656e6465642100000000000000006044820152606401610721565b600554156118215760085460405160e060020a6370a08231028152306004820152600091600160a060020a0316906370a0823190602401602060405180830381865afa1580156116c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e591906125c2565b9050600081116116f55750611821565b60006116ff610e54565b905060008111611710575050611821565b600061171a611e4d565b604001519050600061174261173b856106b886670de0b6b3a7640000611f6a565b8390611f76565b6040805160608101825243815260208082018781528284018581526002805460018101825560009190915284517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60039092029182015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf830155517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad09091015591518681529293509133917fdf72051fd030d6527c405708cf7dd274525583218f86213d26aef85df1699205910160405180910390a250505050505b60055461182f906001611f76565b600555565b6000610d90611850615460600554611f6a90919063ffffffff16565b60095490611f76565b43600090815260016020908152604080832032845290915290205460ff16156118975760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff16156118d55760405160e560020a62461bcd028152600401610721906125db565b436000908152600160208181526040808420328552909152808320805460ff19908116841790915533808552919093208054909316909117909155801561199657600160a060020a03811660009081526003602052604090206119378261063b565b6004820155611944610d7f565b6003808301918255600160a060020a0384166000908152602082905260409020835481556001808501549082015560028085015490820155915490820155600480830154908201556005918201549101555b3360009081526003602052604081208054828255600182018390556002820192909255908015611a5f573360009081526003602052604090206004015480156119fa5760058054336000908152600360205260408120928301919091556004909101555b6000611a1660646106b860115486611f6a90919063ffffffff16565b90506000611a248483611f5e565b601254600854919250611a4491600160a060020a03908116911684611d9f565b600854611a5b90600160a060020a03163383611d9f565b5050505b60405181815233907f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969590602001610a3c565b600054600160a060020a03163314611aee5760405160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610721565b600160a060020a038116611b6d5760405160e560020a62461bcd02815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610721565b611b7681612270565b50565b6000818310611b8a575060006111e6565b600a548210611be557600a548310611ba4575060006111e6565b6009548311611bca5761117e600b54610eca600954600a54611f5e90919063ffffffff16565b61117e600b54610eca85600a54611f5e90919063ffffffff16565b6009548211611bf6575060006111e6565b6009548311611c1a5761117e600b54610eca60095485611f5e90919063ffffffff16565b600b5461117e90610eca8486611f5e565b43600090815260016020908152604080832032845290915290205460ff1615611c695760405160e560020a62461bcd028152600401610721906125db565b43600090815260016020908152604080832033845290915290205460ff1615611ca75760405160e560020a62461bcd028152600401610721906125db565b4360009081526001602081815260408084203285528252808420805460ff19908116851790915533808652828620805490921690941790556003909152909120611cef6120f9565b6000611d1e82600201546108d0670de0b6b3a76400006106b8600e548760000154611f6a90919063ffffffff16565b90508015611d3057611d3083826121c2565b600e548254611d4c91670de0b6b3a7640000916106b891611f6a565b6002830155604051818152600160a060020a038416907fd2f33dd5633d5bce528bf0d7d806fb1fecaf06f6f6594e484f4f53e08f39aef090602001610a3c565b6000611d9882846126db565b9392505050565b604051600160a060020a038316602482015260448101829052611e489084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612324565b505050565b611e7160405180606001604052806000815260200160008152602001600081525090565b6002611e7b610d7f565b81548110611e8b57611e8b612716565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b611eeb60405180606001604052806000815260200160008152602001600081525090565b6002611f1083600160a060020a03166000908152600360208190526040909120015490565b81548110611f2057611f20612716565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b6000611d9882846126c4565b6000611d988284612745565b6000611d988284612764565b600f544211611f8d57565b60085460405160e060020a6370a08231028152306004820152600091600160a060020a0316906370a0823190602401602060405180830381865afa158015611fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffd91906125c2565b90508060000361200e575042600f55565b600061201c600f5442611b79565b9050612040612037836106b884670de0b6b3a7640000611f6a565b600d5490611f76565b600d55505042600f55565b60065460405160e060020a6370a08231028152306004820152600091600160a060020a0316906370a0823190602401602060405180830381865afa158015612097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bb91906125c2565b90508015611e4857808211156120e257600654611e4890600160a060020a03168483611d9f565b600654611e4890600160a060020a03168484611d9f565b601054421161210457565b60085460405160e060020a6370a08231028152306004820152600091600160a060020a0316906370a0823190602401602060405180830381865afa158015612150573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217491906125c2565b905080600003612185575042601055565b60006121936010544261112d565b90506121b76121ae836106b884670de0b6b3a7640000611f6a565b600e5490611f76565b600e55505042601055565b60075460405160e060020a6370a08231028152306004820152600091600160a060020a0316906370a0823190602401602060405180830381865afa15801561220e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223291906125c2565b90508015611e48578082111561225957600754611e4890600160a060020a03168483611d9f565b600754611e4890600160a060020a03168484611d9f565b60008054600160a060020a0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051600160a060020a038085166024830152831660448201526064810182905261231e9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611de4565b50505050565b6000612379826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525085600160a060020a031661240c9092919063ffffffff16565b805190915015611e485780806020019051810190612397919061277c565b611e485760405160e560020a62461bcd02815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610721565b60606106c4848460008585600160a060020a0385163b6124715760405160e560020a62461bcd02815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610721565b60008086600160a060020a0316858760405161248d91906127ca565b60006040518083038185875af1925050503d80600081146124ca576040519150601f19603f3d011682016040523d82523d6000602084013e6124cf565b606091505b50915091506124df8282866124ea565b979650505050505050565b606083156124f9575081611d98565b8251156125095782518084602001fd5b8160405160e560020a62461bcd02815260040161072191906127e6565b8035600160a060020a038116811461253d57600080fd5b919050565b60006020828403121561255457600080fd5b611d9882612526565b60006020828403121561256f57600080fd5b5035919050565b6000806040838503121561258957600080fd5b61259283612526565b946020939093013593505050565b600080604083850312156125b357600080fd5b50508035926020909101359150565b6000602082840312156125d457600080fd5b5051919050565b60208082526026908201527f436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e6520667560408201527f6e6374696f6e0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f41564943506f6f6c3a2063616c6c6572206973206e6f7420746865206f70657260408201527f61746f7200000000000000000000000000000000000000000000000000000000606082015260800190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156126d6576126d6612695565b500390565b600082612711577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081600019048311821515161561275f5761275f612695565b500290565b6000821982111561277757612777612695565b500190565b60006020828403121561278e57600080fd5b81518015158114611d9857600080fd5b60005b838110156127b95781810151838201526020016127a1565b8381111561231e5750506000910152565b600082516127dc81846020870161279e565b9190910192915050565b602081526000825180602084015261280581604085016020870161279e565b601f01601f1916919091016040019291505056fea2646970667358221220f3941e668952b4142b50acbd456e92093351eadd85121f98c94ec3f40ae90b3164736f6c634300080d003300000000000000000000000059b18817ca9f4ad2dee6fbf30132df6aeb9d763d000000000000000000000000c65bc1e906771e105fbacbd8dfe3862ee7be378e000000000000000000000000b7222757c546b13957307602dee988c6c8bd32f0000000000000000000000000f708929ccfded4142420592caaef42bd41c8a367000000000000000000000000b2325584dbbde69ff0d7dd91682aacd33854c85a000000000000000000000000000000000000000000000000000000006324d5c0

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

00000000000000000000000059b18817ca9f4ad2dee6fbf30132df6aeb9d763d000000000000000000000000c65bc1e906771e105fbacbd8dfe3862ee7be378e000000000000000000000000b7222757c546b13957307602dee988c6c8bd32f0000000000000000000000000f708929ccfded4142420592caaef42bd41c8a367000000000000000000000000b2325584dbbde69ff0d7dd91682aacd33854c85a000000000000000000000000000000000000000000000000000000006324d5c0

-----Decoded View---------------
Arg [0] : _avicToken (address): 0x59b18817ca9f4ad2dee6fbf30132df6aeb9d763d
Arg [1] : _chamToken (address): 0xc65bc1e906771e105fbacbd8dfe3862ee7be378e
Arg [2] : _yw30Token (address): 0xb7222757c546b13957307602dee988c6c8bd32f0
Arg [3] : _polWallet (address): 0xf708929ccfded4142420592caaef42bd41c8a367
Arg [4] : _adminAddress (address): 0xb2325584dbbde69ff0d7dd91682aacd33854c85a
Arg [5] : _poolStartTime (uint256): 1663358400

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000059b18817ca9f4ad2dee6fbf30132df6aeb9d763d
Arg [1] : 000000000000000000000000c65bc1e906771e105fbacbd8dfe3862ee7be378e
Arg [2] : 000000000000000000000000b7222757c546b13957307602dee988c6c8bd32f0
Arg [3] : 000000000000000000000000f708929ccfded4142420592caaef42bd41c8a367
Arg [4] : 000000000000000000000000b2325584dbbde69ff0d7dd91682aacd33854c85a
Arg [5] : 000000000000000000000000000000000000000000000000000000006324d5c0


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.