false
false
100

Contract Address Details

0xC73cACe7610a18895117F6ffab9AB0Ca73f6c2a1

Contract Name
SinkConverter
Creator
0x871ea7–388d63 at 0x1b3066–95084c
Balance
0 KAVA ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
11603026
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
SinkConverter




Optimization enabled
true
Compiler version
v0.8.19+commit.7dd6d404




Optimization runs
200
EVM Version
default




Verified at
2023-10-05T14:32:19.276923Z

Constructor Arguments

0x000000000000000000000000de7917e632f3f7dc3555f3f82e9bda746e62b024

Arg [0] (address) : 0xde7917e632f3f7dc3555f3f82e9bda746e62b024

              

contracts/v1/sink/SinkConverter.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import { IVara } from "../../interfaces/IVara.sol";
import { IPool } from "../../interfaces/IPool.sol";
import { ISinkManager } from "../../interfaces/ISinkManager.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/// @notice Fake pool used which enables routers to swap v1 VELO to v2 VELO
/// @dev Used in voter v2
/// @author varadrome.finance, @pegahcarter
contract SinkConverter is ERC20, IPool, ReentrancyGuard {
  error SinkConverter_NotImplemented();

  ISinkManager public immutable sinkManager;
  IVara public immutable vara;
  IVara public immutable varaV2;

  /// @dev public variables found in Pool.sol
  address public immutable token0;
  address public immutable token1;

  event Swap(
    address indexed sender,
    uint256 amount0In,
    uint256 amount1In,
    uint256 amount0Out,
    uint256 amount1Out,
    address indexed to
  );

  constructor(address _sinkManager) ERC20("Velodrome V1/V2 Converter", "sCONV-VELOv1/VELOv2") {
    // Set state
    sinkManager = ISinkManager(_sinkManager);
    varaV2 = sinkManager.varaV2();
    vara = sinkManager.vara();

    // approve transfers of the sinkManager for sending VELO v1
    vara.approve(_sinkManager, type(uint256).max);

    // sort tokens just like in PoolFactory - needed as Router._swap()
    // sorts the token route
    (token0, token1) = address(vara) < address(varaV2)
      ? (address(vara), address(varaV2))
      : (address(varaV2), address(vara));
  }

  /// @dev override as there is a 1:1 conversion rate of VELO v1 => v2
  function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256) {
    if (tokenIn != address(vara)) return 0;
    return amountIn;
  }

  /// @dev low-level function which works like Pool.swap() which assumes
  ///         that the tokenIn has already been transferred to the pool
  function swap(
    uint256 amount0Out,
    uint256 amount1Out,
    address to,
    bytes calldata /* data */
  ) external nonReentrant {
    // Only allow amount out of varaV2
    uint256 amountOut = token0 == address(varaV2) ? amount0Out : amount1Out;
    require(amountOut > 0, "SinkConverter: nothing to convert");

    // convert vara v1 to v2
    sinkManager.convertVELO(amountOut);

    // transfer vara v2 to recipient
    varaV2.transfer(to, amountOut);

    // Swap event to follow convention of Swap() from Pool.sol
    uint256 amount0In;
    uint256 amount1In;
    // Note; amountIn will only ever be vara v1 token
    (amount0In, amount1In) = token0 == address(varaV2)
      ? (uint256(0), amountOut)
      : (amountOut, uint256(0));
    emit Swap(_msgSender(), to, amount0In, amount1In, amount0Out, amount1Out);
  }

  // --------------------------------------------------------------
  // IPool overrides for interface support
  // --------------------------------------------------------------

  function mint(address) external pure returns (uint256) {
    revert SinkConverter_NotImplemented();
  }

  function burn(address) external pure returns (uint256, uint256) {
    revert SinkConverter_NotImplemented();
  }

  function claimable0(address) external pure returns (uint256) {
    return 0;
  }

  function claimable1(address) external pure returns (uint256) {
    return 0;
  }

  function claimFees() external pure returns (uint256, uint256) {
    revert SinkConverter_NotImplemented();
  }

  function currentCumulativePrices() external pure returns (uint256, uint256, uint256) {
    revert SinkConverter_NotImplemented();
  }

  function getReserves() external pure returns (uint256, uint256, uint256) {
    revert SinkConverter_NotImplemented();
  }

  function initialize(address, address, bool) external pure {
    revert SinkConverter_NotImplemented();
  }

  function metadata()
    external
    view
    returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1)
  {
    return (18, 18, 0, 0, true, token0, token1);
  }

  function quote(address, uint256, uint256) external pure returns (uint256) {
    revert SinkConverter_NotImplemented();
  }

  function reserve0() external pure returns (uint256) {
    return 0;
  }

  function reserve1() external pure returns (uint256) {
    return 0;
  }

  function prices(address, uint256, uint256) external pure returns (uint256[] memory) {
    revert SinkConverter_NotImplemented();
  }

  function sample(address, uint256, uint256, uint256) external pure returns (uint256[] memory) {
    revert SinkConverter_NotImplemented();
  }

  function skim(address) external pure {
    revert SinkConverter_NotImplemented();
  }

  function stable() external pure returns (bool) {
    return true;
  }

  function sync() external pure returns (bool) {
    revert SinkConverter_NotImplemented();
  }

  function tokens() external view returns (address, address) {
    return (token0, token1);
  }
}
        

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
          

@openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * 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}.
     *
     * 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 default value returned by this function, unless
     * it's 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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 {}
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

@openzeppelin/contracts/token/ERC20/extensions/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);
}
          

@openzeppelin/contracts/utils/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;
    }
}
          

contracts/interfaces/IPool.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IPool {
    error DepositsNotEqual();
    error BelowMinimumK();
    error FactoryAlreadySet();
    error InsufficientLiquidity();
    error InsufficientLiquidityMinted();
    error InsufficientLiquidityBurned();
    error InsufficientOutputAmount();
    error InsufficientInputAmount();
    error IsPaused();
    error InvalidTo();
    error K();
    error NotEmergencyCouncil();

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

    function metadata()
        external
        view
        returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1);

    function claimFees() external returns (uint256, uint256);

    function tokens() external view returns (address, address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function stable() external view returns (bool);

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

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

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

    function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);

    function getAmountOut(uint256, address) external view returns (uint256);

    function skim(address to) external;

    function initialize(address _token0, address _token1, bool _stable) external;
}
          

contracts/interfaces/ISinkManager.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IVara } from "./IVara.sol";

interface ISinkManager {
  event ConvertVELO(address indexed who, uint256 amount, uint256 timestamp);
  event ConvertVe(
    address indexed who,
    uint256 indexed tokenId,
    uint256 indexed tokenIdV2,
    uint256 amount,
    uint256 lockEnd,
    uint256 timestamp
  );
  event ClaimRebaseAndGaugeRewards(
    address indexed who,
    uint256 amountResidual,
    uint256 amountRewarded,
    uint256 amountRebased,
    uint256 timestamp
  );

  error ContractNotOwnerOfToken();
  error GaugeAlreadySet();
  error GaugeNotSet();
  error GaugeNotSinkDrain();
  error NFTAlreadyConverted();
  error NFTNotApproved();
  error NFTExpired();
  error TokenIdNotSet();
  error TokenIdAlreadySet();

  function ownedTokenId() external view returns (uint256);

  function vara() external view returns (IVara);

  function varaV2() external view returns (IVara);

  /// @notice Helper utility that returns amount of token captured by epoch
  function captured(uint256 timestamp) external view returns (uint256 amount);

  /// @notice User converts their v1 VELO into v2 VELO
  /// @param amount Amount of VELO to convert
  function convertVELO(uint256 amount) external;

  /// @notice User converts their v1 ve into v2 ve
  /// @param tokenId      Token ID of v1 ve
  /// @return tokenIdV2   Token ID of v2 ve
  function convertVe(uint256 tokenId) external returns (uint256 tokenIdV2);

  /// @notice Claim SinkManager-eligible rebase and gauge rewards to lock into the SinkManager-owned tokenId
  /// @dev Callable by anyone
  function claimRebaseAndGaugeRewards() external;
}
          

contracts/interfaces/IVara.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IVara is IERC20 {
  error NotMinter();
  error NotOwner();
  error NotMinterOrSinkManager();
  error SinkManagerAlreadySet();

  function mint(address, uint256) external returns (bool);

  function minter() external returns (address);
}
          

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
          

@openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * 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}.
     *
     * 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 default value returned by this function, unless
     * it's 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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 {}
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

@openzeppelin/contracts/token/ERC20/extensions/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);
}
          

@openzeppelin/contracts/utils/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;
    }
}
          

