Contract 0x92b02a87a3196fe8A8bB4b0770bD9Ef7148Ef190

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x70c1dd3d035602e4728be8378bc5a227ca65237cb5329d92c7c8ff97afdb021c0x60806040201799382022-09-23 14:48:445 days 20 hrs ago0xdd5cf30f56c37d3243a23543dc5bd5ee576970e2 IN  Create: BalanceHelper0 AVAX0.045037555229.7
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BalanceHelper

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 99 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : BalanceHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "ERC20.sol";
import "Ownable.sol";
import "IJoePair.sol";
import "IVoter.sol";
import "IMasterChefVTX.sol";
import "IMainStaking.sol";
import "IBoostedMultiRewarder.sol";
import "IMasterPlatypusv4.sol";
import "IJoeFactory.sol";
import "IBribeManager.sol";
import "IMasterChefVTX.sol";
import "ILockerV2.sol";
import "IBribe.sol";
import "IAPRHelper.sol";
import "IBaseRewardPool.sol";
import "AggregatorV3Interface.sol";
import "IERC20.sol";

contract BalanceHelper is Ownable {
    AggregatorV3Interface internal priceFeed;
    uint256 internal constant ACC_TOKEN_PRECISION = 1e15;
    uint256 public constant AvaxUSDDecimals = 8;
    uint256 public constant precision = 8;
    address public wavax;
    uint256 public constant FEE_DENOMINATOR = 10000;
    address public aprHelper;

    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 factor;
        uint256 accTokenPerShare;
        uint256 accTokenPerFactorShare;
    }
    //End of Storage v1

    struct HelpStack {
        address[] rewardTokens;
        uint256[] amounts;
    }

    // End of Storage v2

    constructor(address _wavax, address _aprHelper) {
        priceFeed = AggregatorV3Interface(0x0A77230d17318075983913bC2145DB16C7366156);
        wavax = _wavax;
        aprHelper = _aprHelper;
    }

    /**
     * Returns the latest price
     */
    function getAvaxLatestPrice() public view returns (uint256) {
        (, int256 price, , , ) = priceFeed.latestRoundData();
        return uint256(price);
    }

    function getTokenPricePairedWithAvax(address token) public view returns (uint256 tokenPrice) {
        address factory = IAPRHelper(aprHelper).factory();
        if (token == wavax) {
            return getAvaxLatestPrice();
        }
        address joePair = IJoeFactory(factory).getPair(token, wavax);
        if (joePair == address(0)) {
            return 0;
        }
        (uint256 token0Amount, uint256 token1Amount, ) = IJoePair(joePair).getReserves();
        bool isAvaxToken0 = wavax < token;
        if (
            (isAvaxToken0 && token0Amount / 1e18 < 1) || (!isAvaxToken0 && token1Amount / 1e18 < 1)
        ) {
            return 0;
        }
        uint256 avaxAmount = isAvaxToken0 ? token0Amount : token1Amount;
        uint256 tokenAmount = isAvaxToken0 ? token1Amount : token0Amount;
        tokenPrice = ((avaxAmount * getAvaxLatestPrice() * 10**ERC20(token).decimals()) /
            (tokenAmount * 10**ERC20(wavax).decimals()));
    }

    function getTokenPricePairedWithStable(address token, address stable) public view returns (uint256 tokenPrice) {
        address factory = IAPRHelper(aprHelper).factory();
        address joePair = IJoeFactory(factory).getPair(token, stable);
        if (joePair == address(0)) {
            return 0;
        }
        (uint256 token0Amount, uint256 token1Amount, ) = IJoePair(joePair).getReserves();
        bool isStableToken0 = stable < token;
        if (
            (isStableToken0 && token0Amount / 10**ERC20(stable).decimals() < 1) || (!isStableToken0 && token1Amount / 10**ERC20(stable).decimals() < 1)
        ) {
            return 0;
        }
        uint256 stableAmount = isStableToken0 ? token0Amount : token1Amount;
        uint256 tokenAmount = isStableToken0 ? token1Amount : token0Amount;
        tokenPrice = ((stableAmount * (10**8) * 10**ERC20(token).decimals()) /
            (tokenAmount * 10**ERC20(stable).decimals()));
    }

    function getRatio(
        address numerator,
        address denominator,
        uint256 decimals
    ) public view returns (uint256 ratio) {
        address factory = IAPRHelper(aprHelper).factory();
        address joePair = IJoeFactory(factory).getPair(numerator, denominator);
        (uint256 tokenAmount0, uint256 tokenAmount1, ) = IJoePair(joePair).getReserves();
        return
            (numerator < denominator)
                ? ((tokenAmount1 * 10**(decimals) * 10**ERC20(numerator).decimals()) /
                    (tokenAmount0 * 10**ERC20(denominator).decimals()))
                : ((tokenAmount0 * 10**(decimals) * 10**ERC20(numerator).decimals()) /
                    (tokenAmount1 * 10**ERC20(denominator).decimals()));
    }

    function getTVLForLocker() public view returns (uint256 lockerTVL) {
        address locker = IAPRHelper(aprHelper).locker();
        address vtx = IAPRHelper(aprHelper).vtx();
        lockerTVL =
            (ILockerV2(locker).totalSupply() * getTokenPricePairedWithAvax(vtx)) /
            (10**ERC20(locker).decimals());
        lockerTVL = (lockerTVL == 0) ? 1 : lockerTVL;
    }

    function getVTXAPRForLocker() public view returns (uint256 APR) {
        address masterChief = IAPRHelper(aprHelper).masterChief();
        address locker = IAPRHelper(aprHelper).locker();
        address vtx = IAPRHelper(aprHelper).vtx();
        (
            uint256 emission,
            uint256 allocpoint,
            uint256 sizeOfPool,
            uint256 totalPoint
        ) = IMasterChefVTX(masterChief).getPoolInfo(ILockerV2(locker).stakingToken());
        uint256 VTXPerYear = (emission * 365 * 24 * 3600 * allocpoint) / totalPoint;
        APR = (VTXPerYear * getTokenPricePairedWithAvax(vtx)) / getTVLForLocker() / 10**8;
    }
}

