Contract 0x7680c89eb3e58dec4d38093b4803be2b7f257360

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x26b120cf8c9f2390ba3609ab3ec927404274674a5883983f10f2a3653186d7fa_become34918352020-12-28 11:22:01262 days 16 hrs agoVenus: Deployer IN  0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB0.00084674
0x7ed19a92bbe1cf78b0b90534f6c762f3a8c4ddb005b6442d08b413c8e7b9510d0x6080604034917962020-12-28 11:20:04262 days 16 hrs agoVenus: Deployer IN  Contract Creation0 BNB0.0244095
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf1d2c6c1edc6e08a182a7b5b8731af4fa0a7f6ad1580fa785bbe9a6348203c0354713332021-03-07 11:59:36193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xa00de57a4eec5c26e42a0357947b8d78407913f14bc6fd399c2d23e5244da57d54713312021-03-07 11:59:30193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x7eb188a5cffbaa50feed59c44f22015f4ad8e4c06d5894e37d154746ab580a0954713172021-03-07 11:58:48193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xd589d750936bf9e0a6af1b81f8fc4bf8b65789506f5946d1bb1bef241c461a5854713172021-03-07 11:58:48193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x09e796fe11529b64aec7351949a0b3db3ff0718ec3c6dd1735f7ab56f713071554713092021-03-07 11:58:24193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x2603e9e6e6a723c8ce9cdd28bbd9ce5d796576200fc47d9b3809a94569bce92954712462021-03-07 11:55:15193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x1bbd70532d47cf9ef18ce11b26078d236cf885c3a6ae2db1a5f1345874ce37e454712242021-03-07 11:54:09193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x9c46d60866622c31c104545b4e2feb084aa867a21c8d824328115a65eba77a2354712192021-03-07 11:53:54193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x719015fa174575408617b5bbb348a2612435c3b7d0f8238514018316d5cee86e54712162021-03-07 11:53:45193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x6946b84cbefce8c24095c000ac2de72181bb1fe480f1f076fe3f6be76dc462f354712112021-03-07 11:53:30193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x5da22705215f0d1494021fb5c3e66f66713ebbe13256b54000092171edc5097354711652021-03-07 11:51:12193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x05bacd33dfe7c6734a5db7d1cc47252b2cef6d2f81f5621c661a94fc1847965d54711642021-03-07 11:51:09193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xca2a6247d2fdecdb19abb8ee457d370114da6bce5febf3fb6acc1d7f200c802e54711562021-03-07 11:50:45193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x535acfe092831cad20909c6e2cac109eb819f261f1aa0070769b3fe6a5bf83b554711242021-03-07 11:49:09193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x738ced4c0b3448d3a805b6fb90a701c92ba0dc44a439c20f68b86c55746273c054711222021-03-07 11:49:03193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xe1762b40027f65ff6c20ae7ed5ea4d2429f25cdd16b45987f454d0694ac021be54711102021-03-07 11:48:27193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x7e57af6006b3dd7b7b20f247497c90c066ae19101f1aebdcc7853082e467a27754711052021-03-07 11:48:12193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xd677aee91f48e6c6d79eff8715da364500ce661ae38e53bedc88bca71085d37154710922021-03-07 11:47:33193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xf449b3a7094525033a19c613a66beb0fe58e960afe84d85f558ce8ac5c319ad554710922021-03-07 11:47:33193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xfcbc85cf9fe564dda1e92760288a4da5322133139eefea6b67c06e02da02289954710772021-03-07 11:46:48193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xb325951da04245af1ee98367fde96762fca300d326c124fa053b796dea7f6d6d54710502021-03-07 11:45:27193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x9452c335bc9248f2cb4e82a7ab01cbf9ac15a705738ef85a9d8081d118516a6054710292021-03-07 11:44:24193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x1060264bc807448499896a830051fc2e0001ce2cc8aff7b11e70bebbab34386a54710292021-03-07 11:44:24193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0x5f1937ce0069b25c4819720ee5fcd2d59a664fc2f65dcf076be155252ce1977a54710232021-03-07 11:44:06193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
0xe65ae95098affdc7d659b0cf890ae8a743a751d6a1beb432ac59ae0dd943d1fe54710142021-03-07 11:43:39193 days 16 hrs ago 0x0667eed0a0aab930af74a3dfedd263a73994f216 0x7680c89eb3e58dec4d38093b4803be2b7f2573600 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VAIVault

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity Multiple files format)

File 1 of 8: VAIVault.sol
pragma solidity ^0.5.16;
import "./SafeBEP20.sol";
import "./IBEP20.sol";
import "./VAIVaultProxy.sol";
import "./VAIVaultStorage.sol";
import "./VAIVaultErrorReporter.sol";