contracts/interfaces/IPool.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IPool {
    error DepositsNotEqual();
    error BelowMinimumK();
    error FactoryAlreadySet();
    error InsufficientLiquidity();
    error InsufficientLiquidityMinted();
    error InsufficientLiquidityBurned();
    error InsufficientOutputAmount();
    error InsufficientInputAmount();
    error IsPaused();
    error InvalidTo();
    error K();
    error NotEmergencyCouncil();

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

    function metadata()
        external
        view
        returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1);

    function claimFees() external returns (uint256, uint256);

    function tokens() external view returns (address, address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function stable() external view returns (bool);

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

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

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

    function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);

    function getAmountOut(uint256, address) external view returns (uint256);

    function skim(address to) external;

    function initialize(address _token0, address _token1, bool _stable) external;
}
          

contracts/interfaces/ISinkManager.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IVara } from "./IVara.sol";

interface ISinkManager {
  event ConvertVELO(address indexed who, uint256 amount, uint256 timestamp);
  event ConvertVe(
    address indexed who,
    uint256 indexed tokenId,
    uint256 indexed tokenIdV2,
    uint256 amount,
    uint256 lockEnd,
    uint256 timestamp
  );
  event ClaimRebaseAndGaugeRewards(
    address indexed who,
    uint256 amountResidual,
    uint256 amountRewarded,
    uint256 amountRebased,
    uint256 timestamp
  );

  error ContractNotOwnerOfToken();
  error GaugeAlreadySet();
  error GaugeNotSet();
  error GaugeNotSinkDrain();
  error NFTAlreadyConverted();
  error NFTNotApproved();
  error NFTExpired();
  error TokenIdNotSet();
  error TokenIdAlreadySet();

  function ownedTokenId() external view returns (uint256);

  function vara() external view returns (IVara);

  function varaV2() external view returns (IVara);

  /// @notice Helper utility that returns amount of token captured by epoch
  function captured(uint256 timestamp) external view returns (uint256 amount);

  /// @notice User converts their v1 VELO into v2 VELO
  /// @param amount Amount of VELO to convert
  function convertVELO(uint256 amount) external;

  /// @notice User converts their v1 ve into v2 ve
  /// @param tokenId      Token ID of v1 ve
  /// @return tokenIdV2   Token ID of v2 ve
  function convertVe(uint256 tokenId) external returns (uint256 tokenIdV2);

  /// @notice Claim SinkManager-eligible rebase and gauge rewards to lock into the SinkManager-owned tokenId
  /// @dev Callable by anyone
  function claimRebaseAndGaugeRewards() external;
}
          

contracts/interfaces/IVara.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IVara is IERC20 {
  error NotMinter();
  error NotOwner();
  error NotMinterOrSinkManager();
  error SinkManagerAlreadySet();

  function mint(address, uint256) external returns (bool);

  function minter() external returns (address);
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_sinkManager","internalType":"address"}]},{"type":"error","name":"BelowMinimumK","inputs":[]},{"type":"error","name":"DepositsNotEqual","inputs":[]},{"type":"error","name":"FactoryAlreadySet","inputs":[]},{"type":"error","name":"InsufficientInputAmount","inputs":[]},{"type":"error","name":"InsufficientLiquidity","inputs":[]},{"type":"error","name":"InsufficientLiquidityBurned","inputs":[]},{"type":"error","name":"InsufficientLiquidityMinted","inputs":[]},{"type":"error","name":"InsufficientOutputAmount","inputs":[]},{"type":"error","name":"InvalidTo","inputs":[]},{"type":"error","name":"IsPaused","inputs":[]},{"type":"error","name":"K","inputs":[]},{"type":"error","name":"NotEmergencyCouncil","inputs":[]},{"type":"error","name":"SinkConverter_NotImplemented","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Burn","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Claim","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"recipient","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Fees","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Mint","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Swap","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount0In","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1In","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount0Out","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1Out","internalType":"uint256","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Swap","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount0In","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1In","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount0Out","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1Out","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Sync","inputs":[{"type":"uint256","name":"reserve0","internalType":"uint256","indexed":false},{"type":"uint256","name":"reserve1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"burn","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimFees","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimable0","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimable1","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentCumulativePrices","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"address","name":"tokenIn","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getReserves","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"bool","name":"","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"dec0","internalType":"uint256"},{"type":"uint256","name":"dec1","internalType":"uint256"},{"type":"uint256","name":"r0","internalType":"uint256"},{"type":"uint256","name":"r1","internalType":"uint256"},{"type":"bool","name":"st","internalType":"bool"},{"type":"address","name":"t0","internalType":"address"},{"type":"address","name":"t1","internalType":"address"}],"name":"metadata","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mint","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"prices","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"quote","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"reserve0","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"reserve1","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"sample","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ISinkManager"}],"name":"sinkManager","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[],"name":"skim","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"stable","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"uint256","name":"amount0Out","internalType":"uint256"},{"type":"uint256","name":"amount1Out","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"sync","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"token0","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"token1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}],"name":"tokens","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IVara"}],"name":"vara","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IVara"}],"name":"varaV2","inputs":[]}]
              

