Source Code
Overview
FRAX Balance | FXTL Balance
0 FRAX | 0 FXTL
FRAX Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
XToken
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 800 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "./ProtocolWhitelist.sol";
import "../interfaces/IVotingEscrow.sol";
import "../interfaces/IVoter.sol";
import "../v2/interfaces/IClPool.sol";
import "../interfaces/IXToken.sol";
interface IProtocolWhitelist {
function syncAndCheckIsWhitelisted(address sender) external returns (bool);
}
library TickMath {
int24 internal constant MIN_TICK = -887272;
int24 internal constant MAX_TICK = -MIN_TICK;
function getSqrtRatioAtTick(
int24 tick
) internal pure returns (uint160 sqrtPriceX96) {
uint256 absTick = tick < 0
? uint256(-int256(tick))
: uint256(int256(tick));
require(absTick <= uint256(uint24(MAX_TICK)), "T");
uint256 ratio = absTick & 0x1 != 0
? 0xfffcb933bd6fad37aa2d162d1a594001
: 0x100000000000000000000000000000000;
if (absTick & 0x2 != 0)
ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
if (absTick & 0x4 != 0)
ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
if (absTick & 0x8 != 0)
ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
if (absTick & 0x10 != 0)
ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
if (absTick & 0x20 != 0)
ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
if (absTick & 0x40 != 0)
ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
if (absTick & 0x80 != 0)
ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
if (absTick & 0x100 != 0)
ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
if (absTick & 0x200 != 0)
ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
if (absTick & 0x400 != 0)
ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
if (absTick & 0x800 != 0)
ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
if (absTick & 0x1000 != 0)
ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
if (absTick & 0x2000 != 0)
ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
if (absTick & 0x4000 != 0)
ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
if (absTick & 0x8000 != 0)
ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
if (absTick & 0x10000 != 0)
ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
if (absTick & 0x20000 != 0)
ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
if (absTick & 0x40000 != 0)
ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
if (absTick & 0x80000 != 0)
ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
if (tick > 0) ratio = type(uint256).max / ratio;
sqrtPriceX96 = uint160(
(ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)
);
}
}
contract XToken is ERC20Upgradeable, IXToken {
// constants and immutables
uint256 public constant PRECISION = 100;
uint256 public constant MAXTIME = 4 * 365 days;
uint32 public duration;
address public emissionsToken;
address public votingEscrow;
address public voter;
// addresses
address public timelock;
address public multisig;
address public whitelistOperator;
address public _pool;
address public outToken;
mapping(address => bool) public isWhitelisted;
///@dev ratio of earned emissionsToken via exit penalty. 50% means they earn 50% of the emissionsToken value
uint256 public exitRatio;
uint256 public veExitRatio;
uint256 public minVest; /// @notice the initial minimum vesting period is 7 days (one week)
uint256 public veMaxVest; /// @notice the initial maximum vesting period for vote escrowed exits is 30 days (1 month)
uint256 public maxVest; /// @notice the initial maximum vesting period is 90 days (3 months)
struct VestPosition {
uint256 amount; // amount of xTokens
uint256 start; // start unix timestamp
uint256 maxEnd; // start + maxVest (end timestamp)
uint256 vestID; // vest identifier (starting from 0)
}
mapping(address user => VestPosition[]) public vestInfo;
// Partner/Modular whitelists
address public protocolWhitelist;
bool public optionEnabled;
bool public paused;
modifier onlyTimelock() {
require(msg.sender == timelock, "xToken: !Auth");
_;
}
modifier onlyWhitelistOperator() {
require(
msg.sender == whitelistOperator,
"xToken: Only the whitelisting operator can call this function"
);
_;
}
modifier whenNotPaused() {
require(!paused, "P");
_;
}
constructor() {
_disableInitializers();
}
function initialize(
address _emissionsToken,
address _votingEscrow,
address _voter,
address _timelock,
address _multisig,
address _whitelistOperator,
address _protocolWhitelist
) external initializer {
__ERC20_init(
"Escrowed RA",
"xRA"
);
// set addresses
emissionsToken = _emissionsToken;
votingEscrow = _votingEscrow;
voter = _voter;
timelock = _timelock;
multisig = _multisig;
whitelistOperator = _whitelistOperator;
protocolWhitelist = _protocolWhitelist;
// set initial parameters
exitRatio = 50; // 50%
veExitRatio = 100; // 100%
minVest = 14 days; /// @notice the initial minimum vesting period is 14 days (two weeks)
veMaxVest = 30 days; /// @notice the initial maximum vesting period for vote escrowed exits is 30 days (1 month)
maxVest = 120 days; /// @notice the initial maximum vesting period is 120 days (4 months)
// approve emissionsToken to ve
IERC20Upgradeable(emissionsToken).approve(
votingEscrow,
type(uint256).max
);
// whitelist address(0), for minting
_updateWhitelist(address(0), true);
// whitelist self, voter, and multisig
_updateWhitelist(address(this), true);
_updateWhitelist(address(voter), true);
_updateWhitelist(multisig, true);
}
/*****************************************************************/
// ERC20 Overrides
/*****************************************************************/
function _beforeTokenTransfer(
address from,
address to,
uint256 //amount
) internal override whenNotPaused {
if (to != address(0)) {
require(syncAndCheckIsWhitelisted(from), "xToken: !WL");
}
}
/*****************************************************************/
// General use functions
/*****************************************************************/
///@dev mints xTokens for each emissionsToken.
function convertEmissionsToken(uint256 _amount) external whenNotPaused {
// restricted to whitelisted contracts
// to prevent users from minting xTokens and can't convert back without penalty
require(syncAndCheckIsWhitelisted(msg.sender), "xToken: !AUTH");
require(_amount > 0, "xToken: ! > 0");
IERC20Upgradeable(emissionsToken).transferFrom(
msg.sender,
address(this),
_amount
);
_mint(msg.sender, _amount);
emit Converted(msg.sender, _amount);
}
///@dev convert xTokens to ve at veExitRatio (new veNFT form)
function xTokenConvertToNft(
uint256 _amount
) external whenNotPaused returns (uint256 veTokenId) {
require(_amount > 0, "xToken: ! > 0");
_burn(msg.sender, _amount);
uint256 _adjustedAmount = ((veExitRatio * _amount) / PRECISION);
_mint(multisig, (_amount - _adjustedAmount));
veTokenId = IVotingEscrow(votingEscrow).createLockFor(
_adjustedAmount,
MAXTIME,
msg.sender
);
emit XTokensRedeemed(msg.sender, _amount);
return veTokenId;
}
///@dev convert xTokens to ve at a 1:1 ratio (increase existing veNFT)
function xTokenIncreaseNft(
uint256 _amount,
uint256 _tokenID
) external whenNotPaused {
require(_amount > 0, "xToken: ! > 0");
_burn(msg.sender, _amount);
// ensure the msg.sender is approved to modify the ve
require(
IVotingEscrow(votingEscrow).isApprovedOrOwner(msg.sender, _tokenID),
"xToken: ve not approved"
);
// ensure the xToken contract is approved to increase the amount of this ve
// this is to ensure extending lock time will work
require(
IVotingEscrow(votingEscrow).isApprovedOrOwner(
address(this),
_tokenID
),
"xToken: ve not approved"
);
uint256 _adjustedAmount = ((veExitRatio * _amount) / PRECISION);
// mint the exit penalty to the multisig
_mint(multisig, (_amount - _adjustedAmount));
// ensures that the ve is 4 year locked
uint256 maxUnlock = ((block.timestamp + MAXTIME) / 1 weeks) * 1 weeks;
(, uint256 unlockTime) = IVotingEscrow(votingEscrow).locked(_tokenID);
if (maxUnlock > unlockTime) {
IVotingEscrow(votingEscrow).increaseUnlockTime(_tokenID, MAXTIME);
}
IVotingEscrow(votingEscrow).increaseAmount(_tokenID, _adjustedAmount);
emit XTokensRedeemed(msg.sender, _amount);
}
/**
* @dev exit instantly with a penalty
* @param _amount amount of xTokens to exit
* @param maxPayAmount maximum amount of collateral user is willing to pay
*/
function instantExit(
uint256 _amount,
uint256 maxPayAmount
) external whenNotPaused {
require(_amount > 0, "xToken: ! > 0");
uint256 exitAmount = ((exitRatio * _amount) / PRECISION);
_burn(msg.sender, _amount);
if (optionEnabled) {
uint256 amountToPay = (_amount * (100 - exitRatio)) / 100;
amountToPay = quotePrice(amountToPay);
require(amountToPay <= maxPayAmount, "SLIPPAGE");
IERC20Upgradeable(outToken).transferFrom(
msg.sender,
multisig,
amountToPay
);
exitAmount = _amount;
} else {
// mint the exit penalty to the multisig
uint256 haircut = _amount - exitAmount;
_mint(multisig, haircut);
}
IERC20Upgradeable(emissionsToken).transfer(msg.sender, exitAmount);
emit InstantExit(msg.sender, _amount);
}
///@dev vesting xTokens --> emissionToken functionality
function createVest(uint256 _amount) external {
require(_amount > 0, "xToken: ! > 0");
_burn(msg.sender, _amount);
uint256 vestLength = vestInfo[msg.sender].length;
vestInfo[msg.sender].push(
VestPosition(
_amount,
block.timestamp,
block.timestamp + maxVest,
vestLength
)
);
emit NewVest(msg.sender, vestLength, _amount);
}
///@dev handles all situations regarding exiting vests
function exitVest(
uint256 _vestID,
bool _ve
) external whenNotPaused returns (bool) {
uint256 vestCount = vestInfo[msg.sender].length;
require(
vestCount != 0 && _vestID <= vestCount - 1,
"xToken: Vest !exist"
);
VestPosition storage _vest = vestInfo[msg.sender][_vestID];
require(
_vest.amount != 0 && _vest.vestID == _vestID,
"xToken: Vest !active"
);
uint256 _amount = _vest.amount;
uint256 _start = _vest.start;
_vest.amount = 0;
// case: vest has not crossed the minimum vesting threshold
if (block.timestamp < _start + minVest) {
_mint(msg.sender, _amount);
emit CancelVesting(msg.sender, _vestID, _amount);
return true;
}
///@dev if it is not a ve exit
if (!_ve) {
// case: vest is complete
if (_vest.maxEnd <= block.timestamp) {
IERC20Upgradeable(emissionsToken).transfer(msg.sender, _amount);
emit ExitVesting(msg.sender, _vestID, _amount);
return true;
}
// case: vest is in progress
else {
uint256 base = (_amount * exitRatio) / PRECISION;
uint256 vestEarned = ((_amount *
(PRECISION - exitRatio) *
(block.timestamp - _start)) / maxVest) / PRECISION;
uint256 exitedAmount = base + vestEarned;
_mint(multisig, (_amount - exitedAmount));
IERC20Upgradeable(emissionsToken).transfer(
msg.sender,
exitedAmount
);
emit ExitVesting(msg.sender, _vestID, _amount);
return true;
}
}
// exit to ve
else {
uint256 veMaxEnd = _start + veMaxVest;
// case: vest is complete for vote escrow threshold
if (veMaxEnd <= block.timestamp) {
IVotingEscrow(votingEscrow).createLockFor(
_amount,
MAXTIME,
msg.sender
);
emit ExitVesting(msg.sender, _vestID, _amount);
return true;
}
// case: vest is in progress for vote escrow exit
else {
uint256 base = (_amount * veExitRatio) / PRECISION;
uint256 vestEarned = ((_amount *
(PRECISION - veExitRatio) *
(block.timestamp - _start)) / veMaxVest) / PRECISION;
uint256 exitedAmount = base + vestEarned;
_mint(multisig, (_amount - exitedAmount));
IVotingEscrow(votingEscrow).createLockFor(
exitedAmount,
MAXTIME,
msg.sender
);
emit ExitVesting(msg.sender, _vestID, _amount);
return true;
}
}
}
/*****************************************************************/
// Permissioned functions, timelock/operator gated
/*****************************************************************/
///@dev allows the multisig to redeem collected xTokens
function multisigRedeem(uint256 _amount) external {
require(msg.sender == multisig, "xToken: !AUTH");
_burn(msg.sender, _amount);
IERC20Upgradeable(emissionsToken).transfer(msg.sender, _amount);
}
///@dev timelock only: alter the parameters for exiting
function alterExitRatios(
uint256 _newExitRatio,
uint256 _newVeExitRatio
) external onlyTimelock {
exitRatio = _newExitRatio;
veExitRatio = _newVeExitRatio;
emit NewExitRatios(_newExitRatio, _newVeExitRatio);
}
///@dev allows the timelock to rescue any trapped tokens
function rescueTrappedTokens(
address[] calldata _tokens,
uint256[] calldata _amounts
) external onlyTimelock {
for (uint256 i = 0; i < _tokens.length; ++i) {
IERC20Upgradeable(_tokens[i]).transfer(multisig, _amounts[i]);
}
}
///@dev change the minimum and maximum vest durations
function reinitializeVestingParameters(
uint256 _min,
uint256 _max,
uint256 _veMax
) external onlyTimelock {
(minVest, maxVest, veMaxVest) = (_min, _max, _veMax);
emit NewVestingTimes(_min, _max, _veMax);
}
///@dev change minimum vesting parameter
function changeMinimumVestingLength(
uint256 _minVest
) external onlyTimelock {
minVest = _minVest;
emit NewVestingTimes(_minVest, maxVest, veMaxVest);
}
///@dev change maximum vesting parameter
function changeMaximumVestingLength(
uint256 _maxVest
) external onlyTimelock {
maxVest = _maxVest;
emit NewVestingTimes(minVest, _maxVest, veMaxVest);
}
///@dev change vote escrow maximum vesting parameter
function changeVeMaximumVestingLength(
uint256 _veMax
) external onlyTimelock {
veMaxVest = _veMax;
emit NewVestingTimes(minVest, maxVest, _veMax);
}
///@dev migrates the timelock to another contract
function migrateTimelock(address _timelock) external onlyTimelock {
timelock = _timelock;
}
///@dev migrates the multisig to another contract
function migrateMultisig(address _multisig) external onlyTimelock {
multisig = _multisig;
}
///@dev migrates L2 whitelist
function migrateProtocolWhitelist(
address _protocolWhitelist
) external onlyWhitelistOperator {
protocolWhitelist = _protocolWhitelist;
}
///@dev only callable by the whitelistOperator contract
function adjustWhitelist(
address[] calldata _candidates,
bool[] calldata _status
) external onlyWhitelistOperator {
for (uint256 i = 0; i < _candidates.length; ++i) {
_updateWhitelist(_candidates[i], _status[i]);
}
}
///@notice allows the whitelist operator to add an address to the xToken whitelist
function addWhitelist(address _whitelistee) external onlyWhitelistOperator {
_updateWhitelist(_whitelistee, true);
}
///@notice allows the whitelist operator to remove an address from the xToken whitelist
function removeWhitelist(
address _whitelistee
) external onlyWhitelistOperator {
_updateWhitelist(_whitelistee, false);
}
function _updateWhitelist(address _whitelistee, bool _status) internal {
isWhitelisted[_whitelistee] = _status;
emit WhitelistStatus(_whitelistee, _status);
}
///@dev timelock can change the operator contract
function changeWhitelistOperator(
address _newOperator
) external onlyTimelock {
whitelistOperator = _newOperator;
}
function setOptionsEnabled(bool isEnabled) external {
require(msg.sender == multisig, "!MSIG");
optionEnabled = isEnabled;
}
function setPool(address newPool) external {
require(msg.sender == multisig, "!MSIG");
_pool = newPool;
address token0 = IClPool(_pool).token0();
outToken = token0 == address(emissionsToken)
? IClPool(_pool).token1()
: token0;
}
/// @notice set twap interval, 3600 for 1 hour twap
function setSecondsAgo(uint32 _duration) external {
require(msg.sender == multisig, "!MSIG");
duration = _duration;
}
function setPaused(bool _paused) external {
require(msg.sender == multisig, "!MSIG");
paused = _paused;
}
/*****************************************************************/
// Getter functions
/*****************************************************************/
///@dev return the amount of emissionsToken within the contract
function getBalanceResiding() public view returns (uint256) {
return IERC20Upgradeable(emissionsToken).balanceOf(address(this));
}
/// @notice Potentially writes new whitelsited pools to storage then return if an address is whitelisted to transfer xTokens
/// @param _address The address of the sender
function syncAndCheckIsWhitelisted(address _address) public returns (bool) {
if (isWhitelisted[_address]) {
return true;
}
// automatically whitelist gauges
if (IVoter(voter).isGauge(_address)) {
_updateWhitelist(_address, true);
return true;
}
// automatically whitelist L2 addresses
if (
IProtocolWhitelist(protocolWhitelist).syncAndCheckIsWhitelisted(
_address
)
) {
_updateWhitelist(_address, true);
return true;
}
return false;
}
///@dev returns the total number of individual vests the user has
function usersTotalVests(address _user) public view returns (uint256) {
return vestInfo[_user].length;
}
function quotePayment(
uint256 amount
) public view returns (uint256 payAmount) {
uint256 amountToPay = (amount * (100 - exitRatio)) / 100;
payAmount = quotePrice(amountToPay);
}
function quotePrice(
uint256 amountIn
) public view returns (uint256 amountOut) {
uint32[] memory secondsAgos = new uint32[](2);
secondsAgos[0] = duration;
secondsAgos[1] = 0;
(int56[] memory tickCumulatives, ) = IClPool(_pool).observe(
secondsAgos
);
int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];
int24 tick = int24(tickCumulativesDelta / int56(int32(duration)));
if (
tickCumulativesDelta < 0 &&
(tickCumulativesDelta % int56(int32(duration)) != 0)
) {
tick--;
}
uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);
if (sqrtRatioX96 <= type(uint128).max) {
uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96;
amountOut = address(emissionsToken) < outToken
? Math.mulDiv(ratioX192, amountIn, 1 << 192)
: Math.mulDiv(1 << 192, amountIn, ratioX192);
} else {
uint256 ratioX128 = Math.mulDiv(
sqrtRatioX96,
sqrtRatioX96,
1 << 64
);
amountOut = address(emissionsToken) < outToken
? Math.mulDiv(ratioX128, amountIn, 1 << 128)
: Math.mulDiv(1 << 128, amountIn, ratioX128);
}
}
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20Upgradeable.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
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.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_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 {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @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);
}// 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 IERC20Upgradeable {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity =0.7.6 || ^0.8.13;
pragma abicoder v2;
interface IVoter {
function _ve() external view returns (address);
function governor() external view returns (address);
function emergencyCouncil() external view returns (address);
function emitDeposit(address account, uint256 amount) external;
function emitWithdraw(address account, uint256 amount) external;
function isWhitelisted(address token) external view returns (bool);
function notifyRewardAmount(uint256 amount) external;
function distribute(address _gauge) external;
function gauges(address pool) external view returns (address);
function feeDistributors(address gauge) external view returns (address);
function gaugefactory() external view returns (address);
function feeDistributorFactory() external view returns (address);
function minter() external view returns (address);
function factory() external view returns (address);
function length() external view returns (uint256);
function pools(uint256) external view returns (address);
function isAlive(address) external view returns (bool);
function setXRatio(uint256 _xRatio) external;
function setGaugeXRatio(
address[] calldata _gauges,
uint256[] calldata _xRaRatios
) external;
function resetGaugeXRatio(address[] calldata _gauges) external;
function whitelist(address _token) external;
function forbid(address _token, bool _status) external;
function whitelistOperator() external view returns (address);
function gaugeXRatio(address gauge) external view returns (uint256);
function isGauge(address gauge) external view returns (bool);
function killGauge(address _gauge) external;
function reviveGauge(address _gauge) external;
function whitelistGaugeReward(address _gauge, address _reward) external;
function removeGaugeReward(address _gauge, address _reward) external;
}// SPDX-License-Identifier: MIT
pragma solidity =0.7.6 || ^0.8.13;
pragma abicoder v2;
interface IVotingEscrow {
struct Point {
int128 bias;
int128 slope; // # -dweight / dt
uint256 ts;
uint256 blk; // block
}
struct LockedBalance {
int128 amount;
uint256 end;
}
function emissionsToken() external view returns (address);
function team() external returns (address);
function epoch() external view returns (uint256);
function pointHistory(uint256 loc) external view returns (Point memory);
function userPointHistory(
uint256 tokenId,
uint256 loc
) external view returns (Point memory);
function userPointEpoch(uint256 tokenId) external view returns (uint256);
function ownerOf(uint256) external view returns (address);
function isApprovedOrOwner(address, uint256) external view returns (bool);
function transferFrom(address, address, uint256) external;
function voting(uint256 tokenId) external;
function abstain(uint256 tokenId) external;
function checkpoint() external;
function depositFor(uint256 tokenId, uint256 value) external;
function createLockFor(
uint256,
uint256,
address
) external returns (uint256);
function balanceOfNFT(uint256) external view returns (uint256);
function balanceOfNFTAt(uint256, uint256) external view returns (uint256);
function totalSupply() external view returns (uint256);
function locked__end(uint256) external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function tokenOfOwnerByIndex(
address,
uint256
) external view returns (uint256);
function increaseUnlockTime(uint256 tokenID, uint256 duration) external;
function locked(
uint256 tokenID
) external view returns (uint256 amount, uint256 unlockTime);
function increaseAmount(uint256 _tokenId, uint256 _value) external;
function isDelegate(
address _operator,
uint256 _tokenId
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
interface IXToken {
event CancelVesting(
address indexed user,
uint256 indexed vestId,
uint256 amount
);
event ExitVesting(
address indexed user,
uint256 indexed vestId,
uint256 amount
);
event InstantExit(address indexed user, uint256);
event NewExitRatios(uint256 exitRatio, uint256 veExitRatio);
event NewVest(
address indexed user,
uint256 indexed vestId,
uint256 indexed amount
);
event NewVestingTimes(uint256 min, uint256 max, uint256 veMaxVest);
event Converted(address indexed user, uint256);
event WhitelistStatus(address indexed candidate, bool status);
event XTokensRedeemed(address indexed user, uint256);
function MAXTIME() external view returns (uint256);
function PRECISION() external view returns (uint256);
function addWhitelist(address _whitelistee) external;
function adjustWhitelist(
address[] memory _candidates,
bool[] memory _status
) external;
function alterExitRatios(
uint256 _newExitRatio,
uint256 _newVeExitRatio
) external;
function changeMaximumVestingLength(uint256 _maxVest) external;
function changeMinimumVestingLength(uint256 _minVest) external;
function changeVeMaximumVestingLength(uint256 _veMax) external;
function changeWhitelistOperator(address _newOperator) external;
function convertEmissionsToken(uint256 _amount) external;
function createVest(uint256 _amount) external;
function protocolWhitelist() external view returns (address);
function exitRatio() external view returns (uint256);
function exitVest(uint256 _vestID, bool _ve) external returns (bool);
function getBalanceResiding() external view returns (uint256);
function initialize(
address _emissionsToken,
address _votingEscrow,
address _voter,
address _timelock,
address _multisig,
address _whitelistOperator,
address _enneadWhitelist
) external;
function instantExit(uint256 _amount, uint256 maxPayAmount) external;
function isWhitelisted(address) external view returns (bool);
function maxVest() external view returns (uint256);
function migrateProtocolWhitelist(address _enneadWhitelist) external;
function migrateMultisig(address _multisig) external;
function migrateTimelock(address _timelock) external;
function minVest() external view returns (uint256);
function multisig() external view returns (address);
function multisigRedeem(uint256 _amount) external;
function emissionsToken() external view returns (address);
function reinitializeVestingParameters(
uint256 _min,
uint256 _max,
uint256 _veMax
) external;
function removeWhitelist(address _whitelistee) external;
function rescueTrappedTokens(
address[] memory _tokens,
uint256[] memory _amounts
) external;
function syncAndCheckIsWhitelisted(
address _address
) external returns (bool);
function timelock() external view returns (address);
function usersTotalVests(address _user) external view returns (uint256);
function veExitRatio() external view returns (uint256);
function veMaxVest() external view returns (uint256);
function votingEscrow() external view returns (address);
function vestInfo(
address user,
uint256
)
external
view
returns (uint256 amount, uint256 start, uint256 maxEnd, uint256 vestID);
function voter() external view returns (address);
function whitelistOperator() external view returns (address);
function xTokenConvertToNft(
uint256 _amount
) external returns (uint256 veRaTokenId);
function xTokenIncreaseNft(uint256 _amount, uint256 _tokenID) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import "./pool/IClPoolImmutables.sol";
import "./pool/IClPoolState.sol";
import "./pool/IClPoolDerivedState.sol";
import "./pool/IClPoolActions.sol";
import "./pool/IClPoolOwnerActions.sol";
import "./pool/IClPoolEvents.sol";
/// @title The interface for a CL V2 Pool
/// @notice A CL pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IClPool is
IClPoolImmutables,
IClPoolState,
IClPoolDerivedState,
IClPoolActions,
IClPoolOwnerActions,
IClPoolEvents
{
/// @notice Initializes a pool with parameters provided
function initialize(
address _factory,
address _nfpManager,
address _token0,
address _token1,
uint24 _fee,
int24 _tickSpacing
) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IClPoolActions {
/// @notice Sets the initial price for the pool
/// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
/// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
function initialize(uint160 sqrtPriceX96) external;
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position at index 0
/// @dev The caller of this method receives a callback in the form of IRamsesV2MintCallback#ramsesV2MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLower, tickUpper, the amount of liquidity, and the current price.
/// @param recipient The address for which the liquidity will be created
/// @param tickLower The lower tick of the position in which to add liquidity
/// @param tickUpper The upper tick of the position in which to add liquidity
/// @param amount The amount of liquidity to mint
/// @param data Any data that should be passed through to the callback
/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IRamsesV2MintCallback#ramsesV2MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLower, tickUpper, the amount of liquidity, and the current price.
/// @param recipient The address for which the liquidity will be created
/// @param index The index for which the liquidity will be created
/// @param tickLower The lower tick of the position in which to add liquidity
/// @param tickUpper The upper tick of the position in which to add liquidity
/// @param amount The amount of liquidity to mint
/// @param data Any data that should be passed through to the callback
/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
function mint(
address recipient,
uint256 index,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
/// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
/// @param recipient The address which should receive the fees collected
/// @param tickLower The lower tick of the position for which to collect fees
/// @param tickUpper The upper tick of the position for which to collect fees
/// @param amount0Requested How much token0 should be withdrawn from the fees owed
/// @param amount1Requested How much token1 should be withdrawn from the fees owed
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
/// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
/// @param recipient The address which should receive the fees collected
/// @param index The index of the position to be collected
/// @param tickLower The lower tick of the position for which to collect fees
/// @param tickUpper The upper tick of the position for which to collect fees
/// @param amount0Requested How much token0 should be withdrawn from the fees owed
/// @param amount1Requested How much token1 should be withdrawn from the fees owed
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(
address recipient,
uint256 index,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
/// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position at index 0
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param tickLower The lower tick of the position for which to burn liquidity
/// @param tickUpper The upper tick of the position for which to burn liquidity
/// @param amount How much liquidity to burn
/// @return amount0 The amount of token0 sent to the recipient
/// @return amount1 The amount of token1 sent to the recipient
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
/// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param index The index for which the liquidity will be burned
/// @param tickLower The lower tick of the position for which to burn liquidity
/// @param tickUpper The upper tick of the position for which to burn liquidity
/// @param amount How much liquidity to burn
/// @return amount0 The amount of token0 sent to the recipient
/// @return amount1 The amount of token1 sent to the recipient
function burn(
uint256 index,
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
/// @notice Swap token0 for token1, or token1 for token0
/// @dev The caller of this method receives a callback in the form of IRamsesV2SwapCallback#ramsesV2SwapCallback
/// @param recipient The address to receive the output of the swap
/// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
/// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
/// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
/// value after the swap. If one for zero, the price cannot be greater than this value after the swap
/// @param data Any data to be passed through to the callback
/// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
/// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
/// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
/// @dev The caller of this method receives a callback in the form of IRamsesV2FlashCallback#ramsesV2FlashCallback
/// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
/// with 0 amount{0,1} and sending the donation amount(s) from the callback
/// @param recipient The address which will receive the token0 and token1 amounts
/// @param amount0 The amount of token0 to send
/// @param amount1 The amount of token1 to send
/// @param data Any data to be passed through to the callback
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
/// @notice Increase the maximum number of price and liquidity observations that this pool will store
/// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
/// the input observationCardinalityNext.
/// @param observationCardinalityNext The desired minimum number of observations for the pool to store
function increaseObservationCardinalityNext(
uint16 observationCardinalityNext
) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IClPoolDerivedState {
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
/// you must call it with secondsAgos = [3600, 0].
/// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
/// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block timestamp
function observe(
uint32[] calldata secondsAgos
)
external
view
returns (
int56[] memory tickCumulatives,
uint160[] memory secondsPerLiquidityCumulativeX128s
);
/// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
/// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
/// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
/// snapshot is taken and the second snapshot is taken. Boosted data is only valid if it's within the same period
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range
/// @return tickCumulativeInside The snapshot of the tick accumulator for the range
/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
function snapshotCumulativesInside(
int24 tickLower,
int24 tickUpper
)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
/// @notice Returns the seconds per liquidity and seconds inside a tick range for a period
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range
/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
function periodCumulativesInside(
uint32 period,
int24 tickLower,
int24 tickUpper
) external view returns (uint160 secondsPerLiquidityInsideX128);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IClPoolEvents {
/// @notice Emitted exactly once by a pool when #initialize is first called on the pool
/// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
/// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
/// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
event Initialize(uint160 sqrtPriceX96, int24 tick);
/// @notice Emitted when liquidity is minted for a given position
/// @param sender The address that minted the liquidity
/// @param owner The owner of the position and recipient of any minted liquidity
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity minted to the position range
/// @param amount0 How much token0 was required for the minted liquidity
/// @param amount1 How much token1 was required for the minted liquidity
event Mint(
address sender,
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted when fees are collected by the owner of a position
/// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
/// @param owner The owner of the position for which fees are collected
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount0 The amount of token0 fees collected
/// @param amount1 The amount of token1 fees collected
event Collect(
address indexed owner,
address recipient,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount0,
uint128 amount1
);
/// @notice Emitted when a position's liquidity is removed
/// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
/// @param owner The owner of the position for which liquidity is removed
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity to remove
/// @param amount0 The amount of token0 withdrawn
/// @param amount1 The amount of token1 withdrawn
event Burn(
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted by the pool for any swaps between token0 and token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the output of the swap
/// @param amount0 The delta of the token0 balance of the pool
/// @param amount1 The delta of the token1 balance of the pool
/// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
/// @param liquidity The liquidity of the pool after the swap
/// @param tick The log base 1.0001 of price of the pool after the swap
event Swap(
address indexed sender,
address indexed recipient,
int256 amount0,
int256 amount1,
uint160 sqrtPriceX96,
uint128 liquidity,
int24 tick
);
/// @notice Emitted by the pool for any flashes of token0/token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the tokens from flash
/// @param amount0 The amount of token0 that was flashed
/// @param amount1 The amount of token1 that was flashed
/// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
/// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
event Flash(
address indexed sender,
address indexed recipient,
uint256 amount0,
uint256 amount1,
uint256 paid0,
uint256 paid1
);
/// @notice Emitted by the pool for increases to the number of observations that can be stored
/// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
/// just before a mint/swap/burn.
/// @param observationCardinalityNextOld The previous value of the next observation cardinality
/// @param observationCardinalityNextNew The updated value of the next observation cardinality
event IncreaseObservationCardinalityNext(
uint16 observationCardinalityNextOld,
uint16 observationCardinalityNextNew
);
/// @notice Emitted when the protocol fee is changed by the pool
/// @param feeProtocol0Old The previous value of the token0 protocol fee
/// @param feeProtocol1Old The previous value of the token1 protocol fee
/// @param feeProtocol0New The updated value of the token0 protocol fee
/// @param feeProtocol1New The updated value of the token1 protocol fee
event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
/// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
/// @param sender The address that collects the protocol fees
/// @param recipient The address that receives the collected protocol fees
/// @param amount0 The amount of token0 protocol fees that is withdrawn
/// @param amount0 The amount of token1 protocol fees that is withdrawn
event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IClPoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the IClPoolFactory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The contract that manages CL NFPs, which must adhere to the INonfungiblePositionManager interface
/// @return The contract address
function nfpManager() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick in the range
/// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
/// @notice returns the current fee set for the pool
function currentFee() external view returns (uint24);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IClPoolOwnerActions {
/// @notice Set the protocol's % share of the fees
/// @dev Fees start at 50%, with 5% increments
function setFeeProtocol() external;
/// @notice Collect the protocol fee accrued to the pool
/// @param recipient The address to which collected protocol fees should be sent
/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
/// @return amount0 The protocol fee collected in token0
/// @return amount1 The protocol fee collected in token1
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
function setFee(uint24 _fee) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IClPoolState {
/// @notice reads arbitrary storage slots and returns the bytes
/// @param slots The slots to read from
/// @return returnData The data read from the slots
function readStorage(
bytes32[] calldata slots
) external view returns (bytes32[] memory returnData);
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice Returns the last tick of a given period
/// @param period The period in question
/// @return previousPeriod The period before current period
/// @dev this is because there might be periods without trades
/// startTick The start tick of the period
/// lastTick The last tick of the period, if the period is finished
function periods(
uint256 period
)
external
view
returns (
uint32 previousPeriod,
int24 startTick,
int24 lastTick,
uint160 endSecondsPerLiquidityCumulativeX128
);
/// @notice The last period where a trade or liquidity change happened
function lastPeriod() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees()
external
view
returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all ticks
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
/// tick upper,
/// liquidityNet how much liquidity changes when the pool price crosses the tick,
/// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
/// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
/// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
/// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
/// secondsOutside the seconds spent on the other side of the tick from the current tick,
/// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in comparison to previous snapshots for
/// a specific position.
function ticks(
int24 tick
)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
function tickBitmap(int16 wordPosition) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
/// @return liquidity The amount of liquidity in the position,
/// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
/// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
/// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
/// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
function positions(
bytes32 key
)
external
view
returns (
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Get the period seconds debt of a specific position
/// @param period the period number
/// @param recipient recipient address
/// @param index position index
/// @param tickLower lower bound of range
/// @param tickUpper upper bound of range
/// @return secondsDebtX96 seconds the position was not in range for the period
function positionPeriodDebt(
uint256 period,
address recipient,
uint256 index,
int24 tickLower,
int24 tickUpper
) external view returns (int256 secondsDebtX96);
/// @notice get the period seconds in range of a specific position
/// @param period the period number
/// @param owner owner address
/// @param index position index
/// @param tickLower lower bound of range
/// @param tickUpper upper bound of range
/// @return periodSecondsInsideX96 seconds the position was not in range for the period
function positionPeriodSecondsInRange(
uint256 period,
address owner,
uint256 index,
int24 tickLower,
int24 tickUpper
) external view returns (uint256 periodSecondsInsideX96);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
/// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
/// @return initialized whether the observation has been initialized and the values are safe to use
function observations(
uint256 index
)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IEnneadLpDepositor {
function tokenForPool(address pool) external view returns (address);
}
interface IEnneadToken {
function pool() external view returns (address);
}
/**
* @title Protocol Whitelist for xToken
* @author Ramses Exchange
* @notice Used as a lens contract to get all L2 contracts that's whitelisted to transfer xToken
*/
contract ProtocolWhitelist {
// Ennead Addresses
IEnneadLpDepositor public lpDepositor;
address public nfpDepositor;
address public neadStake;
address public feeHandler;
address public immutable multisig;
mapping(address sender => bool) public isWhitelisted;
constructor(address _multisig) {
multisig = _multisig;
}
function setAddresses(
IEnneadLpDepositor _lpDepositor,
address _nfpDepositor,
address _neadStake,
address _feeHandler
) external {
require(msg.sender == multisig, "!msig");
lpDepositor = _lpDepositor;
nfpDepositor = _nfpDepositor;
neadStake = _neadStake;
feeHandler = _feeHandler;
// whitelist Ennead addresses
isWhitelisted[address(_lpDepositor)] = true;
isWhitelisted[_nfpDepositor] = true;
isWhitelisted[_neadStake] = true;
isWhitelisted[_feeHandler] = true;
}
/**
* @notice Returns whether an address is whitelisted to transfer xToken
* @dev Writes Ennead pools to storage if not already stored
* @param sender The address sending xToken
*/
function syncAndCheckIsWhitelisted(address sender) external returns (bool) {
// return true if already stored
if (isWhitelisted[sender]) {
return true;
}
// Validate if the sender is an Ennead token if not on whitelist
(bool sucess, bytes memory data) = sender.staticcall(
abi.encodeWithSelector(IEnneadToken.pool.selector)
);
if (!sucess || data.length != 32) {
return false;
}
address pool = abi.decode(data, (address));
address token = lpDepositor.tokenForPool(pool);
bool isValidEnneadToken = (sender == token);
// Update whitelist if sender is a valid Ennead token
if (isValidEnneadToken) {
isWhitelisted[token] = true;
}
return isValidEnneadToken;
}
}{
"optimizer": {
"enabled": true,
"runs": 800
},
"evmVersion": "paris",
"viaIR": true,
"metadata": {
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"vestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CancelVesting","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"Converted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"vestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExitVesting","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"InstantExit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"exitRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"veExitRatio","type":"uint256"}],"name":"NewExitRatios","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"vestId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewVest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"min","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"veMaxVest","type":"uint256"}],"name":"NewVestingTimes","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"candidate","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"WhitelistStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"XTokensRedeemed","type":"event"},{"inputs":[],"name":"MAXTIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelistee","type":"address"}],"name":"addWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_candidates","type":"address[]"},{"internalType":"bool[]","name":"_status","type":"bool[]"}],"name":"adjustWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newExitRatio","type":"uint256"},{"internalType":"uint256","name":"_newVeExitRatio","type":"uint256"}],"name":"alterExitRatios","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxVest","type":"uint256"}],"name":"changeMaximumVestingLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minVest","type":"uint256"}],"name":"changeMinimumVestingLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_veMax","type":"uint256"}],"name":"changeVeMaximumVestingLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOperator","type":"address"}],"name":"changeWhitelistOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertEmissionsToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createVest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vestID","type":"uint256"},{"internalType":"bool","name":"_ve","type":"bool"}],"name":"exitVest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBalanceResiding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_emissionsToken","type":"address"},{"internalType":"address","name":"_votingEscrow","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_timelock","type":"address"},{"internalType":"address","name":"_multisig","type":"address"},{"internalType":"address","name":"_whitelistOperator","type":"address"},{"internalType":"address","name":"_protocolWhitelist","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"maxPayAmount","type":"uint256"}],"name":"instantExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_multisig","type":"address"}],"name":"migrateMultisig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolWhitelist","type":"address"}],"name":"migrateProtocolWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timelock","type":"address"}],"name":"migrateTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minVest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"multisigRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optionEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"outToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolWhitelist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"quotePayment","outputs":[{"internalType":"uint256","name":"payAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"quotePrice","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"},{"internalType":"uint256","name":"_veMax","type":"uint256"}],"name":"reinitializeVestingParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelistee","type":"address"}],"name":"removeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"rescueTrappedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"setOptionsEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_duration","type":"uint32"}],"name":"setSecondsAgo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"syncAndCheckIsWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"usersTotalVests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veExitRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veMaxVest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"vestInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"maxEnd","type":"uint256"},{"internalType":"uint256","name":"vestID","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"votingEscrow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistOperator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"xTokenConvertToNft","outputs":[{"internalType":"uint256","name":"veTokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenID","type":"uint256"}],"name":"xTokenIncreaseNft","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60808060405234620000c6576000549060ff8260081c1662000074575060ff8082160362000038575b6040516140f29081620000cc8239f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a13862000028565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b600080fdfe608080604052600436101561001357600080fd5b600090813560e01c90816306fdde031461233f5750806308b4bd6314612220578063095ea7b3146121f95780630fb5a6b4146121d557806311147bd61461216157806312e826741461207257806316c38b3c14611ff757806318160ddd14611fd95780631ad7b12714611f8f578063210ca05d14611f6657806323b872dd14611eab57806326997e9e14611e875780632937c8a314611e405780632cf53bd814611e085780632db0c52414611b4b578063313ce56714611b2f57806333db82fd14611b08578063358764761461140457806339509351146113b25780633af32abf14611375578063415bceba146113575780634437152a1461123057806344c437821461120957806345420ff7146111e357806346c96aac146111bc5780634783c35b146111955780634f2bfe5b1461116e578063536d0e11146110f857806355a595ab1461107e5780635c975abb1461105857806361b51a0e14610f49578063636fc28b14610f225780636743c10014610edb57806370a0823114610ea357806378c8cda714610e2c5780637eb80ff314610de45780637faa440b14610dbd57806386c2608c14610d0e5780638d60cd6214610c9a57806390a5701214610c3c57806395d89b4114610b575780639bd1fbdc14610b0f578063a2add5f514610af1578063a457c2d714610a33578063a4bf5b3e14610984578063a74e16ed1461095d578063a9059cbb1461092b578063aaf5eb681461090f578063b906bbc3146108c8578063bacbf61b14610835578063beb7dc3414610763578063c6c6c8991461071c578063cd3e888d146106a5578063d33219b41461067e578063dd62ed3e1461062e578063e252a4dc146105a9578063e9dcc0541461058b578063eb8738f514610363578063ee00ef3a14610344578063ef8f959514610326578063f3980527146103085763f80f5dd5146102cb57600080fd5b34610305576020366003190112610305576103026102e7612457565b6102fd6001600160a01b03606a54163314612a33565b613e06565b80f35b80fd5b50346103055780600319360112610305576020607154604051908152f35b50346103055780600319360112610305576020607254604051908152f35b50346103055780600319360112610305576020604051630784ce008152f35b503461030557610372366124c4565b61038460ff60745460a81c1615612667565b61038f8215156125f8565b606461039d83606e546129d4565b046103a883336138c2565b60745460a01c60ff161561055f5750606e546064036064811161054b5760646103d46103da92856129d4565b04612f46565b90811161050657606c546069546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810193909352602091839160649183918891165af180156104dc576104e7575b506001600160a01b03602061046b835b60655460405163a9059cbb60e01b81523360048201526024810192909252909384928391889183906044820190565b0393861c165af180156104dc576104ad575b506040519081527fa8a63b0531e55ae709827fb089d01034e24a200ad14dc710dfa9e962005f629a60203392a280f35b6104ce9060203d6020116104d5575b6104c681836125d6565b8101906126e3565b503861047d565b503d6104bc565b6040513d85823e3d90fd5b6104ff9060203d6020116104d5576104c681836125d6565b503861042c565b60405162461bcd60e51b815260206004820152600860248201527f534c4950504147450000000000000000000000000000000000000000000000006044820152606490fd5b634e487b7160e01b84526011600452602484fd5b6001600160a01b03915061046b8161058661057c60209487612a07565b8560695416613ae1565b61043c565b50346103055780600319360112610305576020607054604051908152f35b5034610305576060366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c8600435602435906106286044356105ff6001600160a01b0360685416331461293c565b806071558360725582607055604051938493846040919493926060820195825260208201520152565b0390a180f35b503461030557604036600319011261030557610648612457565b604061065261246d565b926001600160a01b03809316815260346020522091166000526020526020604060002054604051908152f35b503461030557806003193601126103055760206001600160a01b0360685416604051908152f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c86004356106f16001600160a01b0360685416331461293c565b8060715560705461062860725492604051938493846040919493926060820195825260208201520152565b503461030557602036600319011261030557610736612457565b6001600160a01b0319606854916001600160a01b0390610759828516331461293c565b1691161760685580f35b5034610305576107723661250b565b9290916001600160a01b039161078d8360685416331461293c565b855b82811061079a578680f35b836107ae6107a9838686612aa5565b612ab5565b169084606954166107c0828989612aa5565b60405163a9059cbb60e01b81526001600160a01b03929092166004830152356024820152916020908190849060449082908d905af192831561082a5760019361080c575b50500161078f565b8161082292903d106104d5576104c681836125d6565b503880610804565b6040513d8b823e3d90fd5b5034610305578060031936011261030557606554906001600160a01b03602080936024604051809481936370a0823160e01b8352306004840152851c165afa9182156108bc579161088a575b50604051908152f35b90508181813d83116108b5575b6108a181836125d6565b810103126108b0575138610881565b600080fd5b503d610897565b604051903d90823e3d90fd5b5034610305576020366003190112610305576108e2612457565b6001600160a01b03906108fa82606a54163314612a33565b166001600160a01b0319607454161760745580f35b5034610305578060031936011261030557602060405160648152f35b503461030557604036600319011261030557610952610948612457565b6024359033613bf0565b602060405160018152f35b503461030557602036600319011261030557602061097c600435612f46565b604051908152f35b5034610305576020366003190112610305578060206109fa6004356001600160a01b036109b681606954163314612697565b6109c082336138c2565b606554841c169060405194858094819363a9059cbb60e01b83523360048401602090939291936001600160a01b0360408201951681520152565b03925af18015610a2857610a0c575080f35b610a249060203d6020116104d5576104c681836125d6565b5080f35b6040513d84823e3d90fd5b503461030557604036600319011261030557610a4d612457565b6040602435923381526034602052206001600160a01b03821660005260205260406000205491808310610a8657610952920390336139df565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608490fd5b50346103055780600319360112610305576020606e54604051908152f35b50346103055760403660031901126103055760243580151581036108b057610b4d602091610b4560ff60745460a81c1615612667565b600435612ac9565b6040519015158152f35b5034610305578060031936011261030557604051908060375490610b7a82612556565b80855291602091600191828116908115610c0f5750600114610bb7575b610bb386610ba7818803826125d6565b6040519182918261240e565b0390f35b9350603784527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae5b838510610bfc57505050508101602001610ba782610bb338610b97565b8054868601840152938201938101610bdf565b9050869550610bb396935060209250610ba794915060ff191682840152151560051b820101929338610b97565b5034610305577f5ae868cca8699cff09a2a4e0f91d871766444d92d260cc061e9f5cf8ef7a36656040610c6e366124c4565b610c846001600160a01b0360685416331461293c565b81606e5580606f5582519182526020820152a180f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c8600435610ce66001600160a01b0360685416331461293c565b6070819055607254607154604080519384526020840192909252908201528060608101610628565b503461030557610d1d3661250b565b6001600160a01b039392610d3685606a54163314612a33565b855b818110610d43578680f35b610d516107a9828488612aa5565b90610d5d818587612aa5565b35801515809103610db9577fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef388600194169182600052602090606d8252604060002060ff1981541660ff8316179055604051908152a201610d38565b8880fd5b503461030557806003193601126103055760206001600160a01b0360745416604051908152f35b503461030557602036600319011261030557606e546064039060648211610e1857602061097c60646103d4856004356129d4565b634e487b7160e01b81526011600452602490fd5b503461030557602036600319011261030557610e46612457565b6001600160a01b0390610e5e82606a54163314612a33565b1680600052606d602052604060002060ff1981541690557fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160008152a280f35b50346103055760203660031901126103055760406020916001600160a01b03610eca612457565b168152603383522054604051908152f35b503461030557602036600319011261030557610ef5612457565b6001600160a01b0390610f0d8260685416331461293c565b166001600160a01b0319606a541617606a5580f35b503461030557806003193601126103055760206001600160a01b03606b5416604051908152f35b5034610305576020908160031936011261030557600435610f7260ff60745460a81c1615612667565b610f7d8115156125f8565b610f8781336138c2565b81836064610f9784606f546129d4565b0460646001600160a01b03610fba8160695416610fb48589612a07565b90613ae1565b6066541691604051948593849263ec32e6df60e01b84526004840152630784ce0060248401523360448401525af19283156108bc5792611029575b506040519081527fc1af970349bc805b72c8d6b943b259baa88e58e11438cd81833301aa4b58455d833392a2604051908152f35b9091508281813d8311611051575b61104181836125d6565b810103126108b057519038610ff5565b503d611037565b5034610305578060031936011261030557602060ff60745460a81c166040519015158152f35b5034610305576020366003190112610305576110986124b5565b6110ae6001600160a01b036069541633146126fb565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000060745492151560a01b1691161760745580f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c86004356111446001600160a01b0360685416331461293c565b80607255607054610628607154604051938493846040919493926060820195825260208201520152565b503461030557806003193601126103055760206001600160a01b0360665416604051908152f35b503461030557806003193601126103055760206001600160a01b0360695416604051908152f35b503461030557806003193601126103055760206001600160a01b0360675416604051908152f35b5034610305578060031936011261030557602060ff60745460a01c166040519015158152f35b503461030557806003193601126103055760206001600160a01b03606a5416604051908152f35b5034610305576020806003193601126113535761124b612457565b6001600160a01b038091611264826069541633146126fb565b1691606b5492846001600160a01b0319948286821617606b551617604051630dfe168160e01b81528281600481855afa90811561134857869161132b575b5083606554841c16848216146000146113235750816004916040519283809263d21220a760e01b82525afa9182156113185785926112eb575b50505b1690606c541617606c5580f35b61130a9250803d10611311575b61130281836125d6565b810190612a14565b38806112db565b503d6112f8565b6040513d87823e3d90fd5b9150506112de565b6113429150833d85116113115761130281836125d6565b386112a2565b6040513d88823e3d90fd5b5080fd5b50346103055780600319360112610305576020606f54604051908152f35b50346103055760203660031901126103055760ff60406020926001600160a01b0361139e612457565b168152606d84522054166040519015158152f35b5034610305576040366003190112610305576109529060406113d2612457565b913381526034602052206001600160a01b0382166000526020526113fd602435604060002054612644565b90336139df565b50346103055760e03660031901126103055761141e612457565b9061142761246d565b6044356001600160a01b03811681036108b057606435906001600160a01b03821682036108b057608435926001600160a01b03841684036108b05760a435926001600160a01b03841684036108b05760c4356001600160a01b03811681036108b05786549560ff8760081c161596878098611afb575b8015611ae4575b15611a795760ff198116600117895587611a68575b50604051986114c78a6125ba565b600b8a527f457363726f77656420524100000000000000000000000000000000000000000060208b0152604051996114fe8b6125ba565b60038b526278524160e81b60208c015261152760ff8b5460081c1661152281613e55565b613e55565b80519067ffffffffffffffff8211611a54578190611546603654612556565b601f81116119ab575b50602090601f8311600114611923578c92611918575b50508160011b916000199060031b1c1916176036555b895167ffffffffffffffff811161190457611597603754612556565b9a601f8c11611867575b8a809c5098999a50602090601f83116001146117ba57946001600160a01b03809b8180978160449c9860209f9e9c988f9c839982918f926117af575b50508160011b916000199060031b1c1916176037555b7fffffffffffffffff0000000000000000000000000000000000000000ffffffff77ffffffffffffffffffffffffffffffffffffffff000000006065549260201b169116179889606555169e8f97816066549d8e9a6001600160a01b0319809c16176066551689606754161760675516876068541617606855168560695416176069551683606a541617606a55169060745416176074556032606e556064606f556212750060705562278d00607155629e3400607255604051978896879563095ea7b360e01b8752161760048501526000196024850152861c165af180156104dc57611790575b5060008052606d6020526040600020600160ff1982541617905560007fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a261172a30613e06565b61173e6001600160a01b0360675416613e06565b6117526001600160a01b0360695416613e06565b6117595780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b6117a89060203d6020116104d5576104c681836125d6565b50386116da565b0151905038806115dd565b9060378a9b969798999b527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae918a5b601f198516811061184c57508a9994966001600160a01b03809d9993978160209e9a60018960449f9a99849d859b99869a601f19811610611833575b505050811b016037556115f3565b015160001960f88460031b161c19169055388080611825565b8183015184558e9b50600190930192602092830192016117e9565b60378b52601f820160051c7f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae01602083106118dd575b601f8d0160051c7f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae0181106118d257506115a1565b8b815560010161189d565b507f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae61189d565b634e487b7160e01b8a52604160045260248afd5b015190503880611565565b925060368c527f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b8908c935b601f1984168510611990576001945083601f19811610611977575b505050811b0160365561157b565b015160001960f88460031b161c19169055388080611969565b8181015183556020948501946001909301929091019061194e565b90915060368c52601f830160051c7f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b80160208410611a2d575b908392915b8d601f830160051c7f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b8018210611a2057505061154f565b81558493506001016119e9565b507f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b86119e4565b634e487b7160e01b8b52604160045260248bfd5b61ffff1916610101178855386114b9565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b50303b1580156114a45750600160ff8216146114a4565b50600160ff82161061149d565b503461030557806003193601126103055760206001600160a01b03606c5416604051908152f35b5034610305578060031936011261030557602060405160128152f35b503461030557611b5a366124c4565b611b6c60ff60745460a81c1615612667565b611b778215156125f8565b611b8182336138c2565b60665460405163430c208160e01b808252336004830152602482018490526020936001600160a01b03939092908416918582604481865afa918215611db5578692611bd3918a91611df1575b50612988565b6040519081523060048201526024810184905291829060449082905afa801561134857611c06918791611dd45750612988565b6064611c1485606f546129d4565b0491611c288160695416610fb48588612a07565b630784ce00804201804211611dc05762093a80809104818102918183041490151715611dc05790829188959493606654169060405190635a2d1e0760e11b8252856004830152604082602481865afa918215611db5578892611d7b575b5011611d14575b50506066541691823b15611d10576044849283604051958694859363b2383e5560e01b8552600485015260248401525af18015610a2857611cf8575b50507fc1af970349bc805b72c8d6b943b259baa88e58e11438cd81833301aa4b58455d906040519283523392a280f35b611d0190612590565b611d0c578238611cc8565b8280fd5b8380fd5b8095929394953b15611d0c57604483926040519485938492639d507b8b60e01b845289600485015260248401525af18015611d7057611d59575b908187949392611c8c565b611d67909691939296612590565b94909138611d4e565b6040513d89823e3d90fd5b9091506040813d604011611dad575b81611d97604093836125d6565b81010312611da9578801519038611c85565b8780fd5b3d9150611d8a565b6040513d8a823e3d90fd5b634e487b7160e01b88526011600452602488fd5b611deb9150853d87116104d5576104c681836125d6565b38611bcd565b611deb9150843d86116104d5576104c681836125d6565b50346103055760203660031901126103055760406020916001600160a01b03611e2f612457565b168152607383522054604051908152f35b503461030557602036600319011261030557611e5a612457565b6001600160a01b0390611e728260685416331461293c565b166001600160a01b0319606954161760695580f35b5034610305576020366003190112610305576020610b4d611ea6612457565b61284b565b503461030557606036600319011261030557611ec5612457565b90611ece61246d565b6040604435926001600160a01b038516815260346020528181203382526020522054926000198403611f05575b6109529350613bf0565b828410611f2157611f1c83610952950333836139df565b611efb565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b503461030557806003193601126103055760206065546001600160a01b0360405191831c168152f35b50346103055760203660031901126103055760043563ffffffff811680910361135357611fc86001600160a01b036069541633146126fb565b63ffffffff19606554161760655580f35b50346103055780600319360112610305576020603554604051908152f35b5034610305576020366003190112610305576120116124b5565b6120276001600160a01b036069541633146126fb565b7fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff75ff00000000000000000000000000000000000000000060745492151560a81b1691161760745580f35b503461030557602080600319360112611353576004359061209b60ff60745460a81c1615612667565b6120ac6120a73361284b565b612697565b6120b78215156125f8565b6065546040516323b872dd60e01b81523360048201523060248201526044810184905291908190839060649082908890851c6001600160a01b03165af1918215612156577fa428517b481b65176e7c35a57b564d5cf943c8462468b8a0f025fa689173f90192612139575b5061212d8333613ae1565b6040519283523392a280f35b61214f90823d84116104d5576104c681836125d6565b5038612122565b6040513d86823e3d90fd5b50346103055760403660031901126103055761217b612457565b6001600160a01b03168152607360205260408120805460243592908310156103055760806121a98484612483565b508054906001810154906003600282015491015491604051938452602084015260408301526060820152f35b5034610305578060031936011261030557602063ffffffff60655416604051908152f35b503461030557604036600319011261030557610952612216612457565b60243590336139df565b5034610305576020366003190112610305576004356122408115156125f8565b61224a81336138c2565b33825260736020526040822080549061226560725442612644565b90604051916080830183811067ffffffffffffffff82111761232b57604052848352602083014281526040840191825260608401928584526801000000000000000086101561231757856122be91600182018155612483565b9490946123035751845551600184015551600283015551600390910155337f7d9230ebb47980ddc758fe4e69ea83a89dafbceb45bd45934798477baa5776688480a480f35b634e487b7160e01b88526004889052602488fd5b634e487b7160e01b88526041600452602488fd5b634e487b7160e01b87526041600452602487fd5b82346103055780600319360112610305576036548161235d82612556565b808552916020916001918281169081156123e1575060011461238957610bb386610ba7818803826125d6565b9350603684527f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b85b8385106123ce57505050508101602001610ba782610bb385610b97565b80548686018401529382019381016123b1565b9050869550610bb396935060209250610ba794915060ff191682840152151560051b820101929385610b97565b6020808252825181830181905290939260005b82811061244357505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501612421565b600435906001600160a01b03821682036108b057565b602435906001600160a01b03821682036108b057565b805482101561249f5760005260206000209060021b0190600090565b634e487b7160e01b600052603260045260246000fd5b6004359081151582036108b057565b60409060031901126108b0576004359060243590565b9181601f840112156108b05782359167ffffffffffffffff83116108b0576020808501948460051b0101116108b057565b60406003198201126108b05767ffffffffffffffff916004358381116108b05782612538916004016124da565b939093926024359182116108b057612552916004016124da565b9091565b90600182811c92168015612586575b602083101461257057565b634e487b7160e01b600052602260045260246000fd5b91607f1691612565565b67ffffffffffffffff81116125a457604052565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176125a457604052565b90601f8019910116810190811067ffffffffffffffff8211176125a457604052565b156125ff57565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a2021203e2030000000000000000000000000000000000000006044820152606490fd5b9190820180921161265157565b634e487b7160e01b600052601160045260246000fd5b1561266e57565b60405162461bcd60e51b81526020600482015260016024820152600560fc1b6044820152606490fd5b1561269e57565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a202141555448000000000000000000000000000000000000006044820152606490fd5b908160209103126108b0575180151581036108b05790565b1561270257565b60405162461bcd60e51b815260206004820152600560248201527f214d5349470000000000000000000000000000000000000000000000000000006044820152606490fd5b6000808052606d60209081527fda90043ba5b4096ba14704bc227ab0d3167da15b887e62ab2e76e37daa7113565460ff16612844576001600160a01b0360248282606754166040519283809263aa79979b60e01b82528860048301525afa908115612156578491612827575b5061281c578183916074541660246040518094819363134cbf4f60e11b83528160048401525af19182156104dc5783926127ff575b50506127f15790565b506127fa613dbe565b600190565b6128159250803d106104d5576104c681836125d6565b38806127e8565b5050506127fa613dbe565b61283e9150833d85116104d5576104c681836125d6565b386127b3565b5050600190565b6001600160a01b039081811691600092808452602091606d835260ff6040862054166129325760248382606754166040519283809263aa79979b60e01b82528760048301525afa908115611348578691612915575b50612908578491602484926074541691604051948593849263134cbf4f60e11b845260048401525af19182156121565784926128eb575b50506128e1575090565b6127fa9150613e06565b6129019250803d106104d5576104c681836125d6565b38806128d7565b5050506127fa9150613e06565b61292c9150843d86116104d5576104c681836125d6565b386128a0565b5050505050600190565b1561294357565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a202141757468000000000000000000000000000000000000006044820152606490fd5b1561298f57565b60405162461bcd60e51b815260206004820152601760248201527f78546f6b656e3a207665206e6f7420617070726f7665640000000000000000006044820152606490fd5b8181029291811591840414171561265157565b81156129f1570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161265157565b908160209103126108b057516001600160a01b03811681036108b05790565b15612a3a57565b60405162461bcd60e51b815260206004820152603d60248201527f78546f6b656e3a204f6e6c79207468652077686974656c697374696e67206f7060448201527f657261746f722063616e2063616c6c20746869732066756e6374696f6e0000006064820152608490fd5b919081101561249f5760051b0190565b356001600160a01b03811681036108b05790565b6000913383526020607381526040808520548015159081612ee7575b5015612ea45733855260738252612afe84828720612483565b509485549384151580612e97575b15612e53576001968781015491838255612b2860705484612644565b4210612e1857612c8757600201544210612bdb5750606554825163a9059cbb60e01b815233600482015260248101869052919084908390821c6001600160a01b0316818481604481015b03925af1908115612bd05750907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb76939291612bb3575b50519283523392a390565b612bc990833d85116104d5576104c681836125d6565b5038612ba8565b8351903d90823e3d90fd5b606e54906064612beb83886129d4565b04916064036064811161054b57612c3484936064612c2d612c248a96612c1e612c17612b72988f6129d4565b9142612a07565b906129d4565b607254906129e7565b0490612644565b6001600160a01b03612c4e8160695416610fb4848c612a07565b606554841c1690865195868094819363a9059cbb60e01b83523360048401602090939291936001600160a01b0360408201951681520152565b5060715442612c968284612644565b11612d4357505080836001600160a01b0360665416606485518094819363ec32e6df60e01b83528a6004840152630784ce0060248401523360448401525af18015612d3957612d0f575b5050907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb7691519283523392a390565b8390813d8311612d32575b612d2481836125d6565b810103126103055780612ce0565b503d612d1a565b83513d84823e3d90fd5b606f54916064612d5384896129d4565b049260640360648111612e0457926064612c2d8894612d7d612d8295612c1e612c178b9a8f6129d4565b6129e7565b60646001600160a01b03612d9e8160695416610fb4858c612a07565b60665416918651948593849263ec32e6df60e01b84526004840152630784ce0060248401523360448401525af18015612d3957612d0f575050907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb7691519283523392a390565b634e487b7160e01b85526011600452602485fd5b50505050907fcda231b62bdbcfdebaec108470aea3eb3fcc5ebe00d79b6e252850d4bf5c60b591612e498433613ae1565b519283523392a390565b825162461bcd60e51b815260048101859052601460248201527f78546f6b656e3a205665737420216163746976650000000000000000000000006044820152606490fd5b5085600388015414612b0c565b60649250519062461bcd60e51b82526004820152601360248201527f78546f6b656e3a205665737420216578697374000000000000000000000000006044820152fd5b600019810191508111612efd5784111538612ae5565b634e487b7160e01b86526011600452602486fd5b67ffffffffffffffff81116125a45760051b60200190565b80511561249f5760200190565b80516001101561249f5760400190565b604080519067ffffffffffffffff60608301818111848210176125a45782526002835260209081840192803685376065549463ffffffff908187169081612f8c82612f29565b5260009687612f9a83612f36565b526001600160a01b039586606b5416898751809263883bdbfd60e01b82526004958c60249889850190828a8701525180915260448501929186905b82821061389e575050505082809103915afa918215613894578a92613785575b505061300a61300382612f36565b5191612f29565b5160060b9060060b03667fffffffffffff1993667fffffffffffff8213858312176132875760030b9060060b811561377357600019948114828614166132875781810560020b918a82129182613764575b5050613752575b60020b8881121561374c57600160ff1b811461373a578089035b620d89e8811161371457879695949392918a9160018116156136f85770ffffffffffffffffffffffffffffffffff6ffffcb933bd6fad37aa2d162d1a5940015b1697600282166136ba575b84821661367c575b6008821661363e575b60108216613600575b8b82166135c2575b8116613585575b608090818116613548575b610100811661350b575b61020081166134ce575b6104008116613491575b6108008116613454575b6110008116613417575b61200081166133da575b614000811661339d575b6180008116613360575b620100008116613323575b6202000081166132e7575b620400008116613299575b620800001661324e575b5013613220575b5050509061319c918116156000146132175760ff865b1690851c612644565b166fffffffffffffffffffffffffffffffff81116131e757806131be916129d4565b9381606c5416921c161090506000146131de57906131db916140a0565b90565b6131db91614024565b806131f191613ec7565b9381606c5416921c1610905060001461320e57906131db91613fdf565b6131db91613f56565b60ff6001613193565b9091929450831561323d5750509161319c9184930491388061317d565b634e487b7160e01b88526012905286fd5b915096506b048a170391f7dc42444e8fa29591929394959182810292818404149015171561328757879695949392918a911c9538613176565b634e487b7160e01b8a5260118352838afd5b9850915091929394956d2216e584f5fa1ea926041bedfe98908181029181830414901517156132d557889790821c96959493928b92909161316c565b634e487b7160e01b8b5260118452848bfd5b9850915091929394956e5d6af8dedb81196699c329225ee604908181029181830414901517156132d5579181899897969594938c931c97613161565b9850915091929394956f09aa508b5b7a84e1c677de54f3e99bc9908181029181830414901517156132d5579181899897969594938c931c97613156565b9850915091929394956f31be135f97d08fd981231505542fcfa6908181029181830414901517156132d5579181899897969594938c931c9761314b565b9850915091929394956f70d869a156d2a1b890bb3df62baf32f7908181029181830414901517156132d5579181899897969594938c931c97613141565b9850915091929394956fa9f746462d870fdf8a65dc1f90e061e5908181029181830414901517156132d5579181899897969594938c931c97613137565b9850915091929394956fd097f3bdfd2022b8845ad8f792aa5825908181029181830414901517156132d5579181899897969594938c931c9761312d565b9850915091929394956fe7159475a2c29b7443b29c7fa6e889d9908181029181830414901517156132d5579181899897969594938c931c97613123565b9850915091929394956ff3392b0822b70005940c7a398e4b70f3908181029181830414901517156132d5579181899897969594938c931c97613119565b9850915091929394956ff987a7253ac413176f2b074cf7815e54908181029181830414901517156132d5579181899897969594938c931c9761310f565b9850915091929394956ffcbe86c7900a88aedcffc83b479aa3a4908181029181830414901517156132d5579181899897969594938c931c97613105565b9850915091929394956ffe5dee046a99a2a811c461f1969c3053908181029181830414901517156132d5579181899897969594938c931c976130fb565b9750919293949590506fff2ea16466c96a3843ec78b326b528619081810291818304149015171561328757879695949392918a9160801c966130f0565b9850915091929394956fff973b41fa98c081472e6896dfb254c0908181029181830414901517156132d557918a918998979695949360801c976130e9565b9850915091929394956fffcb9843d60f6159c9db58835c926644908181029181830414901517156132d557918a918998979695949360801c976130e1565b9850915091929394956fffe5caca7e10e4e61c3624eaa0941cd0908181029181830414901517156132d557918a918998979695949360801c976130d8565b9850915091929394956ffff2e50f5f656932ef12357cf3c7fdcc908181029181830414901517156132d557918a918998979695949360801c976130cf565b9850915091929394956ffff97272373d413259a46990580e213a908181029181830414901517156132d557918a918998979695949360801c976130c7565b70ffffffffffffffffffffffffffffffffff600160801b6130bc565b865162461bcd60e51b81528084018a9052600181860152601560fa1b6044820152606490fd5b50634e487b7160e01b88526011905286fd5b8061307c565b627fffff19811461373a578301613062565b0760060b15159050388061305b565b634e487b7160e01b8a5260128352838afd5b9091503d808b843e61379781846125d6565b820190878383031261386f57825181811161386b5783019282601f8501121561386b578351936137c685612f11565b946137d38b5196876125d6565b8086528c8087019160051b83010191858311613890578d01905b828210613873575050508a81015191821161386b570181601f8201121561386f578051908a8061381c84612f11565b6138288c5191826125d6565b848152019260051b82010192831161386b578a01905b82821061384f575050503880612ff5565b81518a81168103613867578152908a01908a0161383e565b8c80fd5b8b80fd5b8a80fd5b81518060060b810361388c578152908d01908d016137ed565b8f80fd5b8e80fd5b87513d8c823e3d90fd5b919496509282955081908d600194511681520194019101908e94928694928f612fd5565b6001600160a01b03168015613990576138e360ff60745460a81c1615612667565b80600052603360205260406000205491808310613940576020817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92600095858752603384520360408620558060355403603555604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b6001600160a01b03809116918215613a905716918215613a405760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260348252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b6001600160a01b031690811580613bab57613b0460ff60745460a81c1615612667565b15613b59575b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602082613b3c600094603554612644565b6035558484526033825260408420818154019055604051908152a3565b613b61612747565b613b0a575b60405162461bcd60e51b815260206004820152600b60248201527f78546f6b656e3a2021574c0000000000000000000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b916001600160a01b03808416928315613d53571692831580613d0257613c1e60ff60745460a81c1615612667565b15613cee575b5060008281526033602052604081205491808310613c8357604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95876020965260338652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608490fd5b613cf79061284b565b15613b665738613c24565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608490fd5b60008052606d6020526040600020600160ff1982541617905560007fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a2565b6001600160a01b031680600052606d6020526040600020600160ff198254161790557fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a2565b15613e5c57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608490fd5b6000198282099082810292838084109303928084039314613f4d57680100000000000000009183831115613f08570990828211900360c01b910360401c1790565b60405162461bcd60e51b815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152606490fd5b50505060401c90565b600160801b91600019828409928260801b92838086109503948086039514613fd25784831115613f08578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b5050906131db92506129e7565b600019828209908281029283808410930392808403931461401b57600160801b9183831115613f08570990828211900360801b910360801c1790565b50505060801c90565b600160c01b91600019828409928260c01b92838086109503948086039514613fd25784831115613f08578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60001982820990828102928380841093039280840393146140dc57600160c01b9183831115613f08570990828211900360401b910360c01c1790565b50505060c01c9056fea164736f6c6343000817000a
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c90816306fdde031461233f5750806308b4bd6314612220578063095ea7b3146121f95780630fb5a6b4146121d557806311147bd61461216157806312e826741461207257806316c38b3c14611ff757806318160ddd14611fd95780631ad7b12714611f8f578063210ca05d14611f6657806323b872dd14611eab57806326997e9e14611e875780632937c8a314611e405780632cf53bd814611e085780632db0c52414611b4b578063313ce56714611b2f57806333db82fd14611b08578063358764761461140457806339509351146113b25780633af32abf14611375578063415bceba146113575780634437152a1461123057806344c437821461120957806345420ff7146111e357806346c96aac146111bc5780634783c35b146111955780634f2bfe5b1461116e578063536d0e11146110f857806355a595ab1461107e5780635c975abb1461105857806361b51a0e14610f49578063636fc28b14610f225780636743c10014610edb57806370a0823114610ea357806378c8cda714610e2c5780637eb80ff314610de45780637faa440b14610dbd57806386c2608c14610d0e5780638d60cd6214610c9a57806390a5701214610c3c57806395d89b4114610b575780639bd1fbdc14610b0f578063a2add5f514610af1578063a457c2d714610a33578063a4bf5b3e14610984578063a74e16ed1461095d578063a9059cbb1461092b578063aaf5eb681461090f578063b906bbc3146108c8578063bacbf61b14610835578063beb7dc3414610763578063c6c6c8991461071c578063cd3e888d146106a5578063d33219b41461067e578063dd62ed3e1461062e578063e252a4dc146105a9578063e9dcc0541461058b578063eb8738f514610363578063ee00ef3a14610344578063ef8f959514610326578063f3980527146103085763f80f5dd5146102cb57600080fd5b34610305576020366003190112610305576103026102e7612457565b6102fd6001600160a01b03606a54163314612a33565b613e06565b80f35b80fd5b50346103055780600319360112610305576020607154604051908152f35b50346103055780600319360112610305576020607254604051908152f35b50346103055780600319360112610305576020604051630784ce008152f35b503461030557610372366124c4565b61038460ff60745460a81c1615612667565b61038f8215156125f8565b606461039d83606e546129d4565b046103a883336138c2565b60745460a01c60ff161561055f5750606e546064036064811161054b5760646103d46103da92856129d4565b04612f46565b90811161050657606c546069546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810193909352602091839160649183918891165af180156104dc576104e7575b506001600160a01b03602061046b835b60655460405163a9059cbb60e01b81523360048201526024810192909252909384928391889183906044820190565b0393861c165af180156104dc576104ad575b506040519081527fa8a63b0531e55ae709827fb089d01034e24a200ad14dc710dfa9e962005f629a60203392a280f35b6104ce9060203d6020116104d5575b6104c681836125d6565b8101906126e3565b503861047d565b503d6104bc565b6040513d85823e3d90fd5b6104ff9060203d6020116104d5576104c681836125d6565b503861042c565b60405162461bcd60e51b815260206004820152600860248201527f534c4950504147450000000000000000000000000000000000000000000000006044820152606490fd5b634e487b7160e01b84526011600452602484fd5b6001600160a01b03915061046b8161058661057c60209487612a07565b8560695416613ae1565b61043c565b50346103055780600319360112610305576020607054604051908152f35b5034610305576060366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c8600435602435906106286044356105ff6001600160a01b0360685416331461293c565b806071558360725582607055604051938493846040919493926060820195825260208201520152565b0390a180f35b503461030557604036600319011261030557610648612457565b604061065261246d565b926001600160a01b03809316815260346020522091166000526020526020604060002054604051908152f35b503461030557806003193601126103055760206001600160a01b0360685416604051908152f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c86004356106f16001600160a01b0360685416331461293c565b8060715560705461062860725492604051938493846040919493926060820195825260208201520152565b503461030557602036600319011261030557610736612457565b6001600160a01b0319606854916001600160a01b0390610759828516331461293c565b1691161760685580f35b5034610305576107723661250b565b9290916001600160a01b039161078d8360685416331461293c565b855b82811061079a578680f35b836107ae6107a9838686612aa5565b612ab5565b169084606954166107c0828989612aa5565b60405163a9059cbb60e01b81526001600160a01b03929092166004830152356024820152916020908190849060449082908d905af192831561082a5760019361080c575b50500161078f565b8161082292903d106104d5576104c681836125d6565b503880610804565b6040513d8b823e3d90fd5b5034610305578060031936011261030557606554906001600160a01b03602080936024604051809481936370a0823160e01b8352306004840152851c165afa9182156108bc579161088a575b50604051908152f35b90508181813d83116108b5575b6108a181836125d6565b810103126108b0575138610881565b600080fd5b503d610897565b604051903d90823e3d90fd5b5034610305576020366003190112610305576108e2612457565b6001600160a01b03906108fa82606a54163314612a33565b166001600160a01b0319607454161760745580f35b5034610305578060031936011261030557602060405160648152f35b503461030557604036600319011261030557610952610948612457565b6024359033613bf0565b602060405160018152f35b503461030557602036600319011261030557602061097c600435612f46565b604051908152f35b5034610305576020366003190112610305578060206109fa6004356001600160a01b036109b681606954163314612697565b6109c082336138c2565b606554841c169060405194858094819363a9059cbb60e01b83523360048401602090939291936001600160a01b0360408201951681520152565b03925af18015610a2857610a0c575080f35b610a249060203d6020116104d5576104c681836125d6565b5080f35b6040513d84823e3d90fd5b503461030557604036600319011261030557610a4d612457565b6040602435923381526034602052206001600160a01b03821660005260205260406000205491808310610a8657610952920390336139df565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608490fd5b50346103055780600319360112610305576020606e54604051908152f35b50346103055760403660031901126103055760243580151581036108b057610b4d602091610b4560ff60745460a81c1615612667565b600435612ac9565b6040519015158152f35b5034610305578060031936011261030557604051908060375490610b7a82612556565b80855291602091600191828116908115610c0f5750600114610bb7575b610bb386610ba7818803826125d6565b6040519182918261240e565b0390f35b9350603784527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae5b838510610bfc57505050508101602001610ba782610bb338610b97565b8054868601840152938201938101610bdf565b9050869550610bb396935060209250610ba794915060ff191682840152151560051b820101929338610b97565b5034610305577f5ae868cca8699cff09a2a4e0f91d871766444d92d260cc061e9f5cf8ef7a36656040610c6e366124c4565b610c846001600160a01b0360685416331461293c565b81606e5580606f5582519182526020820152a180f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c8600435610ce66001600160a01b0360685416331461293c565b6070819055607254607154604080519384526020840192909252908201528060608101610628565b503461030557610d1d3661250b565b6001600160a01b039392610d3685606a54163314612a33565b855b818110610d43578680f35b610d516107a9828488612aa5565b90610d5d818587612aa5565b35801515809103610db9577fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef388600194169182600052602090606d8252604060002060ff1981541660ff8316179055604051908152a201610d38565b8880fd5b503461030557806003193601126103055760206001600160a01b0360745416604051908152f35b503461030557602036600319011261030557606e546064039060648211610e1857602061097c60646103d4856004356129d4565b634e487b7160e01b81526011600452602490fd5b503461030557602036600319011261030557610e46612457565b6001600160a01b0390610e5e82606a54163314612a33565b1680600052606d602052604060002060ff1981541690557fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160008152a280f35b50346103055760203660031901126103055760406020916001600160a01b03610eca612457565b168152603383522054604051908152f35b503461030557602036600319011261030557610ef5612457565b6001600160a01b0390610f0d8260685416331461293c565b166001600160a01b0319606a541617606a5580f35b503461030557806003193601126103055760206001600160a01b03606b5416604051908152f35b5034610305576020908160031936011261030557600435610f7260ff60745460a81c1615612667565b610f7d8115156125f8565b610f8781336138c2565b81836064610f9784606f546129d4565b0460646001600160a01b03610fba8160695416610fb48589612a07565b90613ae1565b6066541691604051948593849263ec32e6df60e01b84526004840152630784ce0060248401523360448401525af19283156108bc5792611029575b506040519081527fc1af970349bc805b72c8d6b943b259baa88e58e11438cd81833301aa4b58455d833392a2604051908152f35b9091508281813d8311611051575b61104181836125d6565b810103126108b057519038610ff5565b503d611037565b5034610305578060031936011261030557602060ff60745460a81c166040519015158152f35b5034610305576020366003190112610305576110986124b5565b6110ae6001600160a01b036069541633146126fb565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000060745492151560a01b1691161760745580f35b5034610305576020366003190112610305577f62af4b39fdadd951e167a6f82ba41fb16549cf271ffb69aef3f4717b27c031c86004356111446001600160a01b0360685416331461293c565b80607255607054610628607154604051938493846040919493926060820195825260208201520152565b503461030557806003193601126103055760206001600160a01b0360665416604051908152f35b503461030557806003193601126103055760206001600160a01b0360695416604051908152f35b503461030557806003193601126103055760206001600160a01b0360675416604051908152f35b5034610305578060031936011261030557602060ff60745460a01c166040519015158152f35b503461030557806003193601126103055760206001600160a01b03606a5416604051908152f35b5034610305576020806003193601126113535761124b612457565b6001600160a01b038091611264826069541633146126fb565b1691606b5492846001600160a01b0319948286821617606b551617604051630dfe168160e01b81528281600481855afa90811561134857869161132b575b5083606554841c16848216146000146113235750816004916040519283809263d21220a760e01b82525afa9182156113185785926112eb575b50505b1690606c541617606c5580f35b61130a9250803d10611311575b61130281836125d6565b810190612a14565b38806112db565b503d6112f8565b6040513d87823e3d90fd5b9150506112de565b6113429150833d85116113115761130281836125d6565b386112a2565b6040513d88823e3d90fd5b5080fd5b50346103055780600319360112610305576020606f54604051908152f35b50346103055760203660031901126103055760ff60406020926001600160a01b0361139e612457565b168152606d84522054166040519015158152f35b5034610305576040366003190112610305576109529060406113d2612457565b913381526034602052206001600160a01b0382166000526020526113fd602435604060002054612644565b90336139df565b50346103055760e03660031901126103055761141e612457565b9061142761246d565b6044356001600160a01b03811681036108b057606435906001600160a01b03821682036108b057608435926001600160a01b03841684036108b05760a435926001600160a01b03841684036108b05760c4356001600160a01b03811681036108b05786549560ff8760081c161596878098611afb575b8015611ae4575b15611a795760ff198116600117895587611a68575b50604051986114c78a6125ba565b600b8a527f457363726f77656420524100000000000000000000000000000000000000000060208b0152604051996114fe8b6125ba565b60038b526278524160e81b60208c015261152760ff8b5460081c1661152281613e55565b613e55565b80519067ffffffffffffffff8211611a54578190611546603654612556565b601f81116119ab575b50602090601f8311600114611923578c92611918575b50508160011b916000199060031b1c1916176036555b895167ffffffffffffffff811161190457611597603754612556565b9a601f8c11611867575b8a809c5098999a50602090601f83116001146117ba57946001600160a01b03809b8180978160449c9860209f9e9c988f9c839982918f926117af575b50508160011b916000199060031b1c1916176037555b7fffffffffffffffff0000000000000000000000000000000000000000ffffffff77ffffffffffffffffffffffffffffffffffffffff000000006065549260201b169116179889606555169e8f97816066549d8e9a6001600160a01b0319809c16176066551689606754161760675516876068541617606855168560695416176069551683606a541617606a55169060745416176074556032606e556064606f556212750060705562278d00607155629e3400607255604051978896879563095ea7b360e01b8752161760048501526000196024850152861c165af180156104dc57611790575b5060008052606d6020526040600020600160ff1982541617905560007fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a261172a30613e06565b61173e6001600160a01b0360675416613e06565b6117526001600160a01b0360695416613e06565b6117595780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b6117a89060203d6020116104d5576104c681836125d6565b50386116da565b0151905038806115dd565b9060378a9b969798999b527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae918a5b601f198516811061184c57508a9994966001600160a01b03809d9993978160209e9a60018960449f9a99849d859b99869a601f19811610611833575b505050811b016037556115f3565b015160001960f88460031b161c19169055388080611825565b8183015184558e9b50600190930192602092830192016117e9565b60378b52601f820160051c7f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae01602083106118dd575b601f8d0160051c7f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae0181106118d257506115a1565b8b815560010161189d565b507f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae61189d565b634e487b7160e01b8a52604160045260248afd5b015190503880611565565b925060368c527f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b8908c935b601f1984168510611990576001945083601f19811610611977575b505050811b0160365561157b565b015160001960f88460031b161c19169055388080611969565b8181015183556020948501946001909301929091019061194e565b90915060368c52601f830160051c7f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b80160208410611a2d575b908392915b8d601f830160051c7f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b8018210611a2057505061154f565b81558493506001016119e9565b507f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b86119e4565b634e487b7160e01b8b52604160045260248bfd5b61ffff1916610101178855386114b9565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b50303b1580156114a45750600160ff8216146114a4565b50600160ff82161061149d565b503461030557806003193601126103055760206001600160a01b03606c5416604051908152f35b5034610305578060031936011261030557602060405160128152f35b503461030557611b5a366124c4565b611b6c60ff60745460a81c1615612667565b611b778215156125f8565b611b8182336138c2565b60665460405163430c208160e01b808252336004830152602482018490526020936001600160a01b03939092908416918582604481865afa918215611db5578692611bd3918a91611df1575b50612988565b6040519081523060048201526024810184905291829060449082905afa801561134857611c06918791611dd45750612988565b6064611c1485606f546129d4565b0491611c288160695416610fb48588612a07565b630784ce00804201804211611dc05762093a80809104818102918183041490151715611dc05790829188959493606654169060405190635a2d1e0760e11b8252856004830152604082602481865afa918215611db5578892611d7b575b5011611d14575b50506066541691823b15611d10576044849283604051958694859363b2383e5560e01b8552600485015260248401525af18015610a2857611cf8575b50507fc1af970349bc805b72c8d6b943b259baa88e58e11438cd81833301aa4b58455d906040519283523392a280f35b611d0190612590565b611d0c578238611cc8565b8280fd5b8380fd5b8095929394953b15611d0c57604483926040519485938492639d507b8b60e01b845289600485015260248401525af18015611d7057611d59575b908187949392611c8c565b611d67909691939296612590565b94909138611d4e565b6040513d89823e3d90fd5b9091506040813d604011611dad575b81611d97604093836125d6565b81010312611da9578801519038611c85565b8780fd5b3d9150611d8a565b6040513d8a823e3d90fd5b634e487b7160e01b88526011600452602488fd5b611deb9150853d87116104d5576104c681836125d6565b38611bcd565b611deb9150843d86116104d5576104c681836125d6565b50346103055760203660031901126103055760406020916001600160a01b03611e2f612457565b168152607383522054604051908152f35b503461030557602036600319011261030557611e5a612457565b6001600160a01b0390611e728260685416331461293c565b166001600160a01b0319606954161760695580f35b5034610305576020366003190112610305576020610b4d611ea6612457565b61284b565b503461030557606036600319011261030557611ec5612457565b90611ece61246d565b6040604435926001600160a01b038516815260346020528181203382526020522054926000198403611f05575b6109529350613bf0565b828410611f2157611f1c83610952950333836139df565b611efb565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b503461030557806003193601126103055760206065546001600160a01b0360405191831c168152f35b50346103055760203660031901126103055760043563ffffffff811680910361135357611fc86001600160a01b036069541633146126fb565b63ffffffff19606554161760655580f35b50346103055780600319360112610305576020603554604051908152f35b5034610305576020366003190112610305576120116124b5565b6120276001600160a01b036069541633146126fb565b7fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff75ff00000000000000000000000000000000000000000060745492151560a81b1691161760745580f35b503461030557602080600319360112611353576004359061209b60ff60745460a81c1615612667565b6120ac6120a73361284b565b612697565b6120b78215156125f8565b6065546040516323b872dd60e01b81523360048201523060248201526044810184905291908190839060649082908890851c6001600160a01b03165af1918215612156577fa428517b481b65176e7c35a57b564d5cf943c8462468b8a0f025fa689173f90192612139575b5061212d8333613ae1565b6040519283523392a280f35b61214f90823d84116104d5576104c681836125d6565b5038612122565b6040513d86823e3d90fd5b50346103055760403660031901126103055761217b612457565b6001600160a01b03168152607360205260408120805460243592908310156103055760806121a98484612483565b508054906001810154906003600282015491015491604051938452602084015260408301526060820152f35b5034610305578060031936011261030557602063ffffffff60655416604051908152f35b503461030557604036600319011261030557610952612216612457565b60243590336139df565b5034610305576020366003190112610305576004356122408115156125f8565b61224a81336138c2565b33825260736020526040822080549061226560725442612644565b90604051916080830183811067ffffffffffffffff82111761232b57604052848352602083014281526040840191825260608401928584526801000000000000000086101561231757856122be91600182018155612483565b9490946123035751845551600184015551600283015551600390910155337f7d9230ebb47980ddc758fe4e69ea83a89dafbceb45bd45934798477baa5776688480a480f35b634e487b7160e01b88526004889052602488fd5b634e487b7160e01b88526041600452602488fd5b634e487b7160e01b87526041600452602487fd5b82346103055780600319360112610305576036548161235d82612556565b808552916020916001918281169081156123e1575060011461238957610bb386610ba7818803826125d6565b9350603684527f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b85b8385106123ce57505050508101602001610ba782610bb385610b97565b80548686018401529382019381016123b1565b9050869550610bb396935060209250610ba794915060ff191682840152151560051b820101929385610b97565b6020808252825181830181905290939260005b82811061244357505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501612421565b600435906001600160a01b03821682036108b057565b602435906001600160a01b03821682036108b057565b805482101561249f5760005260206000209060021b0190600090565b634e487b7160e01b600052603260045260246000fd5b6004359081151582036108b057565b60409060031901126108b0576004359060243590565b9181601f840112156108b05782359167ffffffffffffffff83116108b0576020808501948460051b0101116108b057565b60406003198201126108b05767ffffffffffffffff916004358381116108b05782612538916004016124da565b939093926024359182116108b057612552916004016124da565b9091565b90600182811c92168015612586575b602083101461257057565b634e487b7160e01b600052602260045260246000fd5b91607f1691612565565b67ffffffffffffffff81116125a457604052565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176125a457604052565b90601f8019910116810190811067ffffffffffffffff8211176125a457604052565b156125ff57565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a2021203e2030000000000000000000000000000000000000006044820152606490fd5b9190820180921161265157565b634e487b7160e01b600052601160045260246000fd5b1561266e57565b60405162461bcd60e51b81526020600482015260016024820152600560fc1b6044820152606490fd5b1561269e57565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a202141555448000000000000000000000000000000000000006044820152606490fd5b908160209103126108b0575180151581036108b05790565b1561270257565b60405162461bcd60e51b815260206004820152600560248201527f214d5349470000000000000000000000000000000000000000000000000000006044820152606490fd5b6000808052606d60209081527fda90043ba5b4096ba14704bc227ab0d3167da15b887e62ab2e76e37daa7113565460ff16612844576001600160a01b0360248282606754166040519283809263aa79979b60e01b82528860048301525afa908115612156578491612827575b5061281c578183916074541660246040518094819363134cbf4f60e11b83528160048401525af19182156104dc5783926127ff575b50506127f15790565b506127fa613dbe565b600190565b6128159250803d106104d5576104c681836125d6565b38806127e8565b5050506127fa613dbe565b61283e9150833d85116104d5576104c681836125d6565b386127b3565b5050600190565b6001600160a01b039081811691600092808452602091606d835260ff6040862054166129325760248382606754166040519283809263aa79979b60e01b82528760048301525afa908115611348578691612915575b50612908578491602484926074541691604051948593849263134cbf4f60e11b845260048401525af19182156121565784926128eb575b50506128e1575090565b6127fa9150613e06565b6129019250803d106104d5576104c681836125d6565b38806128d7565b5050506127fa9150613e06565b61292c9150843d86116104d5576104c681836125d6565b386128a0565b5050505050600190565b1561294357565b60405162461bcd60e51b815260206004820152600d60248201527f78546f6b656e3a202141757468000000000000000000000000000000000000006044820152606490fd5b1561298f57565b60405162461bcd60e51b815260206004820152601760248201527f78546f6b656e3a207665206e6f7420617070726f7665640000000000000000006044820152606490fd5b8181029291811591840414171561265157565b81156129f1570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161265157565b908160209103126108b057516001600160a01b03811681036108b05790565b15612a3a57565b60405162461bcd60e51b815260206004820152603d60248201527f78546f6b656e3a204f6e6c79207468652077686974656c697374696e67206f7060448201527f657261746f722063616e2063616c6c20746869732066756e6374696f6e0000006064820152608490fd5b919081101561249f5760051b0190565b356001600160a01b03811681036108b05790565b6000913383526020607381526040808520548015159081612ee7575b5015612ea45733855260738252612afe84828720612483565b509485549384151580612e97575b15612e53576001968781015491838255612b2860705484612644565b4210612e1857612c8757600201544210612bdb5750606554825163a9059cbb60e01b815233600482015260248101869052919084908390821c6001600160a01b0316818481604481015b03925af1908115612bd05750907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb76939291612bb3575b50519283523392a390565b612bc990833d85116104d5576104c681836125d6565b5038612ba8565b8351903d90823e3d90fd5b606e54906064612beb83886129d4565b04916064036064811161054b57612c3484936064612c2d612c248a96612c1e612c17612b72988f6129d4565b9142612a07565b906129d4565b607254906129e7565b0490612644565b6001600160a01b03612c4e8160695416610fb4848c612a07565b606554841c1690865195868094819363a9059cbb60e01b83523360048401602090939291936001600160a01b0360408201951681520152565b5060715442612c968284612644565b11612d4357505080836001600160a01b0360665416606485518094819363ec32e6df60e01b83528a6004840152630784ce0060248401523360448401525af18015612d3957612d0f575b5050907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb7691519283523392a390565b8390813d8311612d32575b612d2481836125d6565b810103126103055780612ce0565b503d612d1a565b83513d84823e3d90fd5b606f54916064612d5384896129d4565b049260640360648111612e0457926064612c2d8894612d7d612d8295612c1e612c178b9a8f6129d4565b6129e7565b60646001600160a01b03612d9e8160695416610fb4858c612a07565b60665416918651948593849263ec32e6df60e01b84526004840152630784ce0060248401523360448401525af18015612d3957612d0f575050907f902061c3e3f4d419563154f2c22ef4847f185919d82ff921a64559c1dc83bb7691519283523392a390565b634e487b7160e01b85526011600452602485fd5b50505050907fcda231b62bdbcfdebaec108470aea3eb3fcc5ebe00d79b6e252850d4bf5c60b591612e498433613ae1565b519283523392a390565b825162461bcd60e51b815260048101859052601460248201527f78546f6b656e3a205665737420216163746976650000000000000000000000006044820152606490fd5b5085600388015414612b0c565b60649250519062461bcd60e51b82526004820152601360248201527f78546f6b656e3a205665737420216578697374000000000000000000000000006044820152fd5b600019810191508111612efd5784111538612ae5565b634e487b7160e01b86526011600452602486fd5b67ffffffffffffffff81116125a45760051b60200190565b80511561249f5760200190565b80516001101561249f5760400190565b604080519067ffffffffffffffff60608301818111848210176125a45782526002835260209081840192803685376065549463ffffffff908187169081612f8c82612f29565b5260009687612f9a83612f36565b526001600160a01b039586606b5416898751809263883bdbfd60e01b82526004958c60249889850190828a8701525180915260448501929186905b82821061389e575050505082809103915afa918215613894578a92613785575b505061300a61300382612f36565b5191612f29565b5160060b9060060b03667fffffffffffff1993667fffffffffffff8213858312176132875760030b9060060b811561377357600019948114828614166132875781810560020b918a82129182613764575b5050613752575b60020b8881121561374c57600160ff1b811461373a578089035b620d89e8811161371457879695949392918a9160018116156136f85770ffffffffffffffffffffffffffffffffff6ffffcb933bd6fad37aa2d162d1a5940015b1697600282166136ba575b84821661367c575b6008821661363e575b60108216613600575b8b82166135c2575b8116613585575b608090818116613548575b610100811661350b575b61020081166134ce575b6104008116613491575b6108008116613454575b6110008116613417575b61200081166133da575b614000811661339d575b6180008116613360575b620100008116613323575b6202000081166132e7575b620400008116613299575b620800001661324e575b5013613220575b5050509061319c918116156000146132175760ff865b1690851c612644565b166fffffffffffffffffffffffffffffffff81116131e757806131be916129d4565b9381606c5416921c161090506000146131de57906131db916140a0565b90565b6131db91614024565b806131f191613ec7565b9381606c5416921c1610905060001461320e57906131db91613fdf565b6131db91613f56565b60ff6001613193565b9091929450831561323d5750509161319c9184930491388061317d565b634e487b7160e01b88526012905286fd5b915096506b048a170391f7dc42444e8fa29591929394959182810292818404149015171561328757879695949392918a911c9538613176565b634e487b7160e01b8a5260118352838afd5b9850915091929394956d2216e584f5fa1ea926041bedfe98908181029181830414901517156132d557889790821c96959493928b92909161316c565b634e487b7160e01b8b5260118452848bfd5b9850915091929394956e5d6af8dedb81196699c329225ee604908181029181830414901517156132d5579181899897969594938c931c97613161565b9850915091929394956f09aa508b5b7a84e1c677de54f3e99bc9908181029181830414901517156132d5579181899897969594938c931c97613156565b9850915091929394956f31be135f97d08fd981231505542fcfa6908181029181830414901517156132d5579181899897969594938c931c9761314b565b9850915091929394956f70d869a156d2a1b890bb3df62baf32f7908181029181830414901517156132d5579181899897969594938c931c97613141565b9850915091929394956fa9f746462d870fdf8a65dc1f90e061e5908181029181830414901517156132d5579181899897969594938c931c97613137565b9850915091929394956fd097f3bdfd2022b8845ad8f792aa5825908181029181830414901517156132d5579181899897969594938c931c9761312d565b9850915091929394956fe7159475a2c29b7443b29c7fa6e889d9908181029181830414901517156132d5579181899897969594938c931c97613123565b9850915091929394956ff3392b0822b70005940c7a398e4b70f3908181029181830414901517156132d5579181899897969594938c931c97613119565b9850915091929394956ff987a7253ac413176f2b074cf7815e54908181029181830414901517156132d5579181899897969594938c931c9761310f565b9850915091929394956ffcbe86c7900a88aedcffc83b479aa3a4908181029181830414901517156132d5579181899897969594938c931c97613105565b9850915091929394956ffe5dee046a99a2a811c461f1969c3053908181029181830414901517156132d5579181899897969594938c931c976130fb565b9750919293949590506fff2ea16466c96a3843ec78b326b528619081810291818304149015171561328757879695949392918a9160801c966130f0565b9850915091929394956fff973b41fa98c081472e6896dfb254c0908181029181830414901517156132d557918a918998979695949360801c976130e9565b9850915091929394956fffcb9843d60f6159c9db58835c926644908181029181830414901517156132d557918a918998979695949360801c976130e1565b9850915091929394956fffe5caca7e10e4e61c3624eaa0941cd0908181029181830414901517156132d557918a918998979695949360801c976130d8565b9850915091929394956ffff2e50f5f656932ef12357cf3c7fdcc908181029181830414901517156132d557918a918998979695949360801c976130cf565b9850915091929394956ffff97272373d413259a46990580e213a908181029181830414901517156132d557918a918998979695949360801c976130c7565b70ffffffffffffffffffffffffffffffffff600160801b6130bc565b865162461bcd60e51b81528084018a9052600181860152601560fa1b6044820152606490fd5b50634e487b7160e01b88526011905286fd5b8061307c565b627fffff19811461373a578301613062565b0760060b15159050388061305b565b634e487b7160e01b8a5260128352838afd5b9091503d808b843e61379781846125d6565b820190878383031261386f57825181811161386b5783019282601f8501121561386b578351936137c685612f11565b946137d38b5196876125d6565b8086528c8087019160051b83010191858311613890578d01905b828210613873575050508a81015191821161386b570181601f8201121561386f578051908a8061381c84612f11565b6138288c5191826125d6565b848152019260051b82010192831161386b578a01905b82821061384f575050503880612ff5565b81518a81168103613867578152908a01908a0161383e565b8c80fd5b8b80fd5b8a80fd5b81518060060b810361388c578152908d01908d016137ed565b8f80fd5b8e80fd5b87513d8c823e3d90fd5b919496509282955081908d600194511681520194019101908e94928694928f612fd5565b6001600160a01b03168015613990576138e360ff60745460a81c1615612667565b80600052603360205260406000205491808310613940576020817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92600095858752603384520360408620558060355403603555604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b6001600160a01b03809116918215613a905716918215613a405760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260348252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b6001600160a01b031690811580613bab57613b0460ff60745460a81c1615612667565b15613b59575b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602082613b3c600094603554612644565b6035558484526033825260408420818154019055604051908152a3565b613b61612747565b613b0a575b60405162461bcd60e51b815260206004820152600b60248201527f78546f6b656e3a2021574c0000000000000000000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b916001600160a01b03808416928315613d53571692831580613d0257613c1e60ff60745460a81c1615612667565b15613cee575b5060008281526033602052604081205491808310613c8357604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95876020965260338652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608490fd5b613cf79061284b565b15613b665738613c24565b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608490fd5b60008052606d6020526040600020600160ff1982541617905560007fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a2565b6001600160a01b031680600052606d6020526040600020600160ff198254161790557fcb3169c4c60f8a90f7ce39caf59c74a3bbe0b04a7684a8810f86ef8a1b8abef3602060405160018152a2565b15613e5c57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608490fd5b6000198282099082810292838084109303928084039314613f4d57680100000000000000009183831115613f08570990828211900360c01b910360401c1790565b60405162461bcd60e51b815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152606490fd5b50505060401c90565b600160801b91600019828409928260801b92838086109503948086039514613fd25784831115613f08578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b5050906131db92506129e7565b600019828209908281029283808410930392808403931461401b57600160801b9183831115613f08570990828211900360801b910360801c1790565b50505060801c90565b600160c01b91600019828409928260c01b92838086109503948086039514613fd25784831115613f08578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60001982820990828102928380841093039280840393146140dc57600160c01b9183831115613f08570990828211900360401b910360c01c1790565b50505060c01c9056fea164736f6c6343000817000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.