contract VAIVault is VAIVaultStorage {
    using SafeMath for uint256;
    using SafeBEP20 for IBEP20;

    /// @notice Event emitted when VAI deposit
    event Deposit(address indexed user, uint256 amount);

    /// @notice Event emitted when VAI withrawal
    event Withdraw(address indexed user, uint256 amount);

    /// @notice Event emitted when admin changed
    event AdminTransfered(address indexed oldAdmin, address indexed newAdmin);

    constructor() public {
        admin = msg.sender;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin, "only admin can");
        _;
    }

    /*** Reentrancy Guard ***/

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     */
    modifier nonReentrant() {
        require(_notEntered, "re-entered");
        _notEntered = false;
        _;
        _notEntered = true; // get a gas-refund post-Istanbul
    }

    /**
     * @notice Deposit VAI to VAIVault for XVS allocation
     * @param _amount The amount to deposit to vault
     */
    function deposit(uint256 _amount) public nonReentrant {
        UserInfo storage user = userInfo[msg.sender];

        updateVault();

        // Transfer pending tokens to user
        updateAndPayOutPending(msg.sender);

        // Transfer in the amounts from user
        if(_amount > 0) {
            vai.safeTransferFrom(address(msg.sender), address(this), _amount);
            user.amount = user.amount.add(_amount);
        }

        user.rewardDebt = user.amount.mul(accXVSPerShare).div(1e18);
        emit Deposit(msg.sender, _amount);
    }

    /**
     * @notice Withdraw VAI from VAIVault
     * @param _amount The amount to withdraw from vault
     */
    function withdraw(uint256 _amount) public nonReentrant {
        _withdraw(msg.sender, _amount);
    }

    /**
     * @notice Claim XVS from VAIVault
     */
    function claim() public nonReentrant {
        _withdraw(msg.sender, 0);
    }

    /**
     * @notice Low level withdraw function
     * @param account The account to withdraw from vault
     * @param _amount The amount to withdraw from vault
     */
    function _withdraw(address account, uint256 _amount) internal {
        UserInfo storage user = userInfo[account];
        require(user.amount >= _amount, "withdraw: not good");

        updateVault();
        updateAndPayOutPending(account); // Update balances of account this is not withdrawal but claiming XVS farmed

        if(_amount > 0) {
            user.amount = user.amount.sub(_amount);
            vai.safeTransfer(address(account), _amount);
        }
        user.rewardDebt = user.amount.mul(accXVSPerShare).div(1e18);

        emit Withdraw(account, _amount);
    }

    /**
     * @notice View function to see pending XVS on frontend
     * @param _user The user to see pending XVS
     */
    function pendingXVS(address _user) public view returns (uint256)
    {
        UserInfo storage user = userInfo[_user];

        return user.amount.mul(accXVSPerShare).div(1e18).sub(user.rewardDebt);
    }

    /**
     * @notice Update and pay out pending XVS to user
     * @param account The user to pay out
     */
    function updateAndPayOutPending(address account) internal {
        uint256 pending = pendingXVS(account);

        if(pending > 0) {
            safeXVSTransfer(account, pending);
        }
    }

    /**
     * @notice Safe XVS transfer function, just in case if rounding error causes pool to not have enough XVS
     * @param _to The address that XVS to be transfered
     * @param _amount The amount that XVS to be transfered
     */
    function safeXVSTransfer(address _to, uint256 _amount) internal {
        uint256 xvsBal = xvs.balanceOf(address(this));

        if (_amount > xvsBal) {
            xvs.transfer(_to, xvsBal);
            xvsBalance = xvs.balanceOf(address(this));
        } else {
            xvs.transfer(_to, _amount);
            xvsBalance = xvs.balanceOf(address(this));
        }
    }

    /**
     * @notice Function that updates pending rewards
     */
    function updatePendingRewards() public {
        uint256 newRewards = xvs.balanceOf(address(this)).sub(xvsBalance);

        if(newRewards > 0) {
            xvsBalance = xvs.balanceOf(address(this)); // If there is no change the balance didn't change
            pendingRewards = pendingRewards.add(newRewards);
        }
    }

    /**
     * @notice Update reward variables to be up-to-date
     */
    function updateVault() internal {
        uint256 vaiBalance = vai.balanceOf(address(this));
        if (vaiBalance == 0) { // avoids division by 0 errors
            return;
        }

        accXVSPerShare = accXVSPerShare.add(pendingRewards.mul(1e18).div(vaiBalance));
        pendingRewards = 0;
    }

    /**
     * @dev Returns the address of the current admin
     */
    function getAdmin() public view returns (address) {
        return admin;
    }

    /**
     * @dev Burn the current admin
     */
    function burnAdmin() public onlyAdmin {
        emit AdminTransfered(admin, address(0));
        admin = address(0);
    }

    /**
     * @dev Set the current admin to new address
     */
    function setNewAdmin(address newAdmin) public onlyAdmin {
        require(newAdmin != address(0), "new owner is the zero address");
        emit AdminTransfered(admin, newAdmin);
        admin = newAdmin;
    }

    /*** Admin Functions ***/

    function _become(VAIVaultProxy vaiVaultProxy) public {
        require(msg.sender == vaiVaultProxy.admin(), "only proxy admin can change brains");
        require(vaiVaultProxy._acceptImplementation() == 0, "change not authorized");
    }

    function setVenusInfo(address _xvs, address _vai) public onlyAdmin {
        xvs = IBEP20(_xvs);
        vai = IBEP20(_vai);

        _notEntered = true;
    }
}