File 2 of 19 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "Context.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

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

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(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:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

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

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

        _afterTokenTransfer(address(0), account, amount);
    }

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

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

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

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

        _afterTokenTransfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be 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 {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 3 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `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 19 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 6 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

File 7 of 19 : IJoePair.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IJoePair {
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function kLast() external view returns (uint256);

    function mint(address to) external returns (uint256 liquidity);

    function burn(address to) external returns (uint256 amount0, uint256 amount1);

    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

File 8 of 19 : IVoter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IVoter {
    struct LpTokenInfo {
        uint128 claimable; // 20.18 fixed point. claimable PTP
        uint128 supplyIndex; // 20.18 fixed point. distributed reward per weight
        address gauge;
        bool whitelist;
    }

    // lpToken => weight, equals to sum of votes for a LP token
    function weights(address _lpToken) external view returns (uint256);

    function ptpPerSec() external view returns (uint256);

    function totalWeight() external view returns (uint256);

    function bribes(address _lpToken) external view returns (address);

    function vote(address[] calldata _lpVote, int256[] calldata _deltas)
        external
        returns (uint256[] memory bribeRewards);

    // user address => lpToken => votes
    function votes(address _user, address _lpToken) external view returns (uint256);

    function claimBribes(address[] calldata _lpTokens)
        external
        returns (uint256[] memory bribeRewards);

    function lpTokenLength() external view returns (uint256);

    function getUserVotes(address _user, address _lpToken) external view returns (uint256);

    function pendingBribes(address[] calldata _lpTokens, address _user)
        external
        view
        returns (uint256[] memory bribeRewards);
}

File 9 of 19 : IMasterChefVTX.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IMasterChefVTX {
    function poolLength() external view returns (uint256);

    function setPoolManagerStatus(address _address, bool _bool) external;

    function add(
        uint256 _allocPoint,
        address _lpToken,
        address _rewarder,
        address _helper
    ) external;

    function set(
        address _lp,
        uint256 _allocPoint,
        address _rewarder,
        address _locker,
        bool overwrite
    ) external;

    function vtxLocker() external view returns (address);

    function createRewarder(address _lpToken, address mainRewardToken) external returns (address);

    // View function to see pending VTXs on frontend.
    function getPoolInfo(address token)
        external
        view
        returns (
            uint256 emission,
            uint256 allocpoint,
            uint256 sizeOfPool,
            uint256 totalPoint
        );

    function pendingTokens(
        address _lp,
        address _user,
        address token
    )
        external
        view
        returns (
            uint256 pendingVTX,
            address bonusTokenAddress,
            string memory bonusTokenSymbol,
            uint256 pendingBonusToken
        );

    function rewarderBonusTokenInfo(address _lp)
        external
        view
        returns (address bonusTokenAddress, string memory bonusTokenSymbol);

    function massUpdatePools() external;

    function updatePool(address _lp) external;

    function deposit(address _lp, uint256 _amount) external;

    function depositFor(
        address _lp,
        uint256 _amount,
        address sender
    ) external;

    function lock(
        address _lp,
        uint256 _amount,
        uint256 _index,
        bool force
    ) external;

    function unlock(
        address _lp,
        uint256 _amount,
        uint256 _index
    ) external;

    function multiUnlock(
        address _lp,
        uint256[] calldata _amount,
        uint256[] calldata _index
    ) external;

    function withdraw(address _lp, uint256 _amount) external;

    function withdrawFor(
        address _lp,
        uint256 _amount,
        address _sender
    ) external;

    function multiclaim(address[] memory _lps, address user_address) external;

    function emergencyWithdraw(address _lp, address sender) external;

    function updateEmissionRate(uint256 _vtxPerSec) external;

    function depositInfo(address _lp, address _user) external view returns (uint256 depositAmount);

    function setPoolHelper(address _lp, address _helper) external;

    function authorizeLocker(address _locker) external;

    function lockFor(
        address _lp,
        uint256 _amount,
        uint256 _index,
        address _for,
        bool force
    ) external;

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

File 10 of 19 : IMainStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMainStaking {
    function vote(
        address[] calldata _lpVote,
        int256[] calldata _deltas,
        address[] calldata _rewarders,
        address caller
    ) external returns (address[] memory rewardTokens, uint256[] memory feeAmounts);

    function setXPTP(address _xPTP) external;

    function feeInfos(uint256 index)
        external
        view
        returns (
            uint256 max_value,
            uint256 min_value,
            uint256 value,
            address to,
            bool isPTP,
            bool isAddress,
            bool isActive
        );

    function addFee(
        uint256 max,
        uint256 min,
        uint256 value,
        address to,
        bool isPTP,
        bool isAddress
    ) external;

    function setFee(uint256 index, uint256 value) external;

    function setCallerFee(uint256 value) external;

    function deposit(
        address token,
        uint256 amount,
        address sender
    ) external;

    function harvest(address token, bool isUser) external;

    function withdrawLP(
        address token,
        uint256 amount,
        address sender
    ) external;

    function withdraw(
        address token,
        uint256 _amount,
        uint256 _slippage,
        address sender
    ) external;

    function withdrawForOverCoveredToken(
        address token,
        address overCoveredToken,
        uint256 _amount,
        uint256 minAmount,
        address sender
    ) external;

    function withdrawWithDifferentAssetForOverCoveredToken(
        address token,
        address overCoveredToken,
        address asset,
        uint256 _amount,
        uint256 minAmount,
        address sender
    ) external;

    function stakePTP(uint256 amount) external;

    function stakeAllPtp() external;

    function claimVePTP() external;

    function getStakedPtp() external view returns (uint256);

    function getVePtp() external view returns (uint256);

    function unstakePTP() external;

    function pendingPtpForPool(address _token) external view returns (uint256 pendingPtp);

    function masterPlatypus() external view returns (address);

    function getLPTokensForShares(uint256 amount, address token) external view returns (uint256);

    function getSharesForDepositTokens(uint256 amount, address token)
        external
        view
        returns (uint256);

    function getDepositTokensForShares(uint256 amount, address token)
        external
        view
        returns (uint256);

    function registerPool(
        uint256 _pid,
        address _token,
        address _lpAddress,
        address _staking,
        string memory receiptName,
        string memory receiptSymbol,
        uint256 allocpoints
    ) external;

    function getPoolInfo(address _address)
        external
        view
        returns (
            uint256 pid,
            bool isActive,
            address token,
            address lp,
            uint256 sizeLp,
            address receipt,
            uint256 size,
            address rewards_addr,
            address helper
        );

    function removePool(address token) external;

    function depositWithDifferentAsset(
        address token,
        address asset,
        uint256 amount,
        address sender
    ) external;

    function multiHarvest(address token, bool isUser) external;

    function withdrawWithDifferentAsset(
        address token,
        address asset,
        uint256 _amount,
        uint256 minAmount,
        address sender
    ) external;

    function registerPoolWithDifferentAsset(
        uint256 _pid,
        address _token,
        address _lpAddress,
        address _assetToken,
        string memory receiptName,
        string memory receiptSymbol,
        uint256 allocPoints
    ) external;

    function pendingBribeCallerFee(address[] calldata pendingPools)
        external
        view
        returns (address[] memory rewardTokens, uint256[] memory callerFeeAmount);
}

File 11 of 19 : IBoostedMultiRewarder.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "IERC20.sol";

interface IBoostedMultiRewarder {
    function dilutingRepartition() external view returns (uint256);

    struct PoolInfo {
        address rewardToken; // if rewardToken is 0, native token is used as reward token
        uint96 tokenPerSec; // 10.18 fixed point
        uint128 accTokenPerShare; // 26.12 fixed point. Amount of reward token each LP token is worth. Times 1e12
        uint128 accTokenPerFactorShare; // 26.12 fixed point. Accumulated ptp per factor share. Time 1e12
    }

    function poolInfo(uint256 i)
        external
        view
        returns (
            address rewardToken, // Address of LP token contract.
            uint96 tokenPerSec, // How many base allocation points assigned to this pool
            uint128 accTokenPerShare, // Last timestamp that PTPs distribution occurs.
            uint128 accTokenPerFactorShare
        );

    function onPtpReward(
        address _user,
        uint256 _lpAmount,
        uint256 _newLpAmount,
        uint256 _factor,
        uint256 _newFactor
    ) external returns (uint256[] memory rewards);

    function onUpdateFactor(
        address _user,
        uint256 _lpAmount,
        uint256 _factor,
        uint256 _newFactor
    ) external;

    function pendingTokens(
        address _user,
        uint256 _lpAmount,
        uint256 _factor
    ) external view returns (uint256[] memory rewards);

    function rewardToken() external view returns (address token);

    function tokenPerSec() external view returns (uint256);

    function poolLength() external view returns (uint256);
}

File 12 of 19 : IMasterPlatypusv4.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMasterPlatypusv4 {
    // Info of each user.
    struct UserInfo {
        // 256 bit packed
        uint128 amount; // How many LP tokens the user has provided.
        uint128 factor; // non-dialuting factor = sqrt (lpAmount * vePtp.balanceOf())
        // 256 bit packed
        uint128 rewardDebt; // Reward debt. See explanation below.
        uint128 claimablePtp;
        //
        // We do some fancy math here. Basically, any point in time, the amount of PTPs
        // entitled to a user but is pending to be distributed is:
        //
        //   ((user.amount * pool.accPtpPerShare + user.factor * pool.accPtpPerFactorShare) / 1e12) -
        //        user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accPtpPerShare`, `accPtpPerFactorShare` (and `lastRewardTimestamp`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        address lpToken; // Address of LP token contract.
        address rewarder;
        uint128 sumOfFactors; // 20.18 fixed point. The sum of all non dialuting factors by all of the users in the pool
        uint128 accPtpPerShare; // 26.12 fixed point. Accumulated PTPs per share, times 1e12.
        uint128 accPtpPerFactorShare; // 26.12 fixed point. Accumulated ptp per factor share
    }

    function getSumOfFactors(uint256) external view returns (uint256);

    function poolLength() external view returns (uint256);

    function getPoolId(address) external view returns (uint256);

    function massUpdatePools() external;

    function updatePool(uint256 _pid) external;

    function deposit(uint256 _pid, uint256 _amount)
        external
        returns (uint256 reward, uint256[] memory additionalRewards);

    function depositFor(
        uint256 _pid,
        uint256 _amount,
        address _user
    ) external;

    function multiClaim(uint256[] memory _pids)
        external
        returns (
            uint256 reward,
            uint256[] memory amounts,
            uint256[][] memory additionalRewards
        );

    function withdraw(uint256 _pid, uint256 _amount)
        external
        returns (uint256 reward, uint256[] memory additionalRewards);

    function liquidate(
        uint256 _pid,
        address _user,
        uint256 _amount
    ) external;

    function emergencyWithdraw(uint256 _pid) external;

    function updateFactor(address _user, uint256 _newVePtpBalance) external;

    function notifyRewardAmount(address _lpToken, uint256 _amount) external;

    function dilutingRepartition() external view returns (uint256);

    function pendingTokens(uint256 _pid, address _user)
        external
        view
        returns (
            uint256 pendingPtp,
            address[] memory bonusTokenAddresses,
            string[] memory bonusTokenSymbols,
            uint256[] memory pendingBonusTokens
        );

    function userInfo(uint256 _pid, address _address)
        external
        view
        returns (
            uint128 amount,
            uint128 factor,
            uint128 rewardDebt,
            uint128 claimablePtp
        );

    function migrate(uint256[] calldata _pids) external;

    function poolInfo(uint256 i)
        external
        view
        returns (
            address lpToken,
            address rewarder,
            uint128 sumOfFactors,
            uint128 accPtpPerShare,
            uint128 accPtpPerFactorShare
        );
}