Contract Creation Code

0x6101206040523480156200001257600080fd5b50604051620017353803806200173583398101604081905262000035916200029c565b6040518060400160405280601981526020017f56656c6f64726f6d652056312f563220436f6e766572746572000000000000008152506040518060400160405280601381526020017f73434f4e562d56454c4f76312f56454c4f7632000000000000000000000000008152508160039081620000b2919062000368565b506004620000c1828262000368565b50506001600555506001600160a01b0381166080819052604080516307e6a67b60e51b8152905163fcd4cf60916004808201926020929091908290030181865afa15801562000114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200013a91906200029c565b6001600160a01b031660c0816001600160a01b0316815250506080516001600160a01b031663fd84b53b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000194573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ba91906200029c565b6001600160a01b0390811660a081905260405163095ea7b360e01b8152918316600483015260001960248301529063095ea7b3906044016020604051808303816000875af115801562000211573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000237919062000434565b5060c0516001600160a01b031660a0516001600160a01b031610620002625760c05160a05162000269565b60a05160c0515b6001600160a01b03908116610100521660e0525062000458565b6001600160a01b03811681146200029957600080fd5b50565b600060208284031215620002af57600080fd5b8151620002bc8162000283565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002ee57607f821691505b6020821081036200030f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200036357600081815260208120601f850160051c810160208610156200033e5750805b601f850160051c820191505b818110156200035f578281556001016200034a565b5050505b505050565b81516001600160401b03811115620003845762000384620002c3565b6200039c81620003958454620002d9565b8462000315565b602080601f831160018114620003d45760008415620003bb5750858301515b600019600386901b1c1916600185901b1785556200035f565b600085815260208120601f198616915b828110156200040557888601518255948401946001909101908401620003e4565b5085821015620004245787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200044757600080fd5b81518015158114620002bc57600080fd5b60805160a05160c05160e0516101005161124b620004ea6000396000818161038b015281816104ba015261053101526000818161029f01528181610363015281816104950152818161061b01526107ee015260008181610594015281816105f10152818161074f01526107c40152600081816105bb0152610ad80152600081816103f901526106c7015261124b6000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c80636a62784211610125578063bc25cf77116100ad578063e4bbb5a81161007c578063e4bbb5a81461056e578063f140a35a1461057c578063fcd4cf601461058f578063fd84b53b146105b6578063fff6cae9146105dd57600080fd5b8063bc25cf7714610519578063d21220a71461052c578063d294f09314610553578063dd62ed3e1461055b57600080fd5b80639d63848a116100f45780639d63848a146104875780639e8cc04b146104e5578063a1ac4d13146103d2578063a457c2d7146104f3578063a9059cbb1461050657600080fd5b80636a6278421461041b57806370a082311461042e57806389afcb441461045757806395d89b411461047f57600080fd5b806323b872dd116101a8578063443cb4bc11610177578063443cb4bc146103cb5780634d5a9f8a146103d25780635881c475146103e65780635a76f25e146103cb5780635b11e758146103f457600080fd5b806323b872dd14610312578063313ce56714610325578063392f37e91461033457806339509351146103b857600080fd5b80630dfe1681116101ef5780630dfe16811461029a57806313345fe1146102d957806318160ddd146102f95780631df8c7171461025457806322be3de11461030b57600080fd5b8063022c0d9f1461022157806306fdde03146102365780630902f1ac14610254578063095ea7b314610277575b600080fd5b61023461022f366004610ed5565b6105e5565b005b61023e610896565b60405161024b9190610f69565b60405180910390f35b61025c610928565b6040805193845260208401929092529082015260600161024b565b61028a610285366004610fb7565b610946565b604051901515815260200161024b565b6102c17f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161024b565b6102ec6102e7366004610fe1565b610960565b60405161024b919061101a565b6002545b60405190815260200161024b565b600161028a565b61028a61032036600461105e565b61097b565b6040516012815260200161024b565b604080516012808252602082015260009181018290526060810191909152600160808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e00161024b565b61028a6103c6366004610fb7565b61099f565b60006102fd565b6102fd6103e036600461109a565b50600090565b6102ec6102e73660046110bc565b6102c17f000000000000000000000000000000000000000000000000000000000000000081565b6102fd61042936600461109a565b6109c1565b6102fd61043c36600461109a565b6001600160a01b031660009081526020819052604090205490565b61046a61046536600461109a565b6109dc565b6040805192835260208301919091520161024b565b61023e6109f8565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f00000000000000000000000000000000000000000000000000000000000000001660208201520161024b565b6102fd6104293660046110bc565b61028a610501366004610fb7565b610a07565b61028a610514366004610fb7565b610a82565b61023461052736600461109a565b610a90565b6102c17f000000000000000000000000000000000000000000000000000000000000000081565b61046a6109dc565b6102fd6105693660046110ef565b610aa9565b610234610527366004611133565b6102fd61058a36600461117a565b610ad4565b6102c17f000000000000000000000000000000000000000000000000000000000000000081565b6102c17f000000000000000000000000000000000000000000000000000000000000000081565b61028a6109c1565b6105ed610b1e565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461064e5784610650565b855b9050600081116106b15760405162461bcd60e51b815260206004820152602160248201527f53696e6b436f6e7665727465723a206e6f7468696e6720746f20636f6e7665726044820152601d60fa1b60648201526084015b60405180910390fd5b6040516318a6c3fd60e21b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063629b0ff490602401600060405180830381600087803b15801561071357600080fd5b505af1158015610727573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018590527f000000000000000000000000000000000000000000000000000000000000000016925063a9059cbb91506044016020604051808303816000875af115801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be919061119d565b506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461082357826000610827565b6000835b60408051838152602081018390528082018c9052606081018b905290519294509092506001600160a01b0388169133917fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b919081900360800190a350505061088f6001600555565b5050505050565b6060600380546108a5906111ba565b80601f01602080910402602001604051908101604052809291908181526020018280546108d1906111ba565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b5050505050905090565b600080600060405163c1b84b2f60e01b815260040160405180910390fd5b600033610954818585610b77565b60019150505b92915050565b606060405163c1b84b2f60e01b815260040160405180910390fd5b600033610989858285610c9b565b610994858585610d15565b506001949350505050565b6000336109548185856109b28383610aa9565b6109bc91906111f4565b610b77565b600060405163c1b84b2f60e01b815260040160405180910390fd5b60008060405163c1b84b2f60e01b815260040160405180910390fd5b6060600480546108a5906111ba565b60003381610a158286610aa9565b905083811015610a755760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106a8565b6109948286868403610b77565b600033610954818585610d15565b60405163c1b84b2f60e01b815260040160405180910390fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614610b175750600061095a565b5090919050565b600260055403610b705760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b6002600555565b6001600160a01b038316610bd95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106a8565b6001600160a01b038216610c3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106a8565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610ca78484610aa9565b90506000198114610d0f5781811015610d025760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106a8565b610d0f8484848403610b77565b50505050565b6001600160a01b038316610d795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106a8565b6001600160a01b038216610ddb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106a8565b6001600160a01b03831660009081526020819052604090205481811015610e535760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106a8565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610d0f565b80356001600160a01b0381168114610ed057600080fd5b919050565b600080600080600060808688031215610eed57600080fd5b8535945060208601359350610f0460408701610eb9565b9250606086013567ffffffffffffffff80821115610f2157600080fd5b818801915088601f830112610f3557600080fd5b813581811115610f4457600080fd5b896020828501011115610f5657600080fd5b9699959850939650602001949392505050565b600060208083528351808285015260005b81811015610f9657858101830151858201604001528201610f7a565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060408385031215610fca57600080fd5b610fd383610eb9565b946020939093013593505050565b60008060008060808587031215610ff757600080fd5b61100085610eb9565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b8181101561105257835183529284019291840191600101611036565b50909695505050505050565b60008060006060848603121561107357600080fd5b61107c84610eb9565b925061108a60208501610eb9565b9150604084013590509250925092565b6000602082840312156110ac57600080fd5b6110b582610eb9565b9392505050565b6000806000606084860312156110d157600080fd5b6110da84610eb9565b95602085013595506040909401359392505050565b6000806040838503121561110257600080fd5b61110b83610eb9565b915061111960208401610eb9565b90509250929050565b801515811461113057600080fd5b50565b60008060006060848603121561114857600080fd5b61115184610eb9565b925061115f60208501610eb9565b9150604084013561116f81611122565b809150509250925092565b6000806040838503121561118d57600080fd5b8235915061111960208401610eb9565b6000602082840312156111af57600080fd5b81516110b581611122565b600181811c908216806111ce57607f821691505b6020821081036111ee57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561095a57634e487b7160e01b600052601160045260246000fdfea264697066735822122047d51af08be14e1b3acae6ea0d0ffdf85e1aa88ba5ec411320e64d371ac9ba7864736f6c63430008130033000000000000000000000000de7917e632f3f7dc3555f3f82e9bda746e62b024

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061021c5760003560e01c80636a62784211610125578063bc25cf77116100ad578063e4bbb5a81161007c578063e4bbb5a81461056e578063f140a35a1461057c578063fcd4cf601461058f578063fd84b53b146105b6578063fff6cae9146105dd57600080fd5b8063bc25cf7714610519578063d21220a71461052c578063d294f09314610553578063dd62ed3e1461055b57600080fd5b80639d63848a116100f45780639d63848a146104875780639e8cc04b146104e5578063a1ac4d13146103d2578063a457c2d7146104f3578063a9059cbb1461050657600080fd5b80636a6278421461041b57806370a082311461042e57806389afcb441461045757806395d89b411461047f57600080fd5b806323b872dd116101a8578063443cb4bc11610177578063443cb4bc146103cb5780634d5a9f8a146103d25780635881c475146103e65780635a76f25e146103cb5780635b11e758146103f457600080fd5b806323b872dd14610312578063313ce56714610325578063392f37e91461033457806339509351146103b857600080fd5b80630dfe1681116101ef5780630dfe16811461029a57806313345fe1146102d957806318160ddd146102f95780631df8c7171461025457806322be3de11461030b57600080fd5b8063022c0d9f1461022157806306fdde03146102365780630902f1ac14610254578063095ea7b314610277575b600080fd5b61023461022f366004610ed5565b6105e5565b005b61023e610896565b60405161024b9190610f69565b60405180910390f35b61025c610928565b6040805193845260208401929092529082015260600161024b565b61028a610285366004610fb7565b610946565b604051901515815260200161024b565b6102c17f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab272781565b6040516001600160a01b03909116815260200161024b565b6102ec6102e7366004610fe1565b610960565b60405161024b919061101a565b6002545b60405190815260200161024b565b600161028a565b61028a61032036600461105e565b61097b565b6040516012815260200161024b565b604080516012808252602082015260009181018290526060810191909152600160808201526001600160a01b037f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab2727811660a08301527f000000000000000000000000e1da44c0da55b075ae8e2e4b6986adc76ac77d731660c082015260e00161024b565b61028a6103c6366004610fb7565b61099f565b60006102fd565b6102fd6103e036600461109a565b50600090565b6102ec6102e73660046110bc565b6102c17f000000000000000000000000de7917e632f3f7dc3555f3f82e9bda746e62b02481565b6102fd61042936600461109a565b6109c1565b6102fd61043c36600461109a565b6001600160a01b031660009081526020819052604090205490565b61046a61046536600461109a565b6109dc565b6040805192835260208301919091520161024b565b61023e6109f8565b604080516001600160a01b037f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab2727811682527f000000000000000000000000e1da44c0da55b075ae8e2e4b6986adc76ac77d731660208201520161024b565b6102fd6104293660046110bc565b61028a610501366004610fb7565b610a07565b61028a610514366004610fb7565b610a82565b61023461052736600461109a565b610a90565b6102c17f000000000000000000000000e1da44c0da55b075ae8e2e4b6986adc76ac77d7381565b61046a6109dc565b6102fd6105693660046110ef565b610aa9565b610234610527366004611133565b6102fd61058a36600461117a565b610ad4565b6102c17f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab272781565b6102c17f000000000000000000000000e1da44c0da55b075ae8e2e4b6986adc76ac77d7381565b61028a6109c1565b6105ed610b1e565b60007f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab27276001600160a01b03167f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab27276001600160a01b03161461064e5784610650565b855b9050600081116106b15760405162461bcd60e51b815260206004820152602160248201527f53696e6b436f6e7665727465723a206e6f7468696e6720746f20636f6e7665726044820152601d60fa1b60648201526084015b60405180910390fd5b6040516318a6c3fd60e21b8152600481018290527f000000000000000000000000de7917e632f3f7dc3555f3f82e9bda746e62b0246001600160a01b03169063629b0ff490602401600060405180830381600087803b15801561071357600080fd5b505af1158015610727573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018590527f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab272716925063a9059cbb91506044016020604051808303816000875af115801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be919061119d565b506000807f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab27276001600160a01b03167f000000000000000000000000b6a075e9cf5dba476994b63b60217a5cf9ab27276001600160a01b03161461082357826000610827565b6000835b60408051838152602081018390528082018c9052606081018b905290519294509092506001600160a01b0388169133917fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b919081900360800190a350505061088f6001600555565b5050505050565b6060600380546108a5906111ba565b80601f01602080910402602001604051908101604052809291908181526020018280546108d1906111ba565b801561091e5780601f106108f35761010080835404028352916020019161091e565b820191906000526020600020905b81548152906001019060200180831161090157829003601f168201915b5050505050905090565b600080600060405163c1b84b2f60e01b815260040160405180910390fd5b600033610954818585610b77565b60019150505b92915050565b606060405163c1b84b2f60e01b815260040160405180910390fd5b600033610989858285610c9b565b610994858585610d15565b506001949350505050565b6000336109548185856109b28383610aa9565b6109bc91906111f4565b610b77565b600060405163c1b84b2f60e01b815260040160405180910390fd5b60008060405163c1b84b2f60e01b815260040160405180910390fd5b6060600480546108a5906111ba565b60003381610a158286610aa9565b905083811015610a755760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106a8565b6109948286868403610b77565b600033610954818585610d15565b60405163c1b84b2f60e01b815260040160405180910390fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f000000000000000000000000e1da44c0da55b075ae8e2e4b6986adc76ac77d736001600160a01b0316826001600160a01b031614610b175750600061095a565b5090919050565b600260055403610b705760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a8565b6002600555565b6001600160a01b038316610bd95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106a8565b6001600160a01b038216610c3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106a8565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610ca78484610aa9565b90506000198114610d0f5781811015610d025760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106a8565b610d0f8484848403610b77565b50505050565b6001600160a01b038316610d795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106a8565b6001600160a01b038216610ddb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106a8565b6001600160a01b03831660009081526020819052604090205481811015610e535760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106a8565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610d0f565b80356001600160a01b0381168114610ed057600080fd5b919050565b600080600080600060808688031215610eed57600080fd5b8535945060208601359350610f0460408701610eb9565b9250606086013567ffffffffffffffff80821115610f2157600080fd5b818801915088601f830112610f3557600080fd5b813581811115610f4457600080fd5b896020828501011115610f5657600080fd5b9699959850939650602001949392505050565b600060208083528351808285015260005b81811015610f9657858101830151858201604001528201610f7a565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060408385031215610fca57600080fd5b610fd383610eb9565b946020939093013593505050565b60008060008060808587031215610ff757600080fd5b61100085610eb9565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b8181101561105257835183529284019291840191600101611036565b50909695505050505050565b60008060006060848603121561107357600080fd5b61107c84610eb9565b925061108a60208501610eb9565b9150604084013590509250925092565b6000602082840312156110ac57600080fd5b6110b582610eb9565b9392505050565b6000806000606084860312156110d157600080fd5b6110da84610eb9565b95602085013595506040909401359392505050565b6000806040838503121561110257600080fd5b61110b83610eb9565b915061111960208401610eb9565b90509250929050565b801515811461113057600080fd5b50565b60008060006060848603121561114857600080fd5b61115184610eb9565b925061115f60208501610eb9565b9150604084013561116f81611122565b809150509250925092565b6000806040838503121561118d57600080fd5b8235915061111960208401610eb9565b6000602082840312156111af57600080fd5b81516110b581611122565b600181811c908216806111ce57607f821691505b6020821081036111ee57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561095a57634e487b7160e01b600052601160045260246000fdfea264697066735822122047d51af08be14e1b3acae6ea0d0ffdf85e1aa88ba5ec411320e64d371ac9ba7864736f6c63430008130033