File 2 of 8: Address.sol
pragma solidity ^0.5.5;

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

File 3 of 8: IBEP20.sol
pragma solidity ^0.5.0;

/**
 * @dev Interface of the BEP20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {BEP20Detailed}.
 */
interface IBEP20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

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

File 4 of 8: SafeBEP20.sol
pragma solidity ^0.5.0;

import "./IBEP20.sol";
import "./SafeMath.sol";
import "./Address.sol";

/**
 * @title SafeBEP20
 * @dev Wrappers around BEP20 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 SafeBEP20 for BEP20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeBEP20 {
    using SafeMath for uint256;
    using Address for address;

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

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

    function safeApprove(IBEP20 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),
            "SafeBEP20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IBEP20 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(IBEP20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeBEP20: 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(IBEP20 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.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeBEP20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeBEP20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeBEP20: BEP20 operation did not succeed");
        }
    }
}

File 5 of 8: SafeMath.sol
pragma solidity ^0.5.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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 6 of 8: VAIVaultErrorReporter.sol
pragma solidity ^0.5.16;

contract VAIVaultErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED
    }

    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_PENDING_IMPLEMENTATION_OWNER_CHECK
    }

    /**
      * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
      * contract-specific code that enables us to report opaque error codes from upgradeable contracts.
      **/
    event Failure(uint error, uint info, uint detail);

    /**
      * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
      */
    function fail(Error err, FailureInfo info) internal returns (uint) {
        emit Failure(uint(err), uint(info), 0);

        return uint(err);
    }

    /**
      * @dev use this when reporting an opaque error from an upgradeable collaborator contract
      */
    function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
        emit Failure(uint(err), uint(info), opaqueError);

        return uint(err);
    }
}

File 7 of 8: VAIVaultProxy.sol
pragma solidity ^0.5.16;

import "./VAIVaultStorage.sol";
import "./VAIVaultErrorReporter.sol";

contract VAIVaultProxy is VAIVaultAdminStorage, VAIVaultErrorReporter {

    /**
      * @notice Emitted when pendingVAIVaultImplementation is changed
      */
    event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);

    /**
      * @notice Emitted when pendingVAIVaultImplementation is accepted, which means VAI Vault implementation is updated
      */
    event NewImplementation(address oldImplementation, address newImplementation);

    /**
      * @notice Emitted when pendingAdmin is changed
      */
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /**
      * @notice Emitted when pendingAdmin is accepted, which means admin is updated
      */
    event NewAdmin(address oldAdmin, address newAdmin);

    constructor() public {
        // Set admin to caller
        admin = msg.sender;
    }

    /*** Admin Functions ***/
    function _setPendingImplementation(address newPendingImplementation) public returns (uint) {

        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK);
        }

        address oldPendingImplementation = pendingVAIVaultImplementation;

        pendingVAIVaultImplementation = newPendingImplementation;

        emit NewPendingImplementation(oldPendingImplementation, pendingVAIVaultImplementation);

        return uint(Error.NO_ERROR);
    }

    /**
    * @notice Accepts new implementation of VAI Vault. msg.sender must be pendingImplementation
    * @dev Admin function for new implementation to accept it's role as implementation
    * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
    */
    function _acceptImplementation() public returns (uint) {
        // Check caller is pendingImplementation
        if (msg.sender != pendingVAIVaultImplementation) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK);
        }

        // Save current values for inclusion in log
        address oldImplementation = vaiVaultImplementation;
        address oldPendingImplementation = pendingVAIVaultImplementation;

        vaiVaultImplementation = pendingVAIVaultImplementation;

        pendingVAIVaultImplementation = address(0);

        emit NewImplementation(oldImplementation, vaiVaultImplementation);
        emit NewPendingImplementation(oldPendingImplementation, pendingVAIVaultImplementation);

        return uint(Error.NO_ERROR);
    }


    /**
      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @param newPendingAdmin New pending admin.
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setPendingAdmin(address newPendingAdmin) public returns (uint) {
        // Check caller = admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);
        }

        // Save current value, if any, for inclusion in log
        address oldPendingAdmin = pendingAdmin;

        // Store pendingAdmin with value newPendingAdmin
        pendingAdmin = newPendingAdmin;

        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
      * @dev Admin function for pending admin to accept role and update admin
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _acceptAdmin() public returns (uint) {
        // Check caller is pendingAdmin
        if (msg.sender != pendingAdmin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);
        }

        // Save current values for inclusion in log
        address oldAdmin = admin;
        address oldPendingAdmin = pendingAdmin;

        // Store admin with value pendingAdmin
        admin = pendingAdmin;

        // Clear the pending value
        pendingAdmin = address(0);

        emit NewAdmin(oldAdmin, admin);
        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
     * @dev Delegates execution to an implementation contract.
     * It returns to the external caller whatever the implementation returns
     * or forwards reverts.
     */
    function () external payable {
        // delegate all other functions to current implementation
        (bool success, ) = vaiVaultImplementation.delegatecall(msg.data);

        assembly {
              let free_mem_ptr := mload(0x40)
              returndatacopy(free_mem_ptr, 0, returndatasize)

              switch success
              case 0 { revert(free_mem_ptr, returndatasize) }
              default { return(free_mem_ptr, returndatasize) }
        }
    }
}

