Contract 0xe559092d2e80d9b1d91a641ce25bacc3cfdcf689

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x14203f0dc339c6cf2d7577d90677ab44eb0244fd927c4e3e6ec482b24d6569caDeposit752164662022-09-30 8:38:1840 mins ago0x9989e2b4fa9e2a6cd379a5429af93df371ba164a IN  Trisolaris: pTRI Token0 ETH0.00000880768
0xe956bd43161d18321f5201c2a968423296fb929059f345086c29346013b84c07Harvest752162072022-09-30 8:32:3346 mins ago0xa5bf468f2e81288fecc921ca004ef665c4daaf09 IN  Trisolaris: pTRI Token0 ETH0.00000628166
0x17f2de16da68b4232d5e7e4bdf637520bd9a561184f7ed081f5a630eae312d7fDeposit752125042022-09-30 7:11:052 hrs 7 mins ago0x7cd9fdb8f5bce475d29d25cfd5fde3f1665ca0dd IN  Trisolaris: pTRI Token0 ETH0.00000880768
0xc7c177d0cb826b72551bedcd85f36d79bd5d9e3e65819f3f53f8caad08daa930Deposit752080592022-09-30 5:33:233 hrs 45 mins ago0xa87226631ccdfd73e826cfa00dac6178caec146a IN  Trisolaris: pTRI Token0 ETH0.00000880768
0x74173cfe72f763554a6c931449a0c05e4ada45ec4f6110eea8059a80df64e916Deposit752046222022-09-30 4:16:555 hrs 1 min ago0x00b3ea07fc27c676fa8dc2a1647521aba2156b8b IN  Trisolaris: pTRI Token0 ETH0.00000747159
0x32feb6cdb7203ec8d374a53c2a0f56caf3f4c29258f1ced65595d06297be4bf4Harvest752045982022-09-30 4:16:235 hrs 2 mins ago0x00b3ea07fc27c676fa8dc2a1647521aba2156b8b IN  Trisolaris: pTRI Token0 ETH0.00000508466
0x24e2b3fa1088d023550cfb1db092fc2e7850135ea8f0be82a1e738835e8c7a55Migrate752039352022-09-30 4:01:425 hrs 16 mins ago0xe0a86afb73c0922a50d4a985a25507ecda8a9b51 IN  Trisolaris: pTRI Token0 ETH0.0000122381
0x184a8dd91cd7535df222c5c4e1fea04e29d8f4a69f9da2421377d3b442cb07a1Withdraw752030812022-09-30 3:43:025 hrs 35 mins ago0xaf302aa751058797c6ab5249cb83547a6357763a IN  Trisolaris: pTRI Token0 ETH0
0x513d5147fa619a0f9c5cb5d492cf061e5df345f513d5eeb66c8b4b209d66d111Deposit752028502022-09-30 3:37:565 hrs 40 mins ago0xaf302aa751058797c6ab5249cb83547a6357763a IN  Trisolaris: pTRI Token0 ETH0
0xb90ca52dc74d41bbc2adde8369bcb708fb76ead652d98d9236713ca9408b2241Deposit752027402022-09-30 3:35:315 hrs 43 mins ago0xc450b1401d9eacead337398b43568b04da233405 IN  Trisolaris: pTRI Token0 ETH0.00000747075
0xe1162bf516ad702f4760892aee811abbe363d6f8fc015d0efb3138dceea1e4a3Deposit752015092022-09-30 3:08:326 hrs 10 mins ago0x436aacfbc547cef9d8197aee89e4ec958b9b007f IN  Trisolaris: pTRI Token0 ETH0
0xefd0285256bcbfae52ece91d98e15466636d4fbc9df698a8787943c76916db05Harvest752013752022-09-30 3:05:346 hrs 13 mins ago0x436aacfbc547cef9d8197aee89e4ec958b9b007f IN  Trisolaris: pTRI Token0 ETH0
0x1ae05477daf4d37801eff2c265a1561085d71f9afa7e55c4cb273e6ee043c08aDeposit751989172022-09-30 2:11:117 hrs 7 mins ago0xc450b1401d9eacead337398b43568b04da233405 IN  Trisolaris: pTRI Token0 ETH0.00000747075
0x4d87af2594ce2fe7625080e05c1b0de39f161b24961f84c8f6816a590644a72bDeposit751986982022-09-30 2:06:227 hrs 12 mins ago0xe124ac1d71ab774f31b884fefafd126a66e5b935 IN  Trisolaris: pTRI Token0 ETH0
0x70d1d0d858a62b043ebe73796724f43c22da70d053b1bcc3205500ef015d3b67Harvest751979072022-09-30 1:48:587 hrs 29 mins ago0x49c67681078f778480e5dd67c9be1407972771d8 IN  Trisolaris: pTRI Token0 ETH0.0000062825
0x4efeb7c021841a266cb5d9a66b745c40694cbc1eb5675a2d5556c18ff6523387Deposit751944852022-09-30 0:33:258 hrs 45 mins ago0xa5ddca80080ad69c1517159718e988880f151529 IN  Trisolaris: pTRI Token0 ETH0
0x0926c0a74173b894516a1329b9baa30d809df414962841aa910178257f57b190Harvest751944692022-09-30 0:33:038 hrs 45 mins ago0xa5ddca80080ad69c1517159718e988880f151529 IN  Trisolaris: pTRI Token0 ETH0
0x15cef46b298df3dbb28c03db5fb9995e16bcd13192c6943294c241e3378ee25fDeposit751926062022-09-29 23:51:459 hrs 26 mins ago0x38a426708de99f5780f362920cec69e70a4006f3 IN  Trisolaris: pTRI Token0 ETH0.00000747075
0xb366e65c144766159a4eba682ed444871826df1d1829eb65a216d050958a37a7Harvest751925882022-09-29 23:51:219 hrs 27 mins ago0x38a426708de99f5780f362920cec69e70a4006f3 IN  Trisolaris: pTRI Token0 ETH0.0000050855
0x4eadfb0a5ffdfff0ce7effc7bfdfdeb4939bdb9b539963217ffe410ad145acd1Harvest751896792022-09-29 22:46:5610 hrs 31 mins ago0x943980b467fe194beb923daf7a544abce90b5f93 IN  Trisolaris: pTRI Token0 ETH0
0x944fc0b3e1c5288ec2438fa197e44335fd2e860781c7c1d626a9116044c9a2f9Deposit751868572022-09-29 21:44:1411 hrs 34 mins ago0xc450b1401d9eacead337398b43568b04da233405 IN  Trisolaris: pTRI Token0 ETH0.00000747075
0x6b15c37611666fac40f9ae796345fa8193e575b096a68e10283efb7aef9f7762Deposit751866392022-09-29 21:39:2511 hrs 39 mins ago0x56ddcbc09713d2ba8dff06ec008cbecf4b702bfb IN  Trisolaris: pTRI Token0 ETH0
0xbf488bb5bea6000dc3690ece0aed98e4ff8a5870e4aed6a7e57e0292b884afe7Harvest751866172022-09-29 21:38:5611 hrs 39 mins ago0xc450b1401d9eacead337398b43568b04da233405 IN  Trisolaris: pTRI Token0 ETH0.0000062825
0x84578a47be3772ab7639a2c99df487772fe9c52244cc0a98bf8b85c3dfc8232dMigrate751866002022-09-29 21:38:3511 hrs 40 mins ago0xca4b599a1deac69df773d11a9fbb697e53cb0328 IN  Trisolaris: pTRI Token0 ETH0.00001223726
0xfc674ea119248f2a449e4b7f1b7b2138cb350b0d6ca4fd4b6f7385d35ad11e09Deposit751859962022-09-29 21:25:1811 hrs 53 mins ago0x0240311e085f222ba91eca7b2274660f2be1c82e IN  Trisolaris: pTRI Token0 ETH0
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StableTRIStaking

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : StableTRIStaking.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity 0.7.6;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/proxy/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import { ITriBar } from "../interfaces/ITriBar.sol";