File 13 of 19 : IJoeFactory.sol
pragma solidity >=0.5.0;

interface IJoeFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint256);

    function feeTo() external view returns (address);

    function feeToSetter() external view returns (address);

    function migrator() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);

    function allPairs(uint256) external view returns (address pair);

    function allPairsLength() external view returns (uint256);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;

    function setFeeToSetter(address) external;

    function setMigrator(address) external;
}

File 14 of 19 : IBribeManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBribeManager {
    function getUserVoteForPools(address[] calldata lps, address _user)
        external
        view
        returns (uint256[] memory votes);

    function poolInfos(address lp)
        external
        view
        returns (
            address poolAddress,
            address rewarder,
            bool isActive,
            string memory name
        );

    function lpTokenLength() external view returns (uint256);

    function getVoteForLp(address lp) external view returns (uint256);

    function getVoteForLps(address[] calldata lps) external view returns (uint256[] memory votes);

    function usedVote() external view returns (uint256);

    function userTotalVote(address user) external view returns (uint256);

    function poolTotalVote(address lp) external view returns (uint256 poolVote);

    function totalVtxInVote() external view returns (uint256 vtxAmount);

    function getUserMaxVote(address _user) external view returns (uint256 maxVote);

    function lastCastTimer() external view returns (uint256);

    function castVotesCooldown() external view returns (uint256);

    function totalVotes() external view returns (uint256);

    function remainingVotes() external view returns (uint256);

    function addPool(
        address _lp,
        address _rewarder,
        string memory _name
    ) external;

    /// @notice Sets the rewarder for a pool, this will distribute all bribing rewards from this pool
    /// @dev Changing a rewarder with a user staked in it will result in blocked votes.
    /// @param _pool address of the pool
    /// @param _rewarder address of the rewarder
    function setPoolRewarder(address _pool, address _rewarder) external;

    function setAvaxZapper(address newZapper) external;

    function isPoolActive(address pool) external view returns (bool);

    /// @notice Changes the votes to zero for all platypus pools. Only internal.
    /// @dev This would entirely kill all votings
    function clearPools() external;

    function removePool(uint256 _index) external;

    function veptpPerLockedVtx() external view returns (uint256);

    function getUserLocked(address _user) external view returns (uint256);

    /// @notice Vote on pools. Need to compute the delta prior to casting this.
    function vote(address[] calldata _lps, int256[] calldata _deltas) external;

    /// @notice Unvote from an inactive pool. This makes it so that deleting a pool, or changing a rewarder doesn't block users from withdrawing
    function unvote(address _lp) external;

    /// @notice cast all pending votes
    /// @notice this  function will be gas intensive, hence a fee is given to the caller
    function castVotes(bool swapForAvax) external;

    /// @notice Cast a zero vote to harvest the bribes of selected pools
    /// @notice this  function has a lesser importance than casting votes, hence no rewards will be given to the caller.
    function harvestSinglePool(address[] calldata _lps) external;

    /// @notice Cast all pending votes, this also harvest bribes from Platypus and distributes them to the pool rewarder.
    /// @notice This  function will be gas intensive, hence a fee is given to the caller
    function voteAndCast(
        address[] calldata _lps,
        int256[] calldata _deltas,
        bool swapForAvax
    ) external;

    /// @notice Harvests user rewards for each pool
    /// @notice If bribes weren't harvested, this might be lower than actual current value
    function harvestBribe(address[] calldata lps) external;

    /// @notice Harvests user rewards for each pool
    /// @notice If bribes weren't harvested, this might be lower than actual current value
    function harvestBribeFor(address[] calldata lps, address _for) external;

    /// @notice Harvests user rewards for each pool where he has voted
    /// @notice If bribes weren't harvested, this might be lower than actual current value
    /// @param _for user to harvest bribes for.
    function harvestAllBribes(address _for) external;

    /// @notice Cast all votes to platypus, harvesting the rewards from platypus for Vector, and then harvesting specifically for the chosen pools.
    /// @notice this  function will be gas intensive, hence a fee is given to the caller for casting the vote.
    /// @param lps lps to harvest
    function castVotesAndHarvestBribes(address[] calldata lps, bool swapForAvax) external;

    function previewAvaxAmountForHarvest(address[] calldata _lps) external view returns (uint256);

    /// @notice Returns pending bribes
    function previewBribes(
        address lp,
        address[] calldata inputRewardTokens,
        address _for
    ) external view returns (address[] memory rewardTokens, uint256[] memory amounts);
}