File 8 of 8: VAIVaultStorage.sol
pragma solidity ^0.5.16;
import "./SafeMath.sol";
import "./IBEP20.sol";

contract VAIVaultAdminStorage {
    /**
    * @notice Administrator for this contract
    */
    address public admin;

    /**
    * @notice Pending administrator for this contract
    */
    address public pendingAdmin;

    /**
    * @notice Active brains of VAI Vault
    */
    address public vaiVaultImplementation;

    /**
    * @notice Pending brains of VAI Vault
    */
    address public pendingVAIVaultImplementation;
}

contract VAIVaultStorage is VAIVaultAdminStorage {
    /// @notice The XVS TOKEN!
    IBEP20 public xvs;

    /// @notice The VAI TOKEN!
    IBEP20 public vai;

    /// @notice Guard variable for re-entrancy checks
    bool internal _notEntered;

    /// @notice XVS balance of vault
    uint256 public xvsBalance;

    /// @notice Accumulated XVS per share
    uint256 public accXVSPerShare;

    //// pending rewards awaiting anyone to update
    uint256 public pendingRewards;

    /// @notice Info of each user.
    struct UserInfo {
        uint256 amount;
        uint256 rewardDebt;
    }

    // Info of each user that stakes tokens.
    mapping(address => UserInfo) public userInfo;
}

Contract Security Audit

Contract ABI