/**
 * @title Stable TRI Staking
 * @author Trader TRI
 * @notice StableTRIStaking is a contract that allows TRI deposits and receives stablecoins sent by MoneyMaker's daily
 * harvests. Users deposit TRI and receive a share of what has been sent by MoneyMaker based on their participation of
 * the total deposited TRI. It is similar to a MasterChef, but we allow for claiming of different reward tokens
 * (in case at some point we wish to change the stablecoin rewarded).
 * Every time `updateReward(token)` is called, We distribute the balance of that tokens as rewards to users that are
 * currently staking inside this contract, and they can claim it using `withdraw(0)`
 */
contract StableTRIStaking is Ownable, ERC20 {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /// @notice Info of each user
    struct UserInfo {
        mapping(IERC20 => uint256) rewardDebt;
        /**
         * @notice We do some fancy math here. Basically, any point in time, the amount of TRIs
         * entitled to a user but is pending to be distributed is:
         *
         *   pending reward = (balanceOf(user) * accRewardPerShare) - user.rewardDebt[token]
         *
         * Whenever a user deposits or withdraws TRI. Here's what happens:
         *   1. accRewardPerShare (and `lastRewardBalance`) gets updated
         *   2. User receives the pending reward sent to his/her address
         *   3. User's `balance` gets updated
         *   4. User's `rewardDebt[token]` gets updated
         */
    }

    IERC20 public tri;

    /// @dev Internal balance of TRI, this gets updated on user deposits / withdrawals
    /// this allows to reward users with TRI
    uint256 public internalTRIBalance;
    /// @notice Array of tokens that users can claim
    IERC20[] public rewardTokens;
    mapping(IERC20 => bool) public isRewardToken;
    /// @notice Last reward balance of `token`
    mapping(IERC20 => uint256) public lastRewardBalance;

    address public feeCollector;

    /// @notice The deposit fee, scaled to `DEPOSIT_FEE_PERCENT_PRECISION`
    uint256 public depositFeePercent;
    /// @notice The precision of `depositFeePercent`
    uint256 public immutable DEPOSIT_FEE_PERCENT_PRECISION = 1e18;
    /// @notice The max deposit fee value, scaled to `DEPOSIT_FEE_PERCENT_PRECISION`
    uint256 public immutable MAX_DEPOSIT_FEE_PERCENT;

    /// @notice Accumulated `token` rewards per share, scaled to `ACC_REWARD_PER_SHARE_PRECISION`
    mapping(IERC20 => uint256) public accRewardPerShare;
    /// @notice The precision of `accRewardPerShare`
    uint256 public immutable ACC_REWARD_PER_SHARE_PRECISION = 1e24;

    /// @dev Info of each user that stakes TRI
    mapping(address => UserInfo) private userInfo;

    /// @notice Emitted when a user deposits TRI
    event Deposit(address indexed user, uint256 amount, uint256 fee);

    /// @notice Emitted when owner changes the deposit fee percentage
    event DepositFeeChanged(uint256 newFee, uint256 oldFee);

    /// @notice Emitted when a user withdraws TRI
    event Withdraw(address indexed user, uint256 amount);

    /// @notice Emitted when a user claims reward
    event ClaimReward(address indexed user, address indexed rewardToken, uint256 amount);

    /// @notice Emitted when a user emergency withdraws its TRI
    event EmergencyWithdraw(address indexed user, uint256 amount);

    /// @notice Emitted when owner adds a token to the reward tokens list
    event RewardTokenAdded(address token);

    /// @notice Emitted when owner removes a token from the reward tokens list
    event RewardTokenRemoved(address token);

    /// @notice Emitted when owner migrates from xTRI to pTRI
    event Migrated(address xTRI, address asset, uint256 triUnstaked, uint256 shares);

    /// @notice Emitted when owner updates the feeCollector
    event FeeCollectorUpdated(address feeCollector);

    /**
     * @notice Initialize a new StableTRIStaking contract
     * @dev This contract needs to receive an ERC20 `_rewardToken` in order to distribute them
     * (with MoneyMaker in our case)
     * @param _rewardToken The address of the ERC20 reward token
     * @param _tri The address of the TRI token
     * @param _feeCollector The address where deposit fees will be sent
     * @param _depositFeePercent The deposit fee percent, scalled to 1e18, e.g. 3% is 3e16
     */
    constructor(
        string memory name_,
        string memory symbol_,
        IERC20 _rewardToken,
        IERC20 _tri,
        address _feeCollector,
        uint256 _depositFeePercent
    ) ERC20(name_, symbol_) {
        uint256 _tempMaxDepositFeePercent = 5e17;

        require(address(_rewardToken) != address(0), "StableTRIStaking: reward token can't be address(0)");
        require(address(_tri) != address(0), "StableTRIStaking: tri can't be address(0)");
        require(_feeCollector != address(0), "StableTRIStaking: fee collector can't be address(0)");
        require(
            _depositFeePercent <= _tempMaxDepositFeePercent,
            "StableTRIStaking: max deposit fee can't be greater than 50%"
        );

        tri = _tri;
        depositFeePercent = _depositFeePercent;
        feeCollector = _feeCollector;

        isRewardToken[_rewardToken] = true;
        rewardTokens.push(_rewardToken);

        MAX_DEPOSIT_FEE_PERCENT = _tempMaxDepositFeePercent;
    }

    /*
     * onlyOwner functions
     */

    /**
     * @notice Add a reward token
     * @param _rewardToken The address of the reward token
     */
    function addRewardToken(IERC20 _rewardToken) external onlyOwner {
        require(
            !isRewardToken[_rewardToken] && address(_rewardToken) != address(0),
            "StableTRIStaking: token can't be added"
        );
        require(rewardTokens.length < 25, "StableTRIStaking: list of token too big");
        rewardTokens.push(_rewardToken);
        isRewardToken[_rewardToken] = true;
        updateReward(_rewardToken);
        emit RewardTokenAdded(address(_rewardToken));
    }

    /**
     * @notice Add a reward token
     * @param feeCollector_ The address where deposit fees will be sent
     */
    function setFeeCollector(address feeCollector_) external onlyOwner {
        feeCollector = feeCollector_;
        emit FeeCollectorUpdated(feeCollector);
    }

    /**
     * @notice Remove a reward token
     * @param _rewardToken The address of the reward token
     */
    function removeRewardToken(IERC20 _rewardToken) external onlyOwner {
        require(isRewardToken[_rewardToken], "StableTRIStaking: token can't be removed");
        updateReward(_rewardToken);
        isRewardToken[_rewardToken] = false;
        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            if (rewardTokens[i] == _rewardToken) {
                rewardTokens[i] = rewardTokens[_len - 1];
                rewardTokens.pop();
                break;
            }
        }
        emit RewardTokenRemoved(address(_rewardToken));
    }

    /**
     * @notice Set the deposit fee percent
     * @param _depositFeePercent The new deposit fee percent
     */
    function setDepositFeePercent(uint256 _depositFeePercent) external onlyOwner {
        require(
            _depositFeePercent <= MAX_DEPOSIT_FEE_PERCENT,
            "StableTRIStaking: deposit fee can't be greater than 50%"
        );
        uint256 oldFee = depositFeePercent;
        depositFeePercent = _depositFeePercent;
        emit DepositFeeChanged(_depositFeePercent, oldFee);
    }

    /*
     * View only functions
     */

    /**
     * @notice Get user info
     * @param _user The address of the user
     * @param _rewardToken The address of the reward token
     * @return The amount of TRI user has deposited
     * @return The reward debt for the chosen token
     */
    function getUserInfo(address _user, IERC20 _rewardToken) external view returns (uint256, uint256) {
        require(isRewardToken[_rewardToken], "StableTRIStaking: reward token is not a reward token");
        UserInfo storage user = userInfo[_user];
        return (balanceOf(_user), user.rewardDebt[_rewardToken]);
    }

    /**
     * @notice Get the number of reward tokens
     * @return The length of the array
     */
    function rewardTokensLength() external view returns (uint256) {
        return rewardTokens.length;
    }

    /**
     * @notice View function to see pending reward token on frontend
     * @param _user The address of the user
     * @param _token The address of the token
     * @return `_user`'s pending reward token
     */
    function pendingReward(address _user, IERC20 _token) external view returns (uint256) {
        require(isRewardToken[_token], "StableTRIStaking: wrong reward token");
        UserInfo storage user = userInfo[_user];
        uint256 _totalTRI = internalTRIBalance;
        uint256 _accRewardTokenPerShare = accRewardPerShare[_token];

        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == tri ? _currRewardBalance.sub(_totalTRI) : _currRewardBalance;

        if (_rewardBalance != lastRewardBalance[_token] && _totalTRI != 0) {
            uint256 _accruedReward = _rewardBalance.sub(lastRewardBalance[_token]);
            _accRewardTokenPerShare = _accRewardTokenPerShare.add(
                _accruedReward.mul(ACC_REWARD_PER_SHARE_PRECISION).div(_totalTRI)
            );
        }
        return
            balanceOf(_user).mul(_accRewardTokenPerShare).div(ACC_REWARD_PER_SHARE_PRECISION).sub(
                user.rewardDebt[_token]
            );
    }

    /*
     * Internal functions
     */

    /**
     * @notice internal harvest function to claim only rewards till this block
     * @param userAddress The address of the user which has to claim the rewards
     * @param _previousAmount Previous balance of the user
     * @param _newAmount New balance of the user
     */
    function _harvest(
        address userAddress,
        uint256 _previousAmount,
        uint256 _newAmount
    ) internal {
        UserInfo storage user = userInfo[userAddress];

        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            IERC20 _token = rewardTokens[i];
            updateReward(_token);

            uint256 _previousRewardDebt = user.rewardDebt[_token];
            user.rewardDebt[_token] = _newAmount.mul(accRewardPerShare[_token]).div(ACC_REWARD_PER_SHARE_PRECISION);

            if (_previousAmount != 0) {
                uint256 _pending = _previousAmount
                    .mul(accRewardPerShare[_token])
                    .div(ACC_REWARD_PER_SHARE_PRECISION)
                    .sub(_previousRewardDebt);
                if (_pending != 0) {
                    safeTokenTransfer(_token, userAddress, _pending);
                    emit ClaimReward(userAddress, address(_token), _pending);
                }
            }
        }
    }

    /**
     * @notice Internal function called before an address sends pTRI tokens.
     * Function manages the sender's userInfo and distributes any outstanding
     * rewards prior to sending pTRI tokens.
     * @param _sender The address of the user sending pTRI tokens
     * @param _amount The amount of the tokens being sent
     */
    function _beforeSend(address _sender, uint256 _amount) internal {
        // Managing userInfo + pendingTokens of the sender
        uint256 _previousAmountSender = balanceOf(_sender);
        uint256 _newAmountSender = _previousAmountSender.sub(
            _amount,
            "StableTRIStaking: withdraw amount exceeds balance"
        );
        _harvest(_sender, _previousAmountSender, _newAmountSender);
    }

    /**
     * @notice Internal function called before an address receives pTRI tokens.
     * Function manages the recipient's userInfo and distributes any outstanding
     * rewards prior to reciving pTRI tokens.
     * @param _recipient The address of the user which is receiving pTRI tokens
     * @param _amount The amount of the tokens being received
     */
    function _beforeReceive(address _recipient, uint256 _amount) internal {
        // Managing userInfo + pendingTokens of the receiver
        uint256 _previousAmountRecepient = balanceOf(_recipient);
        uint256 _newAmountRecepient = _previousAmountRecepient.add(_amount);
        _harvest(_recipient, _previousAmountRecepient, _newAmountRecepient);
    }

    /*
        State changing functions
    */

    /**
     * @notice Update reward variables
     * @param _token The address of the reward token
     * @dev Needs to be called before any deposit or withdrawal
     */
    function updateReward(IERC20 _token) public {
        require(isRewardToken[_token], "StableTRIStaking: wrong reward token");

        uint256 _totalTRI = internalTRIBalance;

        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == tri ? _currRewardBalance.sub(_totalTRI) : _currRewardBalance;

        // Did StableTRIStaking receive any token
        if (_rewardBalance == lastRewardBalance[_token] || _totalTRI == 0) {
            return;
        }

        uint256 _accruedReward = _rewardBalance.sub(lastRewardBalance[_token]);

        accRewardPerShare[_token] = accRewardPerShare[_token].add(
            _accruedReward.mul(ACC_REWARD_PER_SHARE_PRECISION).div(_totalTRI)
        );
        lastRewardBalance[_token] = _rewardBalance;
    }

    /**
     * @notice Safe token transfer function, just in case if rounding error
     * causes pool to not have enough reward tokens
     * @param _token The address of then token to transfer
     * @param _to The address that will receive `_amount` `rewardToken`
     * @param _amount The amount to send to `_to`
     */
    function safeTokenTransfer(
        IERC20 _token,
        address _to,
        uint256 _amount
    ) internal {
        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == tri ? _currRewardBalance.sub(internalTRIBalance) : _currRewardBalance;

        if (_amount > _rewardBalance) {
            lastRewardBalance[_token] = lastRewardBalance[_token].sub(_rewardBalance);
            _token.safeTransfer(_to, _rewardBalance);
        } else {
            lastRewardBalance[_token] = lastRewardBalance[_token].sub(_amount);
            _token.safeTransfer(_to, _amount);
        }
    }

    /**
     * @notice Deposit TRI for reward token allocation
     * @param _amount The amount of TRI to deposit
     */
    function deposit(uint256 _amount) external {
        uint256 _fee = _amount.mul(depositFeePercent).div(DEPOSIT_FEE_PERCENT_PRECISION);
        uint256 _amountMinusFee = _amount.sub(_fee);

        _beforeReceive(_msgSender(), _amountMinusFee);

        internalTRIBalance = internalTRIBalance.add(_amountMinusFee);
        if (depositFeePercent > 0) {
            tri.safeTransferFrom(_msgSender(), feeCollector, _fee);
        }
        tri.safeTransferFrom(_msgSender(), address(this), _amountMinusFee);
        _mint(_msgSender(), _amountMinusFee);
        emit Deposit(_msgSender(), _amountMinusFee, _fee);
    }

    /**
     * @notice Withdraw TRI and harvest the rewards
     * @param _amount The amount of TRI to withdraw
     */
    function withdraw(uint256 _amount) external {
        _beforeSend(_msgSender(), _amount);

        internalTRIBalance = internalTRIBalance.sub(_amount);
        tri.safeTransfer(_msgSender(), _amount);
        _burn(_msgSender(), _amount);
        emit Withdraw(_msgSender(), _amount);
    }

    /**
     * @notice Withdraw without caring about rewards. EMERGENCY ONLY
     */
    function emergencyWithdraw() external {
        UserInfo storage user = userInfo[_msgSender()];
        uint256 _amount = balanceOf(_msgSender());
        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            IERC20 _token = rewardTokens[i];
            user.rewardDebt[_token] = 0;
        }
        internalTRIBalance = internalTRIBalance.sub(_amount);
        tri.safeTransfer(_msgSender(), _amount);
        _burn(_msgSender(), _amount);
        emit EmergencyWithdraw(_msgSender(), _amount);
    }

    function migrate(address xTRI_, uint256 xTRIAmount_) external {
        IERC20(xTRI_).safeTransferFrom(_msgSender(), address(this), xTRIAmount_);

        uint256 triBalanceBefore_ = tri.balanceOf(address(this));
        ITriBar(xTRI_).leave(xTRIAmount_);
        uint256 triBalanceUnstaked_ = tri.balanceOf(address(this)).sub(triBalanceBefore_);

        uint256 _fee = triBalanceUnstaked_.mul(depositFeePercent).div(DEPOSIT_FEE_PERCENT_PRECISION);
        uint256 _amountMinusFee = triBalanceUnstaked_.sub(_fee);

        _beforeReceive(_msgSender(), _amountMinusFee);

        internalTRIBalance = internalTRIBalance.add(_amountMinusFee);
        if (depositFeePercent > 0) {
            tri.safeTransferFrom(address(this), feeCollector, _fee);
        }
        _mint(_msgSender(), _amountMinusFee);
        emit Migrated(_msgSender(), xTRI_, triBalanceUnstaked_, xTRIAmount_);
    }

    /**
     * @notice external harvest function to claim only rewards till this block
     */
    function harvest(address _receiver) external {
        uint256 _amount = balanceOf(_receiver);
        _harvest(_receiver, _amount, _amount);
    }

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

        _transfer(_msgSender(), recipient, amount);
        return true;
    }

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

        _transfer(sender, recipient, amount);
        uint256 newAllowance = allowance(sender, _msgSender()).sub(amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), newAllowance);
        return true;
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 10 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 4 of 10 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !Address.isContract(address(this));
    }
}