File 15 of 19 : ILockerV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILockerV2 {
    function totalLocked() external view returns (uint256);

    function totalUnlocking() external view returns (uint256);

    function userLocked(address user) external view returns (uint256); // total vtx locked

    function rewarder() external view returns (address);

    function stakingToken() external view returns (address);

    function claimFor(address _for) external;

    function balanceOf(address _user) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function claim() external;
}

File 16 of 19 : IBribe.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "IERC20.sol";

interface IBribe {
    function onVote(
        address user,
        uint256 newVote,
        uint256 originalTotalVotes
    ) external returns (uint256);

    function pendingTokens(address user) external view returns (uint256 pending);

    function rewardToken() external view returns (IERC20);

    function tokenPerSec() external view returns (uint256);

    function userInfo(address _address)
        external
        view
        returns (
            uint128 amount,
            uint128 rewardDebt,
            uint128 unpaidRewards
        );
}

File 17 of 19 : IAPRHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IAPRHelper {
    function getPTPperYear(address lp) external view returns (uint256 ptpPerYearPerToken);

    function masterPlatypus() external view returns (address);

    function voter() external view returns (address);

    function mainstakingTJ() external view returns (address);

    function locker() external view returns (address);

    function factory() external view returns (address);

    function mainStaking() external view returns (address);

    function balanceHelper() external view returns (address);

    function masterChief() external view returns (address);

    function vtx() external view returns (address);

    function pool2token(address lp) external view returns (address);

    function lp2asset(address lp) external view returns (address);

    function getLengthTJPools() external view returns (uint256);

    function tjPools(uint256 i) external view returns (address);

    function getLengthPtpPools() external view returns (uint256);

    function ptpPools(uint256 i) external view returns (address);

    function getTVL(address lp) external view returns (uint256 TVLinUSD);

    function getPTPperYearForVector(address lp)
        external
        view
        returns (uint256 pendingBasePtp, uint256 pendingBoostedPtp);

    function getAPRforPTPPoolInPTP(address lp)
        external
        view
        returns (uint256 baseAPR, uint256 boostedAPR);

    function getMultipleAPRforPTPPoolsInPTP(address[] calldata lp)
        external
        view
        returns (uint256[] memory baseAPR, uint256[] memory boostedAPR);

    function getMultipleAPRforPTPPoolsInAdditionalReward(address[] calldata lp)
        external
        view
        returns (uint256[] memory APR);

    function getAPRforPTPPoolInAdditionalReward(address lp) external view returns (uint256 APR);

    function getTokenPricePairedWithAvax(address token) external view returns (uint256 tokenPrice);

    function getPlatypusFees(uint256 index) external view returns (uint256 feeAmount);

    function getPTPClaimableRewards(
        address lp,
        address[] calldata inputRewardTokens,
        address user
    )
        external
        view
        returns (
            address[] memory rewardTokens,
            uint256[] memory amounts,
            uint256[] memory usdAmounts
        );

    function getPTPHarvestableRewards(address lp, address user)
        external
        view
        returns (
            address[] memory rewardTokens,
            uint256[] memory amounts,
            uint256[] memory usdAmounts
        );

    function getRatio(
        address numerator,
        address denominator,
        uint256 decimals
    ) external view returns (uint256 ratio);

    function leftVotes(uint256[] calldata percentages)
        external
        view
        returns (int256 left, uint256 totalPercentage);

    function votesInBigNumbers(uint256[] calldata percentages)
        external
        view
        returns (uint256[] memory votes, uint256 totalPercentage);

    function getTVLForLocker() external view returns (uint256 lockerTVL);

    function getXPTPAPRForLocker(uint256 feeAmount) external view returns (uint256 APR);

    function getPendingBribes(
        address user,
        address lp,
        address[] calldata inputRewardTokens
    ) external view returns (address[] memory rewardTokens, uint256[] memory amounts);

    function getAllPendingBribes(
        address user,
        address[] calldata lps,
        address[] calldata inputRewardTokens
    ) external view returns (address[] memory allRewardTokens, uint256[] memory totalAmounts);

    function getVTXAPRForLocker() external view returns (uint256 APR);

    function getBribes(address lp) external view returns (uint256 bribesPerYear);

    function getFutureBribes(address lp, uint256 vtxDelta)
        external
        view
        returns (uint256 bribesPerYear);

    function getTVLOfVotedLocker() external view returns (uint256 votedLocker);

    function getAPRforVotingForLVTX(address lp) external view returns (uint256 APR);

    function getAPRPreview(address lp, uint256 vtxDelta) external view returns (uint256 APR);

    function getPendingRewardsFromLocker(address user, address[] calldata inputRewardTokens)
        external
        view
        returns (address[] memory rewardTokens, uint256[] memory amounts);

    // function getVePtpPerVTX() public view returns (uint256 votingPower) {
    //     votingPower = IBribeManager(bribeManager).veptpPerLockedVtx();
    // }

    function getBribesPerAmount(address lp, uint256 vtxAmount)
        external
        view
        returns (uint256 bribesPerYear);
}