[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransfered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"constant":false,"inputs":[{"internalType":"contract VAIVaultProxy","name":"vaiVaultProxy","type":"address"}],"name":"_become","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"accXVSPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"burnAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingVAIVaultImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingXVS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setNewAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_xvs","type":"address"},{"internalType":"address","name":"_vai","type":"address"}],"name":"setVenusInfo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"updatePendingRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vai","outputs":[{"internalType":"contract IBEP20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vaiVaultImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"xvs","outputs":[{"internalType":"contract IBEP20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"xvsBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b031916331790556114bb806100326000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c806379c3b944116100ad578063b6b55f2511610071578063b6b55f25146102a5578063eded3fda146102c2578063f661bb86146102ca578063f851a440146102d2578063faa1809e146102da5761012c565b806379c3b9441461024157806381bdf98c146102675780638eec99c81461026f57806391cc3da114610295578063b62e4c921461029d5761012c565b806344c0e8ee116100f457806344c0e8ee146101e15780634e71d92d1461020f5780634e79ed3c146102175780636e9960c31461021f578063761692ba146102275761012c565b80631959a002146101315780631d504dc614610170578063211de6b61461019857806326782247146101bc5780632e1a7d4d146101c4575b600080fd5b6101576004803603602081101561014757600080fd5b50356001600160a01b03166102e2565b6040805192835260208301919091528051918290030190f35b6101966004803603602081101561018657600080fd5b50356001600160a01b03166102fb565b005b6101a061045a565b604080516001600160a01b039092168252519081900360200190f35b6101a0610469565b610196600480360360208110156101da57600080fd5b5035610478565b610196600480360360408110156101f757600080fd5b506001600160a01b03813581169160200135166104f0565b61019661057e565b6101a06105f6565b6101a0610605565b61022f610614565b60408051918252519081900360200190f35b61022f6004803603602081101561025757600080fd5b50356001600160a01b031661061a565b61019661067e565b6101966004803603602081101561028557600080fd5b50356001600160a01b0316610718565b61022f61081e565b6101a0610824565b610196600480360360208110156102bb57600080fd5b5035610833565b61022f610958565b6101a061095e565b6101a061096d565b61019661097c565b6009602052600090815260409020805460019091015482565b806001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b15801561033457600080fd5b505afa158015610348573d6000803e3d6000fd5b505050506040513d602081101561035e57600080fd5b50516001600160a01b031633146103a65760405162461bcd60e51b81526004018080602001828103825260228152602001806114656022913960400191505060405180910390fd5b806001600160a01b031663c1e803346040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b505050506040513d602081101561040b57600080fd5b505115610457576040805162461bcd60e51b815260206004820152601560248201527418da185b99d9481b9bdd08185d5d1a1bdc9a5e9959605a1b604482015290519081900360640190fd5b50565b6003546001600160a01b031681565b6001546001600160a01b031681565b600554600160a01b900460ff166104c3576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6005805460ff60a01b191690556104da3382610aa7565b506005805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610540576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b600480546001600160a01b03199081166001600160a01b039485161790915560058054600160a01b9216929093169190911760ff60a01b1916179055565b600554600160a01b900460ff166105c9576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6005805460ff60a01b191690556105e1336000610aa7565b6005805460ff60a01b1916600160a01b179055565b6004546001600160a01b031681565b6000546001600160a01b031690565b60065481565b6001600160a01b038116600090815260096020526040812060018101546007548254610677929161066b91670de0b6b3a76400009161065f919063ffffffff610bbd16565b9063ffffffff610c1f16565b9063ffffffff610c6116565b9392505050565b6000546001600160a01b031633146106ce576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f173de3514d8508f36ce8c81d509adcd8c8c76098400f685d3042b36f9a4160c3908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610768576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b6001600160a01b0381166107c3576040805162461bcd60e51b815260206004820152601d60248201527f6e6577206f776e657220697320746865207a65726f2061646472657373000000604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f173de3514d8508f36ce8c81d509adcd8c8c76098400f685d3042b36f9a4160c391a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60075481565b6005546001600160a01b031681565b600554600160a01b900460ff1661087e576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6005805460ff60a01b191690553360009081526009602052604090206108a2610ca3565b6108ab33610d66565b81156108e4576005546108cf906001600160a01b031633308563ffffffff610d8716565b80546108e1908363ffffffff610de716565b81555b600754815461090691670de0b6b3a76400009161065f9163ffffffff610bbd16565b600182015560408051838152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250506005805460ff60a01b1916600160a01b179055565b60085481565b6002546001600160a01b031681565b6000546001600160a01b031681565b60065460048054604080516370a0823160e01b8152309381019390935251600093610a0b9390926001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156109d357600080fd5b505afa1580156109e7573d6000803e3d6000fd5b505050506040513d60208110156109fd57600080fd5b50519063ffffffff610c6116565b905080156104575760048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015610a5f57600080fd5b505afa158015610a73573d6000803e3d6000fd5b505050506040513d6020811015610a8957600080fd5b5051600655600854610aa1908263ffffffff610de716565b60085550565b6001600160a01b03821660009081526009602052604090208054821115610b0a576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b610b12610ca3565b610b1b83610d66565b8115610b52578054610b33908363ffffffff610c6116565b8155600554610b52906001600160a01b0316848463ffffffff610e4116565b6007548154610b7491670de0b6b3a76400009161065f9163ffffffff610bbd16565b60018201556040805183815290516001600160a01b038516917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2505050565b600082610bcc57506000610c19565b82820282848281610bd957fe5b0414610c165760405162461bcd60e51b81526004018080602001828103825260218152602001806114446021913960400191505060405180910390fd5b90505b92915050565b6000610c1683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e98565b6000610c1683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f3a565b600554604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610cee57600080fd5b505afa158015610d02573d6000803e3d6000fd5b505050506040513d6020811015610d1857600080fd5b5051905080610d275750610d64565b610d5a610d4b8261065f670de0b6b3a7640000600854610bbd90919063ffffffff16565b6007549063ffffffff610de716565b6007555060006008555b565b6000610d718261061a565b90508015610d8357610d838282610f94565b5050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610de1908590611225565b50505050565b600082820183811015610c16576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e93908490611225565b505050565b60008183610f245760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ee9578181015183820152602001610ed1565b50505050905090810190601f168015610f165780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3057fe5b0495945050505050565b60008184841115610f8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ee9578181015183820152602001610ed1565b505050900390565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015610fe357600080fd5b505afa158015610ff7573d6000803e3d6000fd5b505050506040513d602081101561100d57600080fd5b505190508082111561111f57600480546040805163a9059cbb60e01b81526001600160a01b0387811694820194909452602481018590529051929091169163a9059cbb916044808201926020929091908290030181600087803b15801561107357600080fd5b505af1158015611087573d6000803e3d6000fd5b505050506040513d602081101561109d57600080fd5b505060048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b1580156110eb57600080fd5b505afa1580156110ff573d6000803e3d6000fd5b505050506040513d602081101561111557600080fd5b5051600655610e93565b600480546040805163a9059cbb60e01b81526001600160a01b0387811694820194909452602481018690529051929091169163a9059cbb916044808201926020929091908290030181600087803b15801561117957600080fd5b505af115801561118d573d6000803e3d6000fd5b505050506040513d60208110156111a357600080fd5b505060048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b1580156111f157600080fd5b505afa158015611205573d6000803e3d6000fd5b505050506040513d602081101561121b57600080fd5b5051600655505050565b611237826001600160a01b03166113dd565b611288576040805162461bcd60e51b815260206004820152601f60248201527f5361666542455032303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106112c65780518252601f1990920191602091820191016112a7565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611328576040519150601f19603f3d011682016040523d82523d6000602084013e61132d565b606091505b509150915081611384576040805162461bcd60e51b815260206004820181905260248201527f5361666542455032303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610de1578080602001905160208110156113a057600080fd5b5051610de15760405162461bcd60e51b815260040180806020018281038252602a81526020018061141a602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061141157508115155b94935050505056fe5361666542455032303a204245503230206f7065726174696f6e20646964206e6f742073756363656564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776f6e6c792070726f78792061646d696e2063616e206368616e676520627261696e73a265627a7a7231582009067abaf0ce6af6695e6bf2817e58db068980a69600453ac96a1c27f3663c4264736f6c63430005110032

Deployed ByteCode Sourcemap

175:5835:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;175:5835:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1153:44:7;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1153:44:7;-1:-1:-1;;;;;1153:44:7;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;5605:238:4;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5605:238:4;-1:-1:-1;;;;;5605:238:4;;:::i;:::-;;458:44:7;;;:::i;:::-;;;;-1:-1:-1;;;;;458:44:7;;;;;;;;;;;;;;267:27;;;:::i;1896:102:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1896:102:4;;:::i;5849:159::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;5849:159:4;;;;;;;;;;:::i;2059:78::-;;;:::i;593:17:7:-;;;:::i;5029:79:4:-;;;:::i;795:25:7:-;;;:::i;:::-;;;;;;;;;;;;;;;;3027:205:4;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3027:205:4;-1:-1:-1;;;;;3027:205:4;;:::i;5165:122::-;;;:::i;5358:210::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5358:210:4;-1:-1:-1;;;;;5358:210:4;;:::i;869:29:7:-;;;:::i;648:17::-;;;:::i;1223:553:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1223:553:4;;:::i;956:29:7:-;;;:::i;357:37::-;;;:::i;171:20::-;;;:::i;4242:328:4:-;;;:::i;1153:44:7:-;;;;;;;;;;;;;;;;;;;:::o;5605:238:4:-;5690:13;-1:-1:-1;;;;;5690:19:4;;:21;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5690:21:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5690:21:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5690:21:4;-1:-1:-1;;;;;5676:35:4;:10;:35;5668:82;;;;-1:-1:-1;;;5668:82:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5768:13;-1:-1:-1;;;;;5768:35:4;;:37;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5768:37:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5768:37:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5768:37:4;:42;5760:76;;;;;-1:-1:-1;;;5760:76:4;;;;;;;;;;;;-1:-1:-1;;;5760:76:4;;;;;;;;;;;;;;;5605:238;:::o;458:44:7:-;;;-1:-1:-1;;;;;458:44:7;;:::o;267:27::-;;;-1:-1:-1;;;;;267:27:7;;:::o;1896:102:4:-;955:11;;-1:-1:-1;;;955:11:4;;;;947:34;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;;;;991:11;:19;;-1:-1:-1;;;;991:19:4;;;1961:30;1971:10;1983:7;1961:9;:30::i;:::-;-1:-1:-1;1031:11:4;:18;;-1:-1:-1;;;;1031:18:4;-1:-1:-1;;;1031:18:4;;;1896:102::o;5849:159::-;740:5;;-1:-1:-1;;;;;740:5:4;726:10;:19;718:46;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;;;;5926:3;:18;;-1:-1:-1;;;;;;5926:18:4;;;-1:-1:-1;;;;;5926:18:4;;;;;;;5954:3;:18;;-1:-1:-1;;;5954:18:4;;;;;;;;;;-1:-1:-1;;;;5983:18:4;;;;5849:159::o;2059:78::-;955:11;;-1:-1:-1;;;955:11:4;;;;947:34;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;;;;991:11;:19;;-1:-1:-1;;;;991:19:4;;;2106:24;2116:10;1005:5;2106:9;:24::i;:::-;1031:11;:18;;-1:-1:-1;;;;1031:18:4;-1:-1:-1;;;1031:18:4;;;2059:78::o;593:17:7:-;;;-1:-1:-1;;;;;593:17:7;;:::o;5029:79:4:-;5070:7;5096:5;-1:-1:-1;;;;;5096:5:4;5029:79;:::o;795:25:7:-;;;;:::o;3027:205:4:-;-1:-1:-1;;;;;3130:15:4;;3083:7;3130:15;;;:8;:15;;;;;3209;;;;3179:14;;3163:11;;:62;;3209:15;3163:41;;3199:4;;3163:31;;:11;:31;:15;:31;:::i;:::-;:35;:41;:35;:41;:::i;:::-;:45;:62;:45;:62;:::i;:::-;3156:69;3027:205;-1:-1:-1;;;3027:205:4:o;5165:122::-;740:5;;-1:-1:-1;;;;;740:5:4;726:10;:19;718:46;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;;;;5249:1;5234:5;;5218:34;;-1:-1:-1;;;;;5234:5:4;;;;5218:34;;5249:1;;5218:34;5278:1;5262:18;;-1:-1:-1;;;;;;5262:18:4;;;5165:122::o;5358:210::-;740:5;;-1:-1:-1;;;;;740:5:4;726:10;:19;718:46;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;-1:-1:-1;;;718:46:4;;;;;;;;;;;;;;;-1:-1:-1;;;;;5432:22:4;;5424:64;;;;;-1:-1:-1;;;5424:64:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;5519:5;;;5503:32;;-1:-1:-1;;;;;5503:32:4;;;;5519:5;;;5503:32;;;5545:5;:16;;-1:-1:-1;;;;;;5545:16:4;-1:-1:-1;;;;;5545:16:4;;;;;;;;;;5358:210::o;869:29:7:-;;;;:::o;648:17::-;;;-1:-1:-1;;;;;648:17:7;;:::o;1223:553:4:-;955:11;;-1:-1:-1;;;955:11:4;;;;947:34;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;-1:-1:-1;;;947:34:4;;;;;;;;;;;;;;;991:11;:19;;-1:-1:-1;;;;991:19:4;;;1320:10;1005:5;1311:20;;;:8;:20;;;;;1342:13;:11;:13::i;:::-;1409:34;1432:10;1409:22;:34::i;:::-;1502:11;;1499:158;;1529:3;;:65;;-1:-1:-1;;;;;1529:3:4;1558:10;1579:4;1586:7;1529:65;:20;:65;:::i;:::-;1622:11;;:24;;1638:7;1622:24;:15;:24;:::i;:::-;1608:38;;1499:158;1701:14;;1685:11;;:41;;1721:4;;1685:31;;;:15;:31;:::i;:41::-;1667:15;;;:59;1741:28;;;;;;;;1749:10;;1741:28;;;;;;;;;;-1:-1:-1;;1031:11:4;:18;;-1:-1:-1;;;;1031:18:4;-1:-1:-1;;;1031:18:4;;;1223:553::o;956:29:7:-;;;;:::o;357:37::-;;;-1:-1:-1;;;;;357:37:7;;:::o;171:20::-;;;-1:-1:-1;;;;;171:20:7;;:::o;4242:328:4:-;4345:10;;4312:3;;;:28;;;-1:-1:-1;;;4312:28:4;;4334:4;4312:28;;;;;;;;4291:18;;4312:44;;4345:10;;-1:-1:-1;;;;;4312:3:4;;:13;;:28;;;;;;;;;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;4312:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4312:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4312:28:4;;:44;:32;:44;:::i;:::-;4291:65;-1:-1:-1;4370:14:4;;4367:197;;4413:3;;;:28;;;-1:-1:-1;;;4413:28:4;;4435:4;4413:28;;;;;;;;-1:-1:-1;;;;;4413:3:4;;;;:13;;:28;;;;;;;;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;4413:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4413:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4413:28:4;4400:10;:41;4523:14;;:30;;4542:10;4523:30;:18;:30;:::i;:::-;4506:14;:47;4242:328;:::o;2315:582::-;-1:-1:-1;;;;;2411:17:4;;2387:21;2411:17;;;:8;:17;;;;;2446:11;;:22;-1:-1:-1;2446:22:4;2438:53;;;;;-1:-1:-1;;;2438:53:4;;;;;;;;;;;;-1:-1:-1;;;2438:53:4;;;;;;;;;;;;;;;2502:13;:11;:13::i;:::-;2525:31;2548:7;2525:22;:31::i;:::-;2647:11;;2644:136;;2688:11;;:24;;2704:7;2688:24;:15;:24;:::i;:::-;2674:38;;2726:3;;:43;;-1:-1:-1;;;;;2726:3:4;2751:7;2761;2726:43;:16;:43;:::i;:::-;2823:14;;2807:11;;:41;;2843:4;;2807:31;;;:15;:31;:::i;:41::-;2789:15;;;:59;2864:26;;;;;;;;-1:-1:-1;;;;;2864:26:4;;;;;;;;;;;;;2315:582;;;:::o;2159:459:3:-;2217:7;2458:6;2454:45;;-1:-1:-1;2487:1:3;2480:8;;2454:45;2521:5;;;2525:1;2521;:5;:1;2544:5;;;;;:10;2536:56;;;;-1:-1:-1;;;2536:56:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2610:1;-1:-1:-1;2159:459:3;;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;:3;:39::i;1274:134::-;1332:7;1358:43;1362:1;1365;1358:43;;;;;;;;;;;;;;;;;:3;:43::i;4648:306:4:-;4711:3;;:28;;;-1:-1:-1;;;4711:28:4;;4733:4;4711:28;;;;;;4690:18;;-1:-1:-1;;;;;4711:3:4;;:13;;:28;;;;;;;;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;4711:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4711:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4711:28:4;;-1:-1:-1;4753:15:4;4749:83;;4815:7;;;4749:83;4859:60;4878:40;4907:10;4878:24;4897:4;4878:14;;:18;;:24;;;;:::i;:40::-;4859:14;;;:60;:18;:60;:::i;:::-;4842:14;:77;-1:-1:-1;4946:1:4;4929:14;:18;4648:306;:::o;3350:196::-;3418:15;3436:19;3447:7;3436:10;:19::i;:::-;3418:37;-1:-1:-1;3469:11:4;;3466:74;;3496:33;3512:7;3521;3496:15;:33::i;:::-;3350:196;;:::o;823:202:2:-;949:68;;;-1:-1:-1;;;;;949:68:2;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;949:68:2;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;923:95:2;;942:5;;923:18;:95::i;:::-;823:202;;;;:::o;834:176:3:-;892:7;923:5;;;946:6;;;;938:46;;;;;-1:-1:-1;;;938:46:3;;;;;;;;;;;;;;;;;;;;;;;;;;;643:174:2;751:58;;;-1:-1:-1;;;;;751:58:2;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;751:58:2;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;725:85:2;;744:5;;725:18;:85::i;:::-;643:174;;;:::o;3718:338:3:-;3804:7;3904:12;3897:5;3889:28;;;;-1:-1:-1;;;3889:28:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3889:28:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;;3718:338;-1:-1:-1;;;;;3718:338:3:o;1732:187::-;1818:7;1853:12;1845:6;;;;1837:29;;;;-1:-1:-1;;;1837:29:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;1837:29:3;-1:-1:-1;;;1888:5:3;;;1732:187::o;3792:375:4:-;3883:3;;;:28;;;-1:-1:-1;;;3883:28:4;;3905:4;3883:28;;;;;;;;3866:14;;-1:-1:-1;;;;;3883:3:4;;;;:13;;:28;;;;;;;;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;3883:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3883:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3883:28:4;;-1:-1:-1;3926:16:4;;;3922:239;;;3958:3;;;:25;;;-1:-1:-1;;;3958:25:4;;-1:-1:-1;;;;;3958:25:4;;;;;;;;;;;;;;;;;;:3;;;;;:12;;:25;;;;;;;;;;;;;;;:3;;:25;;;5:2:-1;;;;30:1;27;20:12;5:2;3958:25:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3958:25:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;4010:3:4;;;:28;;;-1:-1:-1;;;4010:28:4;;4032:4;4010:28;;;;;;;;-1:-1:-1;;;;;4010:3:4;;;;:13;;:28;;;;;3958:25;;4010:28;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;4010:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4010:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4010:28:4;3997:10;:41;3922:239;;;4069:3;;;:26;;;-1:-1:-1;;;4069:26:4;;-1:-1:-1;;;;;4069:26:4;;;;;;;;;;;;;;;;;;:3;;;;;:12;;:26;;;;;;;;;;;;;;;:3;;:26;;;5:2:-1;;;;30:1;27;20:12;5:2;4069:26:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4069:26:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;4122:3:4;;;:28;;;-1:-1:-1;;;4122:28:4;;4144:4;4122:28;;;;;;;;-1:-1:-1;;;;;4122:3:4;;;;:13;;:28;;;;;4069:26;;4122:28;;;;;;;:3;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;4122:28:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4122:28:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4122:28:4;4109:10;:41;3792:375;;;:::o;2647:1095:2:-;3242:27;3250:5;-1:-1:-1;;;;;3242:25:2;;:27::i;:::-;3234:71;;;;;-1:-1:-1;;;3234:71:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;3376:12;3390:23;3425:5;-1:-1:-1;;;;;3417:19:2;3437:4;3417:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3417:25:2;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;3375:67:2;;;;3460:7;3452:52;;;;;-1:-1:-1;;;3452:52:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3519:17;;:21;3515:221;;3659:10;3648:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3648:30:2;3640:85;;;;-1:-1:-1;;;3640:85:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;685:610:0;745:4;1206:20;;1051:66;1245:23;;;;;;:42;;-1:-1:-1;1272:15:0;;;1245:42;1237:51;685:610;-1:-1:-1;;;;685:610:0:o

Swarm Source

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