File 5 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

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

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

File 6 of 10 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

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

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

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

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

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

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

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

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 8 of 10 : ITriBar.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.7.6;

interface ITriBar {
    function leave(uint256 xTriAmount) external;
}

File 9 of 10 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IERC20","name":"_tri","type":"address"},{"internalType":"address","name":"_feeCollector","type":"address"},{"internalType":"uint256","name":"_depositFeePercent","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimReward","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":"fee","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldFee","type":"uint256"}],"name":"DepositFeeChanged","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":false,"internalType":"address","name":"feeCollector","type":"address"}],"name":"FeeCollectorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"xTRI","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"triUnstaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Migrated","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":"token","type":"address"}],"name":"RewardTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"RewardTokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","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":"ACC_REWARD_PER_SHARE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_FEE_PERCENT_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DEPOSIT_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"accRewardPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"}],"name":"addRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"}],"name":"getUserInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"internalTRIBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"isRewardToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"lastRewardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"xTRI_","type":"address"},{"internalType":"uint256","name":"xTRIAmount_","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"}],"name":"removeRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositFeePercent","type":"uint256"}],"name":"setDepositFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"feeCollector_","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tri","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"updateReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e0604052670de0b6b3a764000060805269d3c21bcecceda100000060c0523480156200002b57600080fd5b506040516200331c3803806200331c833981810160405260c08110156200005157600080fd5b81019080805160405193929190846401000000008211156200007257600080fd5b9083019060208201858111156200008857600080fd5b8251640100000000811182820188101715620000a357600080fd5b82525081516020918201929091019080838360005b83811015620000d2578181015183820152602001620000b8565b50505050905090810190601f168015620001005780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200012457600080fd5b9083019060208201858111156200013a57600080fd5b82516401000000008111828201881017156200015557600080fd5b82525081516020918201929091019080838360005b83811015620001845781810151838201526020016200016a565b50505050905090810190601f168015620001b25780820380516001836020036101000a031916815260200191505b5060409081526020820151908201516060830151608090930151919450925085856000620001df62000424565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35081516200023e90600490602085019062000428565b5080516200025490600590602084019062000428565b50506006805460ff19166012179055506706f05b59d3b200006001600160a01b038516620002b45760405162461bcd60e51b8152600401808060200182810382526032815260200180620032af6032913960400191505060405180910390fd5b6001600160a01b038416620002fb5760405162461bcd60e51b8152600401808060200182810382526029815260200180620032866029913960400191505060405180910390fd5b6001600160a01b038316620003425760405162461bcd60e51b8152600401808060200182810382526033815260200180620032536033913960400191505060405180910390fd5b80821115620003835760405162461bcd60e51b815260040180806020018281038252603b815260200180620032e1603b913960400191505060405180910390fd5b600680546001600160a01b0395861661010002610100600160a81b0319909116179055600c91909155600b80549284166001600160a01b0319938416179055929091166000818152600960205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee301805490921617905560a05250620004d49050565b3390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620004605760008555620004ab565b82601f106200047b57805160ff1916838001178555620004ab565b82800160010185558215620004ab579182015b82811115620004ab5782518255916020019190600101906200048e565b50620004b9929150620004bd565b5090565b5b80821115620004b95760008155600101620004be565b60805160a05160c051612d2a6200052960003980610cda5280611099528061140552806114565280611e845280611ef3525080610a9b5280610b415250806115d252806117b152806118d05250612d2a6000f3fe608060405234801561001057600080fd5b50600436106102925760003560e01c80638da5cb5b11610160578063b6b55f25116100d8578063db2e21bc1161008c578063f232568d11610071578063f232568d1461070e578063f2801fe714610716578063f2fde38b1461075d57610292565b8063db2e21bc146106d8578063dd62ed3e146106e057610292565b8063c415b95c116100bd578063c415b95c146106c0578063cc1252ae146106c8578063d60f8424146106d057610292565b8063b6b55f251461069b578063bf199e62146106b857610292565b8063a457c2d71161012f578063a9059cbb11610114578063a9059cbb1461061d578063ad68ebf714610649578063b5fd73f81461067557610292565b8063a457c2d7146105e9578063a610708a1461061557610292565b80638da5cb5b1461058557806395d89b411461058d5780639ced7e7614610595578063a42dce80146105c357610292565b8063313ce5671161020e5780635fc0d9e0116101c257806370a08231116101a757806370a082311461051e578063715018a6146105445780637bb7bed11461054c57610292565b80635fc0d9e0146104d2578063632447c9146104f857610292565b80633c97d5ae116101f35780633c97d5ae1461047e5780633d509c97146104865780635dcea4d4146104ac57610292565b8063313ce56714610434578063395093511461045257610292565b80631c03e6cc1161026557806322b86cec1161024a57806322b86cec146103d957806323b872dd146103e15780632e1a7d4d1461041757610292565b80631c03e6cc146103965780632052eb77146103bc57610292565b806306fdde0314610297578063095ea7b3146103145780630e5c011e1461035457806318160ddd1461037c575b600080fd5b61029f610783565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d95781810151838201526020016102c1565b50505050905090810190601f1680156103065780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103406004803603604081101561032a57600080fd5b506001600160a01b038135169060200135610819565b604080519115158252519081900360200190f35b61037a6004803603602081101561036a57600080fd5b50356001600160a01b0316610837565b005b610384610853565b60408051918252519081900360200190f35b61037a600480360360208110156103ac57600080fd5b50356001600160a01b0316610859565b61037a600480360360208110156103d257600080fd5b5035610a25565b610384610b3f565b610340600480360360608110156103f757600080fd5b506001600160a01b03813581169160208101359091169060400135610b63565b61037a6004803603602081101561042d57600080fd5b5035610bdc565b61043c610c7c565b6040805160ff9092168252519081900360200190f35b6103406004803603604081101561046857600080fd5b506001600160a01b038135169060200135610c85565b610384610cd8565b61037a6004803603602081101561049c57600080fd5b50356001600160a01b0316610cfc565b610384600480360360208110156104c257600080fd5b50356001600160a01b0316610f0e565b610384600480360360208110156104e857600080fd5b50356001600160a01b0316610f20565b61037a6004803603602081101561050e57600080fd5b50356001600160a01b0316610f32565b6103846004803603602081101561053457600080fd5b50356001600160a01b0316611111565b61037a61112c565b6105696004803603602081101561056257600080fd5b50356111ea565b604080516001600160a01b039092168252519081900360200190f35b610569611214565b61029f611223565b610384600480360360408110156105ab57600080fd5b506001600160a01b0381358116916020013516611284565b61037a600480360360208110156105d957600080fd5b50356001600160a01b031661149a565b610340600480360360408110156105ff57600080fd5b506001600160a01b038135169060200135611568565b6103846115d0565b6103406004803603604081101561063357600080fd5b506001600160a01b0381351690602001356115f4565b61037a6004803603604081101561065f57600080fd5b506001600160a01b038135169060200135611623565b6103406004803603602081101561068b57600080fd5b50356001600160a01b03166118b4565b61037a600480360360208110156106b157600080fd5b50356118c9565b6103846119e5565b6105696119eb565b6103846119fa565b610569611a00565b61037a611a14565b610384600480360360408110156106f657600080fd5b506001600160a01b0381358116916020013516611b32565b610384611b5d565b6107446004803603604081101561072c57600080fd5b506001600160a01b0381358116916020013516611b63565b6040805192835260208301919091528051918290030190f35b61037a6004803603602081101561077357600080fd5b50356001600160a01b0316611c02565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561080f5780601f106107e45761010080835404028352916020019161080f565b820191906000526020600020905b8154815290600101906020018083116107f257829003601f168201915b5050505050905090565b600061082d610826611d16565b8484611d1a565b5060015b92915050565b600061084282611111565b905061084f828283611e06565b5050565b60035490565b610861611d16565b6001600160a01b0316610872611214565b6001600160a01b0316146108cd576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811660009081526009602052604090205460ff161580156108fe57506001600160a01b03811615155b6109395760405162461bcd60e51b8152600401808060200182810382526026815260200180612bf96026913960400191505060405180910390fd5b60085460191161097a5760405162461bcd60e51b8152600401808060200182810382526027815260200180612c506027913960400191505060405180910390fd5b6008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0384169081179091556000908152600960205260409020805460ff191690911790556109e681610f32565b604080516001600160a01b038316815290517ff3e4c2c64e71e6ba2eaab9a599bced62f9eb91d2cda610bf41aa8c80ff2cf8269181900360200190a150565b610a2d611d16565b6001600160a01b0316610a3e611214565b6001600160a01b031614610a99576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000000000000811115610af85760405162461bcd60e51b8152600401808060200182810382526037815260200180612b0f6037913960400191505060405180910390fd5b600c805490829055604080518381526020810183905281517f6be5411ea11f30380402ca68832d060d744cbc5f62d2344495c10256ba93904a929181900390910190a15050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610b6f8483611f91565b610b798383611fd8565b610b84848484611ff1565b6000610bbb83604051806060016040528060288152602001612b6760289139610bb488610baf611d16565b611b32565b919061214e565b9050610bcf85610bc9611d16565b83611d1a565b60019150505b9392505050565b610bed610be7611d16565b82611f91565b600754610bfa90826121e5565b600755610c20610c08611d16565b60065461010090046001600160a01b03169083612242565b610c31610c2b611d16565b826122ae565b610c39611d16565b6001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364826040518082815260200191505060405180910390a250565b60065460ff1690565b600061082d610c92611d16565b84610cd38560026000610ca3611d16565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906123aa565b611d1a565b7f000000000000000000000000000000000000000000000000000000000000000081565b610d04611d16565b6001600160a01b0316610d15611214565b6001600160a01b031614610d70576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811660009081526009602052604090205460ff16610dc75760405162461bcd60e51b8152600401808060200182810382526028815260200180612a9b6028913960400191505060405180910390fd5b610dd081610f32565b6001600160a01b0381166000908152600960205260408120805460ff19169055600854905b81811015610ecd57826001600160a01b031660088281548110610e1457fe5b6000918252602090912001546001600160a01b03161415610ec55760086001830381548110610e3f57fe5b600091825260209091200154600880546001600160a01b039092169183908110610e6557fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506008805480610e9e57fe5b600082815260209020810160001990810180546001600160a01b0319169055019055610ecd565b600101610df5565b50604080516001600160a01b038416815290517f66257bcef574219c04f7c05f7a1c78d599da10491294c92a5805c48b4cdf50099181900360200190a15050565b600d6020526000908152604090205481565b600a6020526000908152604090205481565b6001600160a01b03811660009081526009602052604090205460ff16610f895760405162461bcd60e51b8152600401808060200182810382526024815260200180612cd56024913960400191505060405180910390fd5b600754604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b158015610fd657600080fd5b505afa158015610fea573d6000803e3d6000fd5b505050506040513d602081101561100057600080fd5b50516006549091506000906001600160a01b0385811661010090920416146110285781611032565b61103282846121e5565b6001600160a01b0385166000908152600a6020526040902054909150811480611059575082155b156110665750505061110e565b6001600160a01b0384166000908152600a602052604081205461108a9083906121e5565b90506110e26110c3856110bd847f0000000000000000000000000000000000000000000000000000000000000000612404565b9061245d565b6001600160a01b0387166000908152600d6020526040902054906123aa565b6001600160a01b0386166000908152600d6020908152604080832093909355600a905220919091555050505b50565b6001600160a01b031660009081526001602052604090205490565b611134611d16565b6001600160a01b0316611145611214565b6001600160a01b0316146111a0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600881815481106111fa57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031690565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561080f5780601f106107e45761010080835404028352916020019161080f565b6001600160a01b03811660009081526009602052604081205460ff166112db5760405162461bcd60e51b8152600401808060200182810382526024815260200180612cd56024913960400191505060405180910390fd5b6001600160a01b038084166000908152600e60209081526040808320600754948716808552600d84528285205483516370a0823160e01b815230600482015293519296959094909391926370a08231926024808201939291829003018186803b15801561134757600080fd5b505afa15801561135b573d6000803e3d6000fd5b505050506040513d602081101561137157600080fd5b50516006549091506000906001600160a01b03888116610100909204161461139957816113a3565b6113a382856121e5565b6001600160a01b0388166000908152600a602052604090205490915081148015906113cd57508315155b15611434576001600160a01b0387166000908152600a60205260408120546113f69083906121e5565b9050611430611429866110bd847f0000000000000000000000000000000000000000000000000000000000000000612404565b85906123aa565b9350505b6001600160a01b03871660009081526020869052604090205461148e906114887f00000000000000000000000000000000000000000000000000000000000000006110bd876114828e611111565b90612404565b906121e5565b98975050505050505050565b6114a2611d16565b6001600160a01b03166114b3611214565b6001600160a01b03161461150e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517fe5693914d19c789bdee50a362998c0bc8d035a835f9871da5d51152f0582c34f916020908290030190a150565b600061082d611575611d16565b84610cd385604051806060016040528060258152602001612cf9602591396002600061159f611d16565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061214e565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000611607611601611d16565b83611f91565b6116118383611fd8565b61082d61161c611d16565b8484611ff1565b61164061162e611d16565b6001600160a01b0384169030846124c4565b600654604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561169057600080fd5b505afa1580156116a4573d6000803e3d6000fd5b505050506040513d60208110156116ba57600080fd5b5051604080516367dfd4c960e01b81526004810185905290519192506001600160a01b038516916367dfd4c99160248082019260009290919082900301818387803b15801561170857600080fd5b505af115801561171c573d6000803e3d6000fd5b5050600654604080516370a0823160e01b81523060048201529051600094506117a89350859261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561177657600080fd5b505afa15801561178a573d6000803e3d6000fd5b505050506040513d60208110156117a057600080fd5b5051906121e5565b905060006117e57f00000000000000000000000000000000000000000000000000000000000000006110bd600c548561240490919063ffffffff16565b905060006117f383836121e5565b9050611806611800611d16565b82611fd8565b60075461181390826123aa565b600755600c541561184257600b54600654611842916001600160a01b03610100909204821691309116856124c4565b61185361184d611d16565b82612533565b7ff2ea3ee6d4d03a11390cbbcd09097d9fe2d7efb1b2825c2b509415d2fb95a7ba61187c611d16565b604080516001600160a01b039283168152918916602083015281810186905260608201889052519081900360800190a1505050505050565b60096020526000908152604090205460ff1681565b60006119047f00000000000000000000000000000000000000000000000000000000000000006110bd600c548561240490919063ffffffff16565b9050600061191283836121e5565b905061191f611800611d16565b60075461192c90826123aa565b600755600c541561196157611961611942611d16565b600b5460065461010090046001600160a01b03908116929116856124c4565b61198561196c611d16565b60065461010090046001600160a01b03169030846124c4565b61199061184d611d16565b611998611d16565b6001600160a01b03167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158284604051808381526020018281526020019250505060405180910390a2505050565b60085490565b600b546001600160a01b031681565b600c5481565b60065461010090046001600160a01b031681565b6000600e6000611a22611d16565b6001600160a01b03166001600160a01b0316815260200190815260200160002090506000611a56611a51611d16565b611111565b60085490915060005b81811015611aa057600060088281548110611a7657fe5b60009182526020808320909101546001600160a01b03168252869052604081205550600101611a5f565b50600754611aae90836121e5565b600755611ad4611abc611d16565b60065461010090046001600160a01b03169084612242565b611ae5611adf611d16565b836122ae565b611aed611d16565b6001600160a01b03167f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695836040518082815260200191505060405180910390a2505050565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60075481565b6001600160a01b038116600090815260096020526040812054819060ff16611bbc5760405162461bcd60e51b8152600401808060200182810382526034815260200180612c776034913960400191505060405180910390fd5b6001600160a01b0384166000908152600e60205260409020611bdd85611111565b6001600160a01b03949094166000908152602091909152604090205492949293505050565b611c0a611d16565b6001600160a01b0316611c1b611214565b6001600160a01b031614611c76576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116611cbb5760405162461bcd60e51b8152600401808060200182810382526026815260200180612a536026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6001600160a01b038316611d5f5760405162461bcd60e51b8152600401808060200182810382526024815260200180612bd56024913960400191505060405180910390fd5b6001600160a01b038216611da45760405162461bcd60e51b8152600401808060200182810382526022815260200180612a796022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166000908152600e6020526040812060085490915b81811015611f8957600060088281548110611e3b57fe5b6000918252602090912001546001600160a01b03169050611e5b81610f32565b6001600160a01b03811660009081526020858152604080832054600d90925290912054611eaf907f0000000000000000000000000000000000000000000000000000000000000000906110bd908990612404565b6001600160a01b0383166000908152602087905260409020558615611f7f576001600160a01b0382166000908152600d6020526040812054611f1e908390611488907f0000000000000000000000000000000000000000000000000000000000000000906110bd908d90612404565b90508015611f7d57611f31838a83612625565b826001600160a01b0316896001600160a01b03167f7e77f685b38c861064cb08f2776eb5dfd3c82f652ed9f21221b8c53b75628e51836040518082815260200191505060405180910390a35b505b5050600101611e24565b505050505050565b6000611f9c83611111565b90506000611fc583604051806060016040528060318152602001612c1f6031913984919061214e565b9050611fd2848383611e06565b50505050565b6000611fe383611111565b90506000611fc582846123aa565b6001600160a01b0383166120365760405162461bcd60e51b8152600401808060200182810382526025815260200180612bb06025913960400191505060405180910390fd5b6001600160a01b03821661207b5760405162461bcd60e51b8152600401808060200182810382526023815260200180612a0e6023913960400191505060405180910390fd5b6120868383836122a9565b6120c381604051806060016040528060268152602001612ac3602691396001600160a01b038616600090815260016020526040902054919061214e565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546120f290826123aa565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156121dd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121a257818101518382015260200161218a565b50505050905090810190601f1680156121cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282111561223c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b1790526122a990849061277e565b505050565b6001600160a01b0382166122f35760405162461bcd60e51b8152600401808060200182810382526021815260200180612b8f6021913960400191505060405180910390fd5b6122ff826000836122a9565b61233c81604051806060016040528060228152602001612a31602291396001600160a01b038516600090815260016020526040902054919061214e565b6001600160a01b03831660009081526001602052604090205560035461236290826121e5565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082820183811015610bd5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008261241357506000610831565b8282028284828161242057fe5b0414610bd55760405162461bcd60e51b8152600401808060200182810382526021815260200180612b466021913960400191505060405180910390fd5b60008082116124b3576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816124bc57fe5b049392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b179052611fd290859061277e565b6001600160a01b03821661258e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61259a600083836122a9565b6003546125a790826123aa565b6003556001600160a01b0382166000908152600160205260409020546125cd90826123aa565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561267457600080fd5b505afa158015612688573d6000803e3d6000fd5b505050506040513d602081101561269e57600080fd5b50516006549091506000906001600160a01b0386811661010090920416146126c657816126d4565b6007546126d49083906121e5565b90508083111561272d576001600160a01b0385166000908152600a602052604090205461270190826121e5565b6001600160a01b0386166000818152600a6020526040902091909155612728908583612242565b612777565b6001600160a01b0385166000908152600a602052604090205461275090846121e5565b6001600160a01b0386166000818152600a6020526040902091909155612777908585612242565b5050505050565b60006127d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661282f9092919063ffffffff16565b8051909150156122a9578080602001905160208110156127f257600080fd5b50516122a95760405162461bcd60e51b815260040180806020018281038252602a815260200180612cab602a913960400191505060405180910390fd5b606061283e8484600085612846565b949350505050565b6060824710156128875760405162461bcd60e51b8152600401808060200182810382526026815260200180612ae96026913960400191505060405180910390fd5b612890856129a1565b6128e1576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061291f5780518252601f199092019160209182019101612900565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612981576040519150601f19603f3d011682016040523d82523d6000602084013e612986565b606091505b50915091506129968282866129a7565b979650505050505050565b3b151590565b606083156129b6575081610bd5565b8251156129c65782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156121a257818101518382015260200161218a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373537461626c655452495374616b696e673a20746f6b656e2063616e27742062652072656d6f76656445524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c537461626c655452495374616b696e673a206465706f736974206665652063616e27742062652067726561746572207468616e20353025536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373537461626c655452495374616b696e673a20746f6b656e2063616e2774206265206164646564537461626c655452495374616b696e673a20776974686472617720616d6f756e7420657863656564732062616c616e6365537461626c655452495374616b696e673a206c697374206f6620746f6b656e20746f6f20626967537461626c655452495374616b696e673a2072657761726420746f6b656e206973206e6f7420612072657761726420746f6b656e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564537461626c655452495374616b696e673a2077726f6e672072657761726420746f6b656e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a537461626c655452495374616b696e673a2066656520636f6c6c6563746f722063616e27742062652061646472657373283029537461626c655452495374616b696e673a207472692063616e27742062652061646472657373283029537461626c655452495374616b696e673a2072657761726420746f6b656e2063616e27742062652061646472657373283029537461626c655452495374616b696e673a206d6178206465706f736974206665652063616e27742062652067726561746572207468616e2035302500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000087bcc091d0a7f9352728100268ac8d25729113bb000000000000000000000000fa94348467f64d5a457f75f8bc40495d33c65abb000000000000000000000000620b5a0998e19b47681a02055bfcd0b856abc37500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004705452490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047054524900000000000000000000000000000000000000000000000000000000

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

00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000087bcc091d0a7f9352728100268ac8d25729113bb000000000000000000000000fa94348467f64d5a457f75f8bc40495d33c65abb000000000000000000000000620b5a0998e19b47681a02055bfcd0b856abc37500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004705452490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047054524900000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): pTRI
Arg [1] : symbol_ (string): pTRI
Arg [2] : _rewardToken (address): 0x87bcc091d0a7f9352728100268ac8d25729113bb
Arg [3] : _tri (address): 0xfa94348467f64d5a457f75f8bc40495d33c65abb
Arg [4] : _feeCollector (address): 0x620b5a0998e19b47681a02055bfcd0b856abc375
Arg [5] : _depositFeePercent (uint256): 0

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 00000000000000000000000087bcc091d0a7f9352728100268ac8d25729113bb
Arg [3] : 000000000000000000000000fa94348467f64d5a457f75f8bc40495d33c65abb
Arg [4] : 000000000000000000000000620b5a0998e19b47681a02055bfcd0b856abc375
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 7054524900000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 7054524900000000000000000000000000000000000000000000000000000000


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.