File 18 of 19 : IBaseRewardPool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBaseRewardPool {
    struct Reward {
        address rewardToken;
        uint256 rewardPerTokenStored;
        uint256 queuedRewards;
        uint256 historicalRewards;
    }

    function rewards(address token) external view returns (Reward memory rewardInfo);

    function rewards(uint256 i)
        external
        view
        returns (
            address rewardToken,
            uint256 rewardPerTokenStored,
            uint256 queuedRewards,
            uint256 historicalRewards
        );

    function rewardTokens() external view returns (address[] memory);

    // These are for TraderJoe Rewarder
    function rewardToken() external view returns (address);

    function pendingTokens(address user) external view returns (uint256);

    function balance() external view returns (uint256);

    function userInfo(address user)
        external
        view
        returns (
            uint256 amount,
            uint256 rewardDebt,
            uint256 unpaidRewards
        );

    // END
    function getStakingToken() external view returns (address);

    function isRewardToken(address token) external view returns (bool);

    function getReward(address _account) external returns (bool);

    function getReward(address _account, uint256 percentage) external;

    function rewardDecimals(address token) external view returns (uint256);

    function stakingDecimals() external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function rewardPerToken(address token) external view returns (uint256);

    function updateFor(address account) external;

    function earned(address account, address token) external view returns (uint256);

    function stakeFor(address _for, uint256 _amount) external returns (bool);

    function withdrawFor(
        address user,
        uint256 amount,
        bool claim
    ) external;

    function queueNewRewards(uint256 _rewards, address token) external returns (bool);

    function donateRewards(uint256 _amountReward, address _rewardToken) external returns (bool);
}

File 19 of 19 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
    function decimals() external view returns (uint8);

    function description() external view returns (string memory);

    function version() external view returns (uint256);

    // getRoundData and latestRoundData should both raise "No data present"
    // if they do not have data to report, instead of returning unset values
    // which could be misinterpreted as actual reported values.
    function getRoundData(uint80 _roundId)
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );

    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 99
  },
  "libraries": {
    "BalanceHelper.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_wavax","type":"address"},{"internalType":"address","name":"_aprHelper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"AvaxUSDDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aprHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvaxLatestPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"numerator","type":"address"},{"internalType":"address","name":"denominator","type":"address"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"name":"getRatio","outputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTVLForLocker","outputs":[{"internalType":"uint256","name":"lockerTVL","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTokenPricePairedWithAvax","outputs":[{"internalType":"uint256","name":"tokenPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"stable","type":"address"}],"name":"getTokenPricePairedWithStable","outputs":[{"internalType":"uint256","name":"tokenPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVTXAPRForLocker","outputs":[{"internalType":"uint256","name":"APR","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wavax","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162001a0538038062001a058339810160408190526200003491620000fd565b6200003f3362000090565b600180546001600160a01b0319908116730a77230d17318075983913bc2145db16c736615617909155600280546001600160a01b039485169083161790556003805492909316911617905562000135565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080604083850312156200011157600080fd5b6200011c83620000e0565b91506200012c60208401620000e0565b90509250929050565b6118c080620001456000396000f3fe608060405234801561001057600080fd5b50600436106100ca5760003560e01c8063715018a61161007c578063715018a6146101695780638da5cb5b14610173578063d3b5dc3b14610184578063d73792a91461018c578063d869b55914610195578063e81d81ba14610184578063f2fde38b1461019d57600080fd5b80630f2f5b34146100cf578063117be4c2146100ea5780631963c686146101155780632998cbb11461012857806339c2dbbe1461013b5780634e85f2381461014e57806363710ea614610161575b600080fd5b6100d76101b0565b6040519081526020015b60405180910390f35b6002546100fd906001600160a01b031681565b6040516001600160a01b0390911681526020016100e1565b6100d7610123366004611581565b6104d4565b6100d7610136366004611548565b6108ec565b6003546100fd906001600160a01b031681565b6100d761015c36600461150e565b610d3a565b6100d76110e3565b610171611177565b005b6000546001600160a01b03166100fd565b6100d7600881565b6100d761271081565b6100d76111b6565b6101716101ab36600461150e565b6113ed565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663e60cec876040518163ffffffff1660e01b815260040160206040518083038186803b15801561020157600080fd5b505afa158015610215573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610239919061152b565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663d7b96d4e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561028b57600080fd5b505afa15801561029f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c3919061152b565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663b76ae05e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561031557600080fd5b505afa158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d919061152b565b9050600080600080866001600160a01b03166306bfa938876001600160a01b03166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b15801561039d57600080fd5b505afa1580156103b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d5919061152b565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160806040518083038186803b15801561041457600080fd5b505afa158015610428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044c919061162b565b9350935093509350600081848661016d6104669190611840565b610471906018611840565b61047d90610e10611840565b6104879190611840565b6104919190611723565b90506305f5e1006104a06111b6565b6104a988610d3a565b6104b39084611840565b6104bd9190611723565b6104c79190611723565b9850505050505050505090565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561052557600080fd5b505afa158015610539573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055d919061152b565b90506000816001600160a01b031663e6a4390587876040518363ffffffff1660e01b815260040161058f9291906116d4565b60206040518083038186803b1580156105a757600080fd5b505afa1580156105bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105df919061152b565b9050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561061d57600080fd5b505afa158015610631573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065591906115c2565b506001600160701b031691506001600160701b03169150866001600160a01b0316886001600160a01b0316106107b557866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106be57600080fd5b505afa1580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f691906116b1565b61070190600a611794565b61070b9082611840565b886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561074457600080fd5b505afa158015610758573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077c91906116b1565b61078790600a611794565b61079288600a611788565b61079c9085611840565b6107a69190611840565b6107b09190611723565b6108e0565b866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ee57600080fd5b505afa158015610802573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082691906116b1565b61083190600a611794565b61083b9083611840565b886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561087457600080fd5b505afa158015610888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ac91906116b1565b6108b790600a611794565b6108c288600a611788565b6108cc9084611840565b6108d69190611840565b6108e09190611723565b98975050505050505050565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561093d57600080fd5b505afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610975919061152b565b90506000816001600160a01b031663e6a4390586866040518363ffffffff1660e01b81526004016109a79291906116d4565b60206040518083038186803b1580156109bf57600080fd5b505afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f7919061152b565b90506001600160a01b038116610a1257600092505050610d34565b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610a4e57600080fd5b505afa158015610a62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8691906115c2565b506001600160701b0391821693501690506001600160a01b0380881690871610808015610b3857506001876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610ae957600080fd5b505afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2191906116b1565b610b2c90600a611794565b610b369085611723565b105b80610bd1575080158015610bd157506001876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8257600080fd5b505afa158015610b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bba91906116b1565b610bc590600a611794565b610bcf9084611723565b105b15610be457600095505050505050610d34565b600081610bf15782610bf3565b835b9050600082610c025784610c04565b835b9050886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3f57600080fd5b505afa158015610c53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7791906116b1565b610c8290600a611794565b610c8c9082611840565b8a6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc557600080fd5b505afa158015610cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfd91906116b1565b610d0890600a611794565b610d16846305f5e100611840565b610d209190611840565b610d2a9190611723565b9750505050505050505b92915050565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8b57600080fd5b505afa158015610d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc3919061152b565b6002549091506001600160a01b0384811691161415610deb57610de46110e3565b9392505050565b60025460405163e6a4390560e01b81526000916001600160a01b038085169263e6a4390592610e219289929116906004016116d4565b60206040518083038186803b158015610e3957600080fd5b505afa158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061152b565b90506001600160a01b038116610e8b575060009392505050565b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610ec757600080fd5b505afa158015610edb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eff91906115c2565b506002546001600160701b039283169450911691506001600160a01b03808816911610808015610f4057506001610f3e670de0b6b3a764000085611723565b105b80610f65575080158015610f6557506001610f63670de0b6b3a764000084611723565b105b15610f77575060009695505050505050565b600081610f845782610f86565b835b9050600082610f955784610f97565b835b9050600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe757600080fd5b505afa158015610ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101f91906116b1565b61102a90600a611794565b6110349082611840565b896001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561106d57600080fd5b505afa158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a591906116b1565b6110b090600a611794565b6110b86110e3565b6110c29085611840565b6110cc9190611840565b6110d69190611723565b9998505050505050505050565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561113457600080fd5b505afa158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c9190611661565b509195945050505050565b6000546001600160a01b031633146111aa5760405162461bcd60e51b81526004016111a1906116ee565b60405180910390fd5b6111b46000611488565b565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663d7b96d4e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561120757600080fd5b505afa15801561121b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123f919061152b565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663b76ae05e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561129157600080fd5b505afa1580156112a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c9919061152b565b9050816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c91906116b1565b61134790600a611794565b61135082610d3a565b836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c19190611612565b6113cb9190611840565b6113d59190611723565b925082156113e357826113e6565b60015b9250505090565b6000546001600160a01b031633146114175760405162461bcd60e51b81526004016111a1906116ee565b6001600160a01b03811661147c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016111a1565b61148581611488565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160701b03811681146114ef57600080fd5b919050565b805169ffffffffffffffffffff811681146114ef57600080fd5b60006020828403121561152057600080fd5b8135610de481611875565b60006020828403121561153d57600080fd5b8151610de481611875565b6000806040838503121561155b57600080fd5b823561156681611875565b9150602083013561157681611875565b809150509250929050565b60008060006060848603121561159657600080fd5b83356115a181611875565b925060208401356115b181611875565b929592945050506040919091013590565b6000806000606084860312156115d757600080fd5b6115e0846114d8565b92506115ee602085016114d8565b9150604084015163ffffffff8116811461160757600080fd5b809150509250925092565b60006020828403121561162457600080fd5b5051919050565b6000806000806080858703121561164157600080fd5b505082516020840151604085015160609095015191969095509092509050565b600080600080600060a0868803121561167957600080fd5b611682866114f4565b94506020860151935060408601519250606086015191506116a5608087016114f4565b90509295509295909350565b6000602082840312156116c357600080fd5b815160ff81168114610de457600080fd5b6001600160a01b0392831681529116602082015260400190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008261174057634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156117805781600019048211156117665761176661185f565b8085161561177357918102915b93841c939080029061174a565b509250929050565b6000610de4838361179f565b6000610de460ff8416835b6000826117ae57506001610d34565b816117bb57506000610d34565b81600181146117d157600281146117db576117f7565b6001915050610d34565b60ff8411156117ec576117ec61185f565b50506001821b610d34565b5060208310610133831016604e8410600b841016171561181a575081810a610d34565b6118248383611745565b80600019048211156118385761183861185f565b029392505050565b600081600019048311821515161561185a5761185a61185f565b500290565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461148557600080fdfea2646970667358221220733235744cbf200a5fe584009df9e201c1847a5efd92e74132d3178989a1171264736f6c63430008070033000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000d303b4cbf706650eb1a8b73683065ada3f9d306a

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

000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000d303b4cbf706650eb1a8b73683065ada3f9d306a

-----Decoded View---------------
Arg [0] : _wavax (address): 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
Arg [1] : _aprHelper (address): 0xd303b4cbf706650eb1a8b73683065ada3f9d306a

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7
Arg [1] : 000000000000000000000000d303b4cbf706650eb1a8b73683065ada3f9d306a


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.