ERC-20
Overview
Max Total Supply
805,118.219509999999995802 ttts
Holders
3
Market
Price
-
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
402,659.549509999999997899 tttsValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
Token
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import { IEntropyConsumer } from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol"; import { IEntropy } from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol"; import { INonfungiblePositionManager } from "./interfaces/uniswap/INonfungiblePositionManager.sol"; import { IUniswapV3Pool } from "./interfaces/uniswap/IUniswapV3Pool.sol"; import { TransferHelper } from "./libraries/TransferHelper.sol"; import { TickMath } from "./vendor0.8/uniswap/TickMath.sol"; import { FullMath } from "./vendor0.8/uniswap/FullMath.sol"; contract Token is IEntropyConsumer, ERC20, ERC721Holder { using TransferHelper for address; uint32 public constant TWAP_DURATION = 10 minutes; uint256 public constant TWAP_DEVIATION = 300; // 3% uint256 public constant BP = 10_000; uint256 public constant EMERGENCY_PUMP_INTERVAL = 60 days; uint256 public immutable pumpInterval; uint256 public immutable pumpBPS; IEntropy entropy; address public immutable V3Deployer; address public immutable coin; INonfungiblePositionManager public immutable positionManager; IUniswapV3Pool public V3Pool; bool public pumpEnabled; bool public zeroForTokenIn; uint256 public pumpLastTimestamp; uint256 public posTokenId; mapping(uint64 => bool) public pendingRequestIds; constructor( address _entropyAddress, address _coin, address _positionManagerAddress, string memory _name, string memory _symbol, uint _pumpInterval, uint _pumpBPS ) ERC20(_name, _symbol) { entropy = IEntropy(_entropyAddress); coin = _coin; positionManager = INonfungiblePositionManager(_positionManagerAddress); V3Deployer = msg.sender; pumpInterval = _pumpInterval; pumpBPS = _pumpBPS; } event Pump(uint256 pampAmt, uint256 burnAmt); event PumpEnabled(bool enabled, uint64 requestId); event TryToEnablePump(uint64 requestId); error PriceDeviationTooHigh(uint256 deviation); error AmountOfEthSentIsTooSmall(uint256 sent, uint256 minimum); modifier onlyV3Deployer() { require(msg.sender == V3Deployer, "f"); _; } function mint(address account, uint256 amount) external onlyV3Deployer { _mint(account, amount); } /** * @notice Initializes the V3Pool with the specified parameters. * @param zeroForOne If set to true, token0 will be used in the pool, otherwise token1. * @param V3PoolAddress The address of the V3 pool for Token. * @param tokenId The token ID used for position management within the Uniswap V3 pool. */ function initialize( bool zeroForOne, address V3PoolAddress, uint256 tokenId ) external onlyV3Deployer { V3Pool = IUniswapV3Pool(V3PoolAddress); posTokenId = tokenId; zeroForTokenIn = !zeroForOne; pumpLastTimestamp = block.timestamp; } /// @notice Determines if the current time is past the required interval to activate the pump. function isTimeToPump() public view returns (bool) { return block.timestamp > pumpLastTimestamp + pumpInterval; } /// @notice Determines if the current time allows for an emergency activation of the pump. function isTimeToEmergencyEnablePump() public view returns (bool) { return block.timestamp > pumpLastTimestamp + EMERGENCY_PUMP_INTERVAL; } /** * @notice Activates the pump in an emergency, provided the conditions are met. * Requires that the current time is sufficient for an emergency enablement as determined by `isTimeToEmergencyEnablePump`. */ function emergencyEnablePump() external { require(isTimeToEmergencyEnablePump(), "too early"); pumpEnabled = true; pumpLastTimestamp = block.timestamp; emit PumpEnabled(pumpEnabled, 0); } /// @notice Attempts to enable the pump by sending a request to the entropyProvider. /// Requires payment that covers callback gas costs. /// Emits `TryToEnablePump` on success.. /// Checks that the pump has not already been enabled, that the position token ID is set, /// and it is the correct time to pump according to `isTimeToPump`. /// Transfers msg.value to the sponsor's wallet upon successful validation. function tryToEnablePump(bytes32 _userRandomNumber) external payable { require(posTokenId > 0, "n-i"); require(!pumpEnabled, "already enabled"); require(isTimeToPump(), "too early"); (address entropyProvider, uint256 fee) = getEntropyFee(); if (msg.value < fee) { revert AmountOfEthSentIsTooSmall(msg.value, fee); } uint64 requestId = entropy.requestWithCallback{ value: fee }( entropyProvider, _userRandomNumber ); pendingRequestIds[requestId] = true; emit TryToEnablePump(requestId); } /** * @notice This method is called by the entropy contract when a random number is generated. * @dev This callback function is meant to be called only by the authorized entropy contract. * The function decodes the random data, updates the pump's last timestamp, and sets the `pumpEnabled` state. * @param requestId The sequence number of the request. * @param provider The address of the provider that generated the random number. If your app uses multiple providers, * you can use this argument to distinguish which one is calling the app back. * @param randomNumber The generated random number. */ function entropyCallback( uint64 requestId, address provider, bytes32 randomNumber ) internal override { require(pendingRequestIds[requestId], "i-Id"); if (isTimeToPump()) { pumpLastTimestamp = block.timestamp; pumpEnabled = uint256(randomNumber) % 2 == 0; emit PumpEnabled(pumpEnabled, requestId); } delete pendingRequestIds[requestId]; } // It returns the address of the entropy contract which will call the callback. function getEntropy() internal view override returns (address) { return address(entropy); } // This method returns the address of DefaultProvider and entropy fee. function getEntropyFee() public view returns (address entropyProvider, uint256 fee) { entropyProvider = entropy.getDefaultProvider(); fee = entropy.getFee(entropyProvider); } /** * @notice Executes the pump operation which collects fees, performs a swap, and burns the received tokens. * @dev This function encapsulates the entire pump logic which includes: * 1. Collecting accumulated fees from a Uniswap V3 position, * 2. Calculating the pamp amount based on the balance of coin and defined basis points (BPS), * 3. Checking for price deviations before swapping, * 4. Performing the swap at the V3 Pool, * 5. Burning the acquired Tokens. * It first checks if the pumping action is enabled by ensuring `pumpEnabled` is true, then disables pumping to prevent reentrancy. * After collecting fees, it calculates the pump amount and proceeds with a token swap if the amount is greater than zero. * Upon successful execution, a Pump event is emitted with the amount swapped and burned. * Reverts if the pump is not enabled or other preconditions are not met during the process. * Assumes the presence of a INonfungiblePositionManager interface to interact with Uniswap V3 positions. */ function pump() external { require(pumpEnabled, "pump not enabled"); pumpEnabled = false; positionManager.collect( INonfungiblePositionManager.CollectParams({ tokenId: posTokenId, recipient: address(this), amount0Max: type(uint128).max, amount1Max: type(uint128).max }) ); // Calculate the pamp amount based on the coin balance and BPS uint256 pampAmt = (coin.getBalance() * pumpBPS) / BP; if (pampAmt > 0) { _checkPriceDeviation(); // Internal check for price deviation // Perform the swap at the V3 pool V3Pool.swap( address(this), //recipient zeroForTokenIn, int256(pampAmt), zeroForTokenIn ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, new bytes(0) ); // Burn the acquired tokens uint256 burnAmt = balanceOf(address(this)); _burn(address(this), burnAmt); emit Pump(pampAmt, burnAmt); } } function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata /*data*/ ) external { require(msg.sender == address(V3Pool), "i-c"); if (amount0Delta <= 0 && amount1Delta <= 0) { revert("invalid swap"); } uint256 amountToPay = amount0Delta > 0 ? uint256(amount0Delta) : uint256(amount1Delta); coin.safeTransfer(msg.sender, amountToPay); } function _checkPriceDeviation() private view returns (int24 currentTick) { (, currentTick, , , , , ) = V3Pool.slot0(); uint32[] memory secondsAgo = new uint32[](2); secondsAgo[0] = TWAP_DURATION; secondsAgo[1] = 0; (int56[] memory tickCumulatives, ) = V3Pool.observe(secondsAgo); int56 TWAP_DURATIONInt56 = int56(uint56(TWAP_DURATION)); int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0]; int24 avarageTick = int24(tickCumulativesDelta / TWAP_DURATIONInt56); if (tickCumulativesDelta < 0 && (tickCumulativesDelta % TWAP_DURATIONInt56 != 0)) avarageTick--; uint256 deviationBps = _getPriceDiviation( TickMath.getSqrtRatioAtTick(currentTick), TickMath.getSqrtRatioAtTick(avarageTick) ); if (deviationBps > TWAP_DEVIATION) { revert PriceDeviationTooHigh(deviationBps); } } function _getPriceDiviation( uint160 sqrtPrice, uint160 sqrtPriceAvg ) private pure returns (uint256 deviationBps) { uint256 ratio = _getRatio(sqrtPrice); uint256 ratioAvg = _getRatio(sqrtPriceAvg); uint256 ratioDeviation = ratio > ratioAvg ? uint256(ratio - ratioAvg) : uint256(ratioAvg - ratio); deviationBps = FullMath.mulDiv(ratioDeviation, BP, ratioAvg); } function _getRatio(uint160 sqrtPrice) private pure returns (uint256 ratio) { ratio = FullMath.mulDiv(sqrtPrice, sqrtPrice, 1 << 64); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./EntropyStructs.sol"; interface EntropyEvents { event Registered(EntropyStructs.ProviderInfo provider); event Requested(EntropyStructs.Request request); event RequestedWithCallback( address indexed provider, address indexed requestor, uint64 indexed sequenceNumber, bytes32 userRandomNumber, EntropyStructs.Request request ); event Revealed( EntropyStructs.Request request, bytes32 userRevelation, bytes32 providerRevelation, bytes32 blockHash, bytes32 randomNumber ); event RevealedWithCallback( EntropyStructs.Request request, bytes32 userRandomNumber, bytes32 providerRevelation, bytes32 randomNumber ); event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee); event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri); event ProviderFeeManagerUpdated( address provider, address oldFeeManager, address newFeeManager ); event Withdrawal( address provider, address recipient, uint128 withdrawnAmount ); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; contract EntropyStructs { struct ProviderInfo { uint128 feeInWei; uint128 accruedFeesInWei; // The commitment that the provider posted to the blockchain, and the sequence number // where they committed to this. This value is not advanced after the provider commits, // and instead is stored to help providers track where they are in the hash chain. bytes32 originalCommitment; uint64 originalCommitmentSequenceNumber; // Metadata for the current commitment. Providers may optionally use this field to help // manage rotations (i.e., to pick the sequence number from the correct hash chain). bytes commitmentMetadata; // Optional URI where clients can retrieve revelations for the provider. // Client SDKs can use this field to automatically determine how to retrieve random values for each provider. // TODO: specify the API that must be implemented at this URI bytes uri; // The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index). // The contract maintains the invariant that sequenceNumber <= endSequenceNumber. // If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values. uint64 endSequenceNumber; // The sequence number that will be assigned to the next inbound user request. uint64 sequenceNumber; // The current commitment represents an index/value in the provider's hash chain. // These values are used to verify requests for future sequence numbers. Note that // currentCommitmentSequenceNumber < sequenceNumber. // // The currentCommitment advances forward through the provider's hash chain as values // are revealed on-chain. bytes32 currentCommitment; uint64 currentCommitmentSequenceNumber; // An address that is authorized to set / withdraw fees on behalf of this provider. address feeManager; } struct Request { // Storage slot 1 // address provider; uint64 sequenceNumber; // The number of hashes required to verify the provider revelation. uint32 numHashes; // Storage slot 2 // // The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by // eliminating 1 store. bytes32 commitment; // Storage slot 3 // // The number of the block where this request was created. // Note that we're using a uint64 such that we have an additional space for an address and other fields in // this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the // blocks ever generated. uint64 blockNumber; // The address that requested this random number. address requester; // If true, incorporate the blockhash of blockNumber into the generated random value. bool useBlockhash; // If true, the requester will be called back with the generated random value. bool isRequestWithCallback; // There are 2 remaining bytes of free space in this slot. } }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; import "./EntropyEvents.sol"; interface IEntropy is EntropyEvents { // Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters // and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates // the feeInWei). // // chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1. function register( uint128 feeInWei, bytes32 commitment, bytes calldata commitmentMetadata, uint64 chainLength, bytes calldata uri ) external; // Withdraw a portion of the accumulated fees for the provider msg.sender. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdraw(uint128 amount) external; // Withdraw a portion of the accumulated fees for provider. The msg.sender must be the fee manager for this provider. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdrawAsFeeManager(address provider, uint128 amount) external; // As a user, request a random number from `provider`. Prior to calling this method, the user should // generate a random number x and keep it secret. The user should then compute hash(x) and pass that // as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.) // // This method returns a sequence number. The user should pass this sequence number to // their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's // number. The user should then call fulfillRequest to construct the final random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function request( address provider, bytes32 userCommitment, bool useBlockHash ) external payable returns (uint64 assignedSequenceNumber); // Request a random number. The method expects the provider address and a secret random number // in the arguments. It returns a sequence number. // // The address calling this function should be a contract that inherits from the IEntropyConsumer interface. // The `entropyCallback` method on that interface will receive a callback with the generated random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function requestWithCallback( address provider, bytes32 userRandomNumber ) external payable returns (uint64 assignedSequenceNumber); // Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof // against the corresponding commitments in the in-flight request. If both values are validated, this function returns // the corresponding random number. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. function reveal( address provider, uint64 sequenceNumber, bytes32 userRevelation, bytes32 providerRevelation ) external returns (bytes32 randomNumber); // Fulfill a request for a random number. This method validates the provided userRandomness // and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated // and the requestor address is a contract address, this function calls the requester's entropyCallback method with the // sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. // // Anyone can call this method to fulfill a request, but the callback will only be made to the original requester. function revealWithCallback( address provider, uint64 sequenceNumber, bytes32 userRandomNumber, bytes32 providerRevelation ) external; function getProviderInfo( address provider ) external view returns (EntropyStructs.ProviderInfo memory info); function getDefaultProvider() external view returns (address provider); function getRequest( address provider, uint64 sequenceNumber ) external view returns (EntropyStructs.Request memory req); function getFee(address provider) external view returns (uint128 feeAmount); function getAccruedPythFees() external view returns (uint128 accruedPythFeesInWei); function setProviderFee(uint128 newFeeInWei) external; function setProviderFeeAsFeeManager( address provider, uint128 newFeeInWei ) external; function setProviderUri(bytes calldata newUri) external; // Set manager as the fee manager for the provider msg.sender. // After calling this function, manager will be able to set the provider's fees and withdraw them. // Only one address can be the fee manager for a provider at a time -- calling this function again with a new value // will override the previous value. Call this function with the all-zero address to disable the fee manager role. function setFeeManager(address manager) external; function constructUserCommitment( bytes32 userRandomness ) external pure returns (bytes32 userCommitment); function combineRandomValues( bytes32 userRandomness, bytes32 providerRandomness, bytes32 blockHash ) external pure returns (bytes32 combinedRandomness); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; abstract contract IEntropyConsumer { // This method is called by Entropy to provide the random number to the consumer. // It asserts that the msg.sender is the Entropy contract. It is not meant to be // override by the consumer. function _entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) external { address entropy = getEntropy(); require(entropy != address(0), "Entropy address not set"); require(msg.sender == entropy, "Only Entropy can call this function"); entropyCallback(sequence, provider, randomNumber); } // getEntropy returns Entropy contract address. The method is being used to check that the // callback is indeed from Entropy contract. The consumer is expected to implement this method. // Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses function getEntropy() internal view virtual returns (address); // This method is expected to be implemented by the consumer to handle the random number. // It will be called by _entropyCallback after _entropyCallback ensures that the call is // indeed from Entropy contract. function entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) internal virtual; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; interface INonfungiblePositionManager { /// @notice Returns the position information associated with a given token ID. /// @dev Throws if the token ID is not valid. /// @param tokenId The ID of the token that represents the position /// @return nonce The nonce for permits /// @return operator The address that is approved for spending /// @return token0 The address of the token0 for a specific pool /// @return token1 The address of the token1 for a specific pool /// @return fee The fee associated with the pool /// @return tickLower The lower end of the tick range for the position /// @return tickUpper The higher end of the tick range for the position /// @return liquidity The liquidity of the position /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation function positions( uint256 tokenId ) external view returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } /// @notice Creates a new position wrapped in a NFT /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized /// a method does not exist, i.e. the pool is assumed to be initialized. /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata /// @return tokenId The ID of the token that represents the minted position /// @return liquidity The amount of liquidity for this position /// @return amount0 The amount of token0 /// @return amount1 The amount of token1 function mint( MintParams calldata params ) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` /// @param params tokenId The ID of the token for which liquidity is being increased, /// amount0Desired The desired amount of token0 to be spent, /// amount1Desired The desired amount of token1 to be spent, /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check, /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check, /// deadline The time by which the transaction must be included to effect the change /// @return liquidity The new liquidity amount as a result of the increase /// @return amount0 The amount of token0 to acheive resulting liquidity /// @return amount1 The amount of token1 to acheive resulting liquidity function increaseLiquidity( IncreaseLiquidityParams calldata params ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1); struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Decreases the amount of liquidity in a position and accounts it to the position /// @param params tokenId The ID of the token for which liquidity is being decreased, /// amount The amount by which liquidity will be decreased, /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, /// deadline The time by which the transaction must be included to effect the change /// @return amount0 The amount of token0 accounted to the position's tokens owed /// @return amount1 The amount of token1 accounted to the position's tokens owed function decreaseLiquidity( DecreaseLiquidityParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient /// @param params tokenId The ID of the NFT for which tokens are being collected, /// recipient The account that should receive the tokens, /// amount0Max The maximum amount of token0 to collect, /// amount1Max The maximum amount of token1 to collect /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( CollectParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens /// must be collected first. /// @param tokenId The ID of the token that is being burned function burn(uint256 tokenId) external payable; /** * @notice from IERC721 * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import {IUniswapV3PoolImmutables} from './pool/IUniswapV3PoolImmutables.sol'; import {IUniswapV3PoolState} from './pool/IUniswapV3PoolState.sol'; import {IUniswapV3PoolDerivedState} from './pool/IUniswapV3PoolDerivedState.sol'; import {IUniswapV3PoolActions} from './pool/IUniswapV3PoolActions.sol'; import {IUniswapV3PoolOwnerActions} from './pool/IUniswapV3PoolOwnerActions.sol'; import {IUniswapV3PoolErrors} from './pool/IUniswapV3PoolErrors.sol'; import {IUniswapV3PoolEvents} from './pool/IUniswapV3PoolEvents.sol'; /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap 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 IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolErrors, IUniswapV3PoolEvents { }
// 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 IUniswapV3PoolActions { /// @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 /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// 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 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 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 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 Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @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 IUniswapV3FlashCallback#uniswapV3FlashCallback /// @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 IUniswapV3PoolDerivedState { /// @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. /// @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 /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Errors emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolErrors { error LOK(); error TLU(); error TLM(); error TUM(); error AI(); error M0(); error M1(); error AS(); error IIA(); error L(); error F0(); error F1(); }
// 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 IUniswapV3PoolEvents { /// @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 IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() 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); }
// 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 IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) 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); }
// 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 IUniswapV3PoolState { /// @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 /// @return 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. /// @return observationIndex The index of the last oracle observation that was written, /// @return observationCardinality The current maximum number of observations stored in the pool, /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// @return 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 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 /// @return The liquidity at the current price of the pool 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 /// @return liquidityNet how much liquidity changes when the pool price crosses the tick, /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// @return secondsOutside the seconds spent on the other side of the tick from the current tick, /// @return 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 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: GPL-2.0-or-later // https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/TransferHelper.sol pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; library TransferHelper { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom(address token, address from, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "BP-STF"); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.transfer.selector, to, value) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "BP-ST"); } function getBalance(address token) internal view returns (uint256 balance) { bytes memory callData = abi.encodeWithSelector(IERC20.balanceOf.selector, address(this)); (bool success, bytes memory data) = token.staticcall(callData); require(success && data.length >= 32); balance = abi.decode(data, (uint256)); } function getBalanceOf(address token, address target) internal view returns (uint256 balance) { bytes memory callData = abi.encodeWithSelector(IERC20.balanceOf.selector, target); (bool success, bytes memory data) = token.staticcall(callData); require(success && data.length >= 32); balance = abi.decode(data, (uint256)); } function safeApprove(address token, address spender, uint256 amount) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.approve.selector, spender, amount) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "BP-SA"); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits library FullMath { /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv function mulDiv( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = a * b // Compute the product mod 2**256 and mod 2**256 - 1 // then 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 = a * b; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(a, b, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Make sure the result is less than 2**256. // Also prevents denominator == 0 require(denominator > prod1); // Handle non-overflow cases, 256 by 256 division if (prod1 == 0) { assembly { result := div(prod0, denominator) } return result; } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0] // Compute remainder using mulmod uint256 remainder; assembly { remainder := mulmod(a, b, denominator) } // Subtract 256 bit number from 512 bit number assembly { prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. uint256 twos = (0 - denominator) & denominator; // Divide denominator by power of two assembly { denominator := div(denominator, twos) } // Divide [prod1 prod0] by the factors of two assembly { prod0 := div(prod0, twos) } // Shift in bits from prod1 into prod0. For this we need // to flip `twos` such that it is 2**256 / twos. // If twos is zero, then it becomes one assembly { twos := add(div(sub(0, twos), twos), 1) } 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 // correct for four bits. That is, denominator * inv = 1 mod 2**4 uint256 inv = (3 * denominator) ^ 2; // Now use 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. inv *= 2 - denominator * inv; // inverse mod 2**8 inv *= 2 - denominator * inv; // inverse mod 2**16 inv *= 2 - denominator * inv; // inverse mod 2**32 inv *= 2 - denominator * inv; // inverse mod 2**64 inv *= 2 - denominator * inv; // inverse mod 2**128 inv *= 2 - denominator * inv; // 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 * inv; return result; } } /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result function mulDivRoundingUp( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { result = mulDiv(a, b, denominator); if (mulmod(a, b, denominator) > 0) { require(result < type(uint256).max); result++; } } } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.19; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { /// @notice Thrown when the tick passed to #getSqrtRatioAtTick is not between MIN_TICK and MAX_TICK error InvalidTick(); /// @notice Thrown when the ratio passed to #getTickAtSqrtRatio does not correspond to a price between MIN_TICK and MAX_TICK error InvalidSqrtRatio(); /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Given a tickSpacing, compute the maximum usable tick function maxUsableTick(int24 tickSpacing) internal pure returns (int24) { unchecked { return (MAX_TICK / tickSpacing) * tickSpacing; } } /// @notice Given a tickSpacing, compute the minimum usable tick function minUsableTick(int24 tickSpacing) internal pure returns (int24) { unchecked { return (MIN_TICK / tickSpacing) * tickSpacing; } } /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (currency1/currency0) /// at the given tick function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { unchecked { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); if (absTick > uint256(int256(MAX_TICK))) revert InvalidTick(); 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; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); } } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { unchecked { // second inequality must be < because the price can never reach the price at the max tick if (sqrtPriceX96 < MIN_SQRT_RATIO || sqrtPriceX96 >= MAX_SQRT_RATIO) revert InvalidSqrtRatio(); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_entropyAddress","type":"address"},{"internalType":"address","name":"_coin","type":"address"},{"internalType":"address","name":"_positionManagerAddress","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_pumpInterval","type":"uint256"},{"internalType":"uint256","name":"_pumpBPS","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"sent","type":"uint256"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"AmountOfEthSentIsTooSmall","type":"error"},{"inputs":[],"name":"InvalidTick","type":"error"},{"inputs":[{"internalType":"uint256","name":"deviation","type":"uint256"}],"name":"PriceDeviationTooHigh","type":"error"},{"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":false,"internalType":"uint256","name":"pampAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnAmt","type":"uint256"}],"name":"Pump","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"},{"indexed":false,"internalType":"uint64","name":"requestId","type":"uint64"}],"name":"PumpEnabled","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":false,"internalType":"uint64","name":"requestId","type":"uint64"}],"name":"TryToEnablePump","type":"event"},{"inputs":[],"name":"BP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_PUMP_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TWAP_DEVIATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TWAP_DURATION","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"V3Deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"V3Pool","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"sequence","type":"uint64"},{"internalType":"address","name":"provider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyEnablePump","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getEntropyFee","outputs":[{"internalType":"address","name":"entropyProvider","type":"address"},{"internalType":"uint256","name":"fee","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":"bool","name":"zeroForOne","type":"bool"},{"internalType":"address","name":"V3PoolAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isTimeToEmergencyEnablePump","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTimeToPump","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"pendingRequestIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"posTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionManager","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pump","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pumpBPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pumpEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pumpInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pumpLastTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"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":"bytes32","name":"_userRandomNumber","type":"bytes32"}],"name":"tryToEnablePump","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"zeroForTokenIn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61012060405234620003fa5762002817803803806200001e81620003ff565b928339810160e082820312620003fa57620000398262000425565b916020926200004a84830162000425565b620000586040840162000425565b606084015190956001600160401b03959091868111620003fa5781620000809187016200043a565b90608086015190878211620003fa576200009c9187016200043a565b9560c060a0870151960151968251828111620002fa576003918254916001958684811c94168015620003ef575b88851014620003d9578190601f9485811162000383575b5088908583116001146200031c5760009262000310575b505060001982861b1c191690861b1783555b8051938411620002fa5760049586548681811c91168015620002ef575b82821014620002da578381116200028f575b508092851160011462000221575093839491849260009562000215575b50501b92600019911b1c19161790555b600580546001600160a01b0319166001600160a01b0393841617905560e052929092166101009081523360c05260809290925260a05260405161236a9182620004ad83396080518281816104d90152818161073001528181610a960152610d2a015260a0518281816108ea0152610ea9015260c0518281816109de01528181610c4d0152611615015260e0518281816102b101528181610e61015261180b0152518181816109400152610e070152f35b01519350388062000155565b92919084601f1981168860005285600020956000905b8983831062000274575050501062000259575b50505050811b01905562000165565b01519060f884600019921b161c19169055388080806200024a565b85870151895590970196948501948893509081019062000237565b87600052816000208480880160051c820192848910620002d0575b0160051c019087905b828110620002c357505062000138565b60008155018790620002b3565b92508192620002aa565b602288634e487b7160e01b6000525260246000fd5b90607f169062000126565b634e487b7160e01b600052604160045260246000fd5b015190503880620000f7565b90889350601f19831691876000528a6000209260005b8c8282106200036c575050841162000353575b505050811b01835562000109565b015160001983881b60f8161c1916905538808062000345565b8385015186558c9790950194938401930162000332565b90915085600052886000208580850160051c8201928b8610620003cf575b918a91869594930160051c01915b828110620003bf575050620000e0565b600081558594508a9101620003af565b92508192620003a1565b634e487b7160e01b600052602260045260246000fd5b93607f1693620000c9565b600080fd5b6040519190601f01601f191682016001600160401b03811183821017620002fa57604052565b51906001600160a01b0382168203620003fa57565b919080601f84011215620003fa5782516001600160401b038111620002fa5760209062000470601f8201601f19168301620003ff565b92818452828287010111620003fa5760005b8181106200049857508260009394955001015290565b85810183015184820184015282016200048256fe608080604052600436101561001357600080fd5b60003560e01c90816306fdde03146118c4575080630780fc2a14611885578063095ea7b31461185f5780630a1926321461183a57806311df9995146117f557806311ea5441146117cc578063150b7a021461173e57806318160ddd1461172057806323b872dd1461166257806325d4995e1461164457806325de6036146115ff5780632d971e63146115c9578063313ce567146115ad578063395093511461155c578063395ea61b14610d5957806339986e8114610d0f57806340c10f1914610c215780634f590f0814610bfb57806352a5f1f814610a3457806353806ec7146109a957806370a082311461096f578063791b98bc1461092a578063879ac8f81461090d5780638a6af663146108d25780638c7b6e921461070357806395d89b41146105f15780639cfdbd5e146105d4578063a457c2d71461052d578063a9059cbb146104fc578063dce0e92b146104c1578063dd62ed3e14610470578063e3767dd61461044a578063e6dacb921461042d578063ebd2ee7b146103ba578063fa461e33146101f7578063fbd09a7c146101d95763fc1afd20146101b657600080fd5b346101d45760003660031901126101d4576020600754604051908152f35b600080fd5b346101d45760003660031901126101d4576020600854604051908152f35b346101d45760603660031901126101d457602460043581356044356001600160401b038082116101d457366023830112156101d45781600401359081116101d4573691018401116101d4576006546001600160a01b031633036103905760008213801580610385575b61035257600092839290911561034b57505b6040805163a9059cbb60e01b602080830191825233888401908152908101949094529290916102ac9183910103601f198101835282611a21565b5190827f00000000000000000000000000000000000000000000000000000000000000005af16102da611ed8565b81610314575b50156102e857005b60649060056040519162461bcd60e51b8352602060048401528201526410940b54d560da1b6044820152fd5b8051801592508215610329575b5050826102e0565b81925090602091810103126101d45760206103449101611e74565b8280610321565b9050610272565b60405162461bcd60e51b815260206004820152600c818601526b0696e76616c696420737761760a41b6044820152606490fd5b506000821315610260565b60405162461bcd60e51b81526020600482015260038185015262692d6360e81b6044820152606490fd5b346101d45760003660031901126101d4576103db6103d6611d0a565b611d1f565b7f42886893c2c02827643a75f50ecf4556313dada98ba97caf3c36f857829f6d2c6040600160a01b60ff60a01b196006541617806006554260075560ff82519160a01c161515815260006020820152a1005b346101d45760003660031901126101d457602060405161012c8152f35b346101d45760003660031901126101d457602060ff60065460a01c166040519015158152f35b346101d45760403660031901126101d4576104896119da565b6104916119f0565b9060018060a01b038091166000526001602052604060002091166000526020526020604060002054604051908152f35b346101d45760003660031901126101d45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346101d45760403660031901126101d4576105226105186119da565b6024359033611a6a565b602060405160018152f35b346101d45760403660031901126101d4576105466119da565b60243590336000526001602052604060002060018060a01b038216600052602052604060002054918083106105815761052292039033611bd8565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346101d45760003660031901126101d45760206040516127108152f35b346101d45760003660031901126101d457604051600060045490600182811c918184169182156106f9575b60209485851084146106e35785879486865291826000146106c3575050600114610666575b5061064e92500383611a21565b610662604051928284938452830190611984565b0390f35b84915060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b906000915b8583106106ab57505061064e935082010185610641565b80548389018501528794508693909201918101610694565b60ff19168582015261064e95151560051b85010192508791506106419050565b634e487b7160e01b600052602260045260246000fd5b92607f169261061c565b6020806003193601126101d457600854156108a85760ff60065460a01c166108725761075c6107556007547f000000000000000000000000000000000000000000000000000000000000000090611a5d565b4211611d1f565b610764611d57565b90813410610853576005546040516319cb825f60e01b81526001600160a01b03928316600480830191909152356024820152928492849260449284929091165af190811561084757600091610801575b7f31cc170ef68cc97ae6f7f5530435b792096d77885d0d3d0a3ed2d2e7ba136906836001600160401b03841680600052600982526040600020600160ff19825416179055604051908152a1005b90508181813d8311610840575b6108188183611a21565b810103126101d45751906001600160401b03821682036101d457906001600160401b036107b4565b503d61080e565b6040513d6000823e3d90fd5b604051633ce6d0ef60e21b815234600482015260248101839052604490fd5b6064906040519062461bcd60e51b82526004820152600f60248201526e185b1c9958591e48195b98589b1959608a1b6044820152fd5b6064906040519062461bcd60e51b8252600482015260036024820152626e2d6960e81b6044820152fd5b346101d45760003660031901126101d45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346101d45760003660031901126101d45760206040516102588152f35b346101d45760003660031901126101d4576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101d45760203660031901126101d4576001600160a01b036109906119da565b1660005260006020526020604060002054604051908152f35b346101d45760603660031901126101d4576004358015908115036101d4576109cf6119f0565b906001600160a01b03610a05337f0000000000000000000000000000000000000000000000000000000000000000831614611cda565b60068054604435600855600161ff0160a01b031916919093161760a89190911b60ff60a81b1617905542600755005b346101d45760603660031901126101d457610a4d6119c4565b610a556119f0565b506005546001600160a01b03168015610bb6573303610b65576001600160401b031680600052600960205260ff6040600020541615610b3a57610abb6007547f000000000000000000000000000000000000000000000000000000000000000090611a5d565b4211610ada575b6000908152600960205260409020805460ff19169055005b426007557f42886893c2c02827643a75f50ecf4556313dada98ba97caf3c36f857829f6d2c604060065460ff60a01b6001604435161560a01b169060ff60a01b1916178060065560ff82519160a01c1615158152836020820152a1610ac2565b606460405162461bcd60e51b81526020600482015260046024820152631a4b525960e21b6044820152fd5b60405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f74207365740000000000000000006044820152606490fd5b346101d45760003660031901126101d457602060ff60065460a81c166040519015158152f35b346101d45760403660031901126101d457610c3a6119da565b602435906001600160a01b0390610c74337f0000000000000000000000000000000000000000000000000000000000000000841614611cda565b16908115610cca577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602082610cae600094600254611a5d565b60025584845283825260408420818154019055604051908152a3005b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b346101d45760003660031901126101d4576020610d4f6007547f000000000000000000000000000000000000000000000000000000000000000090611a5d565b4211604051908152f35b346101d45760003660031901126101d45760065460ff8160a01c16156115245760ff60a01b191660065560085460405190608082016001600160401b0381118382101761126857604090815290825230602083019081526001600160801b0383830181815260608501828152845163fc6f786560e01b81529551600487015292516001600160a01b0390811660248701529051821660448601529151166064840152829060849082906000907f0000000000000000000000000000000000000000000000000000000000000000165af18015610847576114f9575b5060008060405160208101906370a0823160e01b825230602482015260248152610e5d81611a06565b51907f00000000000000000000000000000000000000000000000000000000000000005afa610e8a611ed8565b90806114ed575b156101d4576020818051810103126101d457602001517f0000000000000000000000000000000000000000000000000000000000000000908181029181830414901517156112d2576127108104610ee457005b600654604051633850c7bd60e01b815260e0816004816001600160a01b0386165afa90811561084757600091611461575b50604051610f2281611a06565b6002815260208101906040368337610258610f3c82611e98565b526000610f4882611ebb565b5260405163883bdbfd60e01b8152602060048201529051602482018190529091829160448301919060005b81811061144257506000939283900391508290506001600160a01b0387165afa908115610847576000916112f9575b50610fb9610faf82611ebb565b5160060b91611e98565b5160060b9003667fffffffffffff198112667fffffffffffff8213176112d25760060b90610258820560020b916000811290816112e8575b506112bb575b9061103361102361101361100d61104b95611fd6565b93611fd6565b926001600160a01b031680611f08565b916001600160a01b031680611f08565b9081808211156112b15761104691611ecb565b611f54565b61012c8111611299575060ff8160a81c168060001461127e576401000276a4915b6040519060208201938285106001600160401b038611176112685760006040946110dd968652818552855196879586948593630251596160e31b8552306004860152151560248501526127108b04604485015260018060a01b0316606484015260a0608484015260a4830190611984565b03926001600160a01b03165af180156108475761123d575b503060005260006020526040600020549030156111ee573060005260006020526040600020549082821061119e57827fddbfb0687fbb06c476f9de1e483e656b4c56516f7580ab8224fbf91c81ed9f51936040933060005260006020520383600020558060025403600255600083518281527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203092a36127108351920482526020820152a1005b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b604090813d8311611261575b6112538183611a21565b810103126101d457816110f5565b503d611249565b634e487b7160e01b600052604160045260246000fd5b73fffd8963efd1fc6a506488495d951d5263988d259161106c565b602490604051906303aa7b4160e61b82526004820152fd5b9061104691611ecb565b627fffff1982146112d25760001990910190610ff7565b634e487b7160e01b600052601160045260246000fd5b61025891500760060b151585610ff1565b3d9150816000823e61130b8282611a21565b60408183810103126101d4578051916001600160401b0383116101d457808201601f8484010112156101d457828201519261134584611e81565b936113536040519586611a21565b808552602085019183850160208360051b8388010101116101d45791602083860101925b60208360051b82880101018410611422575050505060208201516001600160401b0381116101d457818301601f8285010112156101d457808301519260206113be85611e81565b6113cb6040519182611a21565b8581520192810160208560051b8484010101116101d45780820160200192915b60208560051b8284010101841061140757505050505084610fa2565b602080809461141587611e51565b81520194019392506113eb565b8351918260060b83036101d4576020818194829352019401939150611377565b825163ffffffff16845285945060209384019390920191600101610f73565b905060e0813d82116114e5575b8161147b60e09383611a21565b810103126101d45761148c81611e51565b506020810151908160020b82036101d4576114a960408201611e65565b506114b660608201611e65565b506114c360808201611e65565b5060a081015160ff8116036101d45760c06114de9101611e74565b5083610f15565b3d915061146e565b50602081511015610e91565b604090813d831161151d575b61150f8183611a21565b810103126101d45780610e34565b503d611505565b60405162461bcd60e51b815260206004820152601060248201526f1c1d5b5c081b9bdd08195b98589b195960821b6044820152606490fd5b346101d45760403660031901126101d4576105226115786119da565b336000526001602052604060002060018060a01b0382166000526020526115a6602435604060002054611a5d565b9033611bd8565b346101d45760003660031901126101d457602060405160128152f35b346101d45760003660031901126101d4576115e2611d57565b604080516001600160a01b03939093168352602083019190915290f35b346101d45760003660031901126101d4576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101d45760003660031901126101d4576020604051624f1a008152f35b346101d45760603660031901126101d45761167b6119da565b6116836119f0565b6044359060018060a01b03831660005260016020526040600020336000526020526040600020549260001984036116bf575b6105229350611a6a565b8284106116db576116d68361052295033383611bd8565b6116b5565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346101d45760003660031901126101d4576020600254604051908152f35b346101d45760803660031901126101d4576117576119da565b506117606119f0565b506064356001600160401b0381116101d457366023820112156101d45780600401359061178c82611a42565b9161179a6040519384611a21565b80835236602482840101116101d4576000928160246020940184830137010152604051630a85bd0160e11b8152602090f35b346101d45760003660031901126101d4576006546040516001600160a01b039091168152602090f35b346101d45760003660031901126101d4576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101d45760003660031901126101d4576020611855611d0a565b6040519015158152f35b346101d45760403660031901126101d45761052261187b6119da565b6024359033611bd8565b346101d45760203660031901126101d4576001600160401b036118a66119c4565b166000526009602052602060ff604060002054166040519015158152f35b346101d45760003660031901126101d457600060035490600182811c9181841691821561197a575b60209485851084146106e35785879486865291826000146106c357505060011461191d575061064e92500383611a21565b84915060036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b906000915b85831061196257505061064e935082010185610641565b8054838901850152879450869390920191810161194b565b92607f16926118ec565b919082519283825260005b8481106119b0575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161198f565b600435906001600160401b03821682036101d457565b600435906001600160a01b03821682036101d457565b602435906001600160a01b03821682036101d457565b606081019081106001600160401b0382111761126857604052565b90601f801991011681019081106001600160401b0382111761126857604052565b6001600160401b03811161126857601f01601f191660200190565b919082018092116112d257565b6001600160a01b03908116918215611b855716918215611b3457600082815280602052604081205491808310611ae057604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03908116918215611c895716918215611c395760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b15611ce157565b60405162461bcd60e51b81526020600482015260016024820152603360f91b6044820152606490fd5b600754624f1a0081018091116112d257421190565b15611d2657565b60405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606490fd5b6005546040516320bba64360e21b815291906020906001600160a01b03908116908285600481855afa94851561084757600095611e17575b5082906024866040519485938492631711922960e31b84521660048301525afa91821561084757600092611dcc575b50506001600160801b031690565b81813d8311611e10575b611de08183611a21565b81010312611e0c5751906001600160801b0382168203611e0957506001600160801b0338611dbe565b80fd5b5080fd5b503d611dd6565b8381819793973d8311611e4a575b611e2f8183611a21565b81010312611e0c5751908582168203611e0957509382611d8f565b503d611e25565b51906001600160a01b03821682036101d457565b519061ffff821682036101d457565b519081151582036101d457565b6001600160401b0381116112685760051b60200190565b805115611ea55760200190565b634e487b7160e01b600052603260045260246000fd5b805160011015611ea55760400190565b919082039182116112d257565b3d15611f03573d90611ee982611a42565b91611ef76040519384611a21565b82523d6000602084013e565b606090565b81810291906000198282099183808410930391838303936801000000000000000093858511156101d45714611f4a570990828211900360c01b910360401c1790565b5050505060401c90565b906127108083029190600019818509938380861095039480860395868511156101d45714611fce579082910981806000031680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b505091500490565b60020b60008112156123575780600003905b620d89e88211612345576001821615612333576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b169160028116612317575b600481166122fb575b600881166122df575b601081166122c3575b602081166122a7575b6040811661228b575b608090818116612270575b6101008116612255575b610200811661223a575b610400811661221f575b6108008116612204575b61100081166121e9575b61200081166121ce575b61400081166121b3575b6180008116612198575b62010000811661217d575b620200008116612163575b620400008116612149575b620800001661212e575b50600012612109575b63ffffffff8116612101576000905b60201c60ff91909116016001600160a01b031690565b6001906120eb565b801561211857600019046120dc565b634e487b7160e01b600052601260045260246000fd5b6b048a170391f7dc42444e8fa26000929302901c91906120d3565b6d2216e584f5fa1ea926041bedfe98909302811c926120c9565b926e5d6af8dedb81196699c329225ee60402811c926120be565b926f09aa508b5b7a84e1c677de54f3e99bc902811c926120b3565b926f31be135f97d08fd981231505542fcfa602811c926120a8565b926f70d869a156d2a1b890bb3df62baf32f702811c9261209e565b926fa9f746462d870fdf8a65dc1f90e061e502811c92612094565b926fd097f3bdfd2022b8845ad8f792aa582502811c9261208a565b926fe7159475a2c29b7443b29c7fa6e889d902811c92612080565b926ff3392b0822b70005940c7a398e4b70f302811c92612076565b926ff987a7253ac413176f2b074cf7815e5402811c9261206c565b926ffcbe86c7900a88aedcffc83b479aa3a402811c92612062565b926ffe5dee046a99a2a811c461f1969c305302811c92612058565b916fff2ea16466c96a3843ec78b326b528610260801c9161204d565b916fff973b41fa98c081472e6896dfb254c00260801c91612044565b916fffcb9843d60f6159c9db58835c9266440260801c9161203b565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c91612032565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91612029565b916ffff97272373d413259a46990580e213a0260801c91612020565b6001600160881b03600160801b612015565b6040516333a3bdff60e21b8152600490fd5b80611fe856fea164736f6c6343000813000a00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e200000000000000000000000077dcc9b09c6ae94cdc726540735682a38e18d69000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000000004544573740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047474747300000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816306fdde03146118c4575080630780fc2a14611885578063095ea7b31461185f5780630a1926321461183a57806311df9995146117f557806311ea5441146117cc578063150b7a021461173e57806318160ddd1461172057806323b872dd1461166257806325d4995e1461164457806325de6036146115ff5780632d971e63146115c9578063313ce567146115ad578063395093511461155c578063395ea61b14610d5957806339986e8114610d0f57806340c10f1914610c215780634f590f0814610bfb57806352a5f1f814610a3457806353806ec7146109a957806370a082311461096f578063791b98bc1461092a578063879ac8f81461090d5780638a6af663146108d25780638c7b6e921461070357806395d89b41146105f15780639cfdbd5e146105d4578063a457c2d71461052d578063a9059cbb146104fc578063dce0e92b146104c1578063dd62ed3e14610470578063e3767dd61461044a578063e6dacb921461042d578063ebd2ee7b146103ba578063fa461e33146101f7578063fbd09a7c146101d95763fc1afd20146101b657600080fd5b346101d45760003660031901126101d4576020600754604051908152f35b600080fd5b346101d45760003660031901126101d4576020600854604051908152f35b346101d45760603660031901126101d457602460043581356044356001600160401b038082116101d457366023830112156101d45781600401359081116101d4573691018401116101d4576006546001600160a01b031633036103905760008213801580610385575b61035257600092839290911561034b57505b6040805163a9059cbb60e01b602080830191825233888401908152908101949094529290916102ac9183910103601f198101835282611a21565b5190827f000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e25af16102da611ed8565b81610314575b50156102e857005b60649060056040519162461bcd60e51b8352602060048401528201526410940b54d560da1b6044820152fd5b8051801592508215610329575b5050826102e0565b81925090602091810103126101d45760206103449101611e74565b8280610321565b9050610272565b60405162461bcd60e51b815260206004820152600c818601526b0696e76616c696420737761760a41b6044820152606490fd5b506000821315610260565b60405162461bcd60e51b81526020600482015260038185015262692d6360e81b6044820152606490fd5b346101d45760003660031901126101d4576103db6103d6611d0a565b611d1f565b7f42886893c2c02827643a75f50ecf4556313dada98ba97caf3c36f857829f6d2c6040600160a01b60ff60a01b196006541617806006554260075560ff82519160a01c161515815260006020820152a1005b346101d45760003660031901126101d457602060405161012c8152f35b346101d45760003660031901126101d457602060ff60065460a01c166040519015158152f35b346101d45760403660031901126101d4576104896119da565b6104916119f0565b9060018060a01b038091166000526001602052604060002091166000526020526020604060002054604051908152f35b346101d45760003660031901126101d45760206040517f00000000000000000000000000000000000000000000000000000000000002588152f35b346101d45760403660031901126101d4576105226105186119da565b6024359033611a6a565b602060405160018152f35b346101d45760403660031901126101d4576105466119da565b60243590336000526001602052604060002060018060a01b038216600052602052604060002054918083106105815761052292039033611bd8565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b346101d45760003660031901126101d45760206040516127108152f35b346101d45760003660031901126101d457604051600060045490600182811c918184169182156106f9575b60209485851084146106e35785879486865291826000146106c3575050600114610666575b5061064e92500383611a21565b610662604051928284938452830190611984565b0390f35b84915060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b906000915b8583106106ab57505061064e935082010185610641565b80548389018501528794508693909201918101610694565b60ff19168582015261064e95151560051b85010192508791506106419050565b634e487b7160e01b600052602260045260246000fd5b92607f169261061c565b6020806003193601126101d457600854156108a85760ff60065460a01c166108725761075c6107556007547f000000000000000000000000000000000000000000000000000000000000025890611a5d565b4211611d1f565b610764611d57565b90813410610853576005546040516319cb825f60e01b81526001600160a01b03928316600480830191909152356024820152928492849260449284929091165af190811561084757600091610801575b7f31cc170ef68cc97ae6f7f5530435b792096d77885d0d3d0a3ed2d2e7ba136906836001600160401b03841680600052600982526040600020600160ff19825416179055604051908152a1005b90508181813d8311610840575b6108188183611a21565b810103126101d45751906001600160401b03821682036101d457906001600160401b036107b4565b503d61080e565b6040513d6000823e3d90fd5b604051633ce6d0ef60e21b815234600482015260248101839052604490fd5b6064906040519062461bcd60e51b82526004820152600f60248201526e185b1c9958591e48195b98589b1959608a1b6044820152fd5b6064906040519062461bcd60e51b8252600482015260036024820152626e2d6960e81b6044820152fd5b346101d45760003660031901126101d45760206040517f00000000000000000000000000000000000000000000000000000000000013888152f35b346101d45760003660031901126101d45760206040516102588152f35b346101d45760003660031901126101d4576040517f00000000000000000000000077dcc9b09c6ae94cdc726540735682a38e18d6906001600160a01b03168152602090f35b346101d45760203660031901126101d4576001600160a01b036109906119da565b1660005260006020526020604060002054604051908152f35b346101d45760603660031901126101d4576004358015908115036101d4576109cf6119f0565b906001600160a01b03610a05337f000000000000000000000000b2e2b8b7049ad6ac235a648bd8ca71b84bf4b5c0831614611cda565b60068054604435600855600161ff0160a01b031916919093161760a89190911b60ff60a81b1617905542600755005b346101d45760603660031901126101d457610a4d6119c4565b610a556119f0565b506005546001600160a01b03168015610bb6573303610b65576001600160401b031680600052600960205260ff6040600020541615610b3a57610abb6007547f000000000000000000000000000000000000000000000000000000000000025890611a5d565b4211610ada575b6000908152600960205260409020805460ff19169055005b426007557f42886893c2c02827643a75f50ecf4556313dada98ba97caf3c36f857829f6d2c604060065460ff60a01b6001604435161560a01b169060ff60a01b1916178060065560ff82519160a01c1615158152836020820152a1610ac2565b606460405162461bcd60e51b81526020600482015260046024820152631a4b525960e21b6044820152fd5b60405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b6064820152608490fd5b60405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f74207365740000000000000000006044820152606490fd5b346101d45760003660031901126101d457602060ff60065460a81c166040519015158152f35b346101d45760403660031901126101d457610c3a6119da565b602435906001600160a01b0390610c74337f000000000000000000000000b2e2b8b7049ad6ac235a648bd8ca71b84bf4b5c0841614611cda565b16908115610cca577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602082610cae600094600254611a5d565b60025584845283825260408420818154019055604051908152a3005b60405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b346101d45760003660031901126101d4576020610d4f6007547f000000000000000000000000000000000000000000000000000000000000025890611a5d565b4211604051908152f35b346101d45760003660031901126101d45760065460ff8160a01c16156115245760ff60a01b191660065560085460405190608082016001600160401b0381118382101761126857604090815290825230602083019081526001600160801b0383830181815260608501828152845163fc6f786560e01b81529551600487015292516001600160a01b0390811660248701529051821660448601529151166064840152829060849082906000907f00000000000000000000000077dcc9b09c6ae94cdc726540735682a38e18d690165af18015610847576114f9575b5060008060405160208101906370a0823160e01b825230602482015260248152610e5d81611a06565b51907f000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e25afa610e8a611ed8565b90806114ed575b156101d4576020818051810103126101d457602001517f0000000000000000000000000000000000000000000000000000000000001388908181029181830414901517156112d2576127108104610ee457005b600654604051633850c7bd60e01b815260e0816004816001600160a01b0386165afa90811561084757600091611461575b50604051610f2281611a06565b6002815260208101906040368337610258610f3c82611e98565b526000610f4882611ebb565b5260405163883bdbfd60e01b8152602060048201529051602482018190529091829160448301919060005b81811061144257506000939283900391508290506001600160a01b0387165afa908115610847576000916112f9575b50610fb9610faf82611ebb565b5160060b91611e98565b5160060b9003667fffffffffffff198112667fffffffffffff8213176112d25760060b90610258820560020b916000811290816112e8575b506112bb575b9061103361102361101361100d61104b95611fd6565b93611fd6565b926001600160a01b031680611f08565b916001600160a01b031680611f08565b9081808211156112b15761104691611ecb565b611f54565b61012c8111611299575060ff8160a81c168060001461127e576401000276a4915b6040519060208201938285106001600160401b038611176112685760006040946110dd968652818552855196879586948593630251596160e31b8552306004860152151560248501526127108b04604485015260018060a01b0316606484015260a0608484015260a4830190611984565b03926001600160a01b03165af180156108475761123d575b503060005260006020526040600020549030156111ee573060005260006020526040600020549082821061119e57827fddbfb0687fbb06c476f9de1e483e656b4c56516f7580ab8224fbf91c81ed9f51936040933060005260006020520383600020558060025403600255600083518281527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203092a36127108351920482526020820152a1005b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b604090813d8311611261575b6112538183611a21565b810103126101d457816110f5565b503d611249565b634e487b7160e01b600052604160045260246000fd5b73fffd8963efd1fc6a506488495d951d5263988d259161106c565b602490604051906303aa7b4160e61b82526004820152fd5b9061104691611ecb565b627fffff1982146112d25760001990910190610ff7565b634e487b7160e01b600052601160045260246000fd5b61025891500760060b151585610ff1565b3d9150816000823e61130b8282611a21565b60408183810103126101d4578051916001600160401b0383116101d457808201601f8484010112156101d457828201519261134584611e81565b936113536040519586611a21565b808552602085019183850160208360051b8388010101116101d45791602083860101925b60208360051b82880101018410611422575050505060208201516001600160401b0381116101d457818301601f8285010112156101d457808301519260206113be85611e81565b6113cb6040519182611a21565b8581520192810160208560051b8484010101116101d45780820160200192915b60208560051b8284010101841061140757505050505084610fa2565b602080809461141587611e51565b81520194019392506113eb565b8351918260060b83036101d4576020818194829352019401939150611377565b825163ffffffff16845285945060209384019390920191600101610f73565b905060e0813d82116114e5575b8161147b60e09383611a21565b810103126101d45761148c81611e51565b506020810151908160020b82036101d4576114a960408201611e65565b506114b660608201611e65565b506114c360808201611e65565b5060a081015160ff8116036101d45760c06114de9101611e74565b5083610f15565b3d915061146e565b50602081511015610e91565b604090813d831161151d575b61150f8183611a21565b810103126101d45780610e34565b503d611505565b60405162461bcd60e51b815260206004820152601060248201526f1c1d5b5c081b9bdd08195b98589b195960821b6044820152606490fd5b346101d45760403660031901126101d4576105226115786119da565b336000526001602052604060002060018060a01b0382166000526020526115a6602435604060002054611a5d565b9033611bd8565b346101d45760003660031901126101d457602060405160128152f35b346101d45760003660031901126101d4576115e2611d57565b604080516001600160a01b03939093168352602083019190915290f35b346101d45760003660031901126101d4576040517f000000000000000000000000b2e2b8b7049ad6ac235a648bd8ca71b84bf4b5c06001600160a01b03168152602090f35b346101d45760003660031901126101d4576020604051624f1a008152f35b346101d45760603660031901126101d45761167b6119da565b6116836119f0565b6044359060018060a01b03831660005260016020526040600020336000526020526040600020549260001984036116bf575b6105229350611a6a565b8284106116db576116d68361052295033383611bd8565b6116b5565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b346101d45760003660031901126101d4576020600254604051908152f35b346101d45760803660031901126101d4576117576119da565b506117606119f0565b506064356001600160401b0381116101d457366023820112156101d45780600401359061178c82611a42565b9161179a6040519384611a21565b80835236602482840101116101d4576000928160246020940184830137010152604051630a85bd0160e11b8152602090f35b346101d45760003660031901126101d4576006546040516001600160a01b039091168152602090f35b346101d45760003660031901126101d4576040517f000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e26001600160a01b03168152602090f35b346101d45760003660031901126101d4576020611855611d0a565b6040519015158152f35b346101d45760403660031901126101d45761052261187b6119da565b6024359033611bd8565b346101d45760203660031901126101d4576001600160401b036118a66119c4565b166000526009602052602060ff604060002054166040519015158152f35b346101d45760003660031901126101d457600060035490600182811c9181841691821561197a575b60209485851084146106e35785879486865291826000146106c357505060011461191d575061064e92500383611a21565b84915060036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b906000915b85831061196257505061064e935082010185610641565b8054838901850152879450869390920191810161194b565b92607f16926118ec565b919082519283825260005b8481106119b0575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161198f565b600435906001600160401b03821682036101d457565b600435906001600160a01b03821682036101d457565b602435906001600160a01b03821682036101d457565b606081019081106001600160401b0382111761126857604052565b90601f801991011681019081106001600160401b0382111761126857604052565b6001600160401b03811161126857601f01601f191660200190565b919082018092116112d257565b6001600160a01b03908116918215611b855716918215611b3457600082815280602052604081205491808310611ae057604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03908116918215611c895716918215611c395760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b15611ce157565b60405162461bcd60e51b81526020600482015260016024820152603360f91b6044820152606490fd5b600754624f1a0081018091116112d257421190565b15611d2657565b60405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606490fd5b6005546040516320bba64360e21b815291906020906001600160a01b03908116908285600481855afa94851561084757600095611e17575b5082906024866040519485938492631711922960e31b84521660048301525afa91821561084757600092611dcc575b50506001600160801b031690565b81813d8311611e10575b611de08183611a21565b81010312611e0c5751906001600160801b0382168203611e0957506001600160801b0338611dbe565b80fd5b5080fd5b503d611dd6565b8381819793973d8311611e4a575b611e2f8183611a21565b81010312611e0c5751908582168203611e0957509382611d8f565b503d611e25565b51906001600160a01b03821682036101d457565b519061ffff821682036101d457565b519081151582036101d457565b6001600160401b0381116112685760051b60200190565b805115611ea55760200190565b634e487b7160e01b600052603260045260246000fd5b805160011015611ea55760400190565b919082039182116112d257565b3d15611f03573d90611ee982611a42565b91611ef76040519384611a21565b82523d6000602084013e565b606090565b81810291906000198282099183808410930391838303936801000000000000000093858511156101d45714611f4a570990828211900360c01b910360401c1790565b5050505060401c90565b906127108083029190600019818509938380861095039480860395868511156101d45714611fce579082910981806000031680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b505091500490565b60020b60008112156123575780600003905b620d89e88211612345576001821615612333576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b169160028116612317575b600481166122fb575b600881166122df575b601081166122c3575b602081166122a7575b6040811661228b575b608090818116612270575b6101008116612255575b610200811661223a575b610400811661221f575b6108008116612204575b61100081166121e9575b61200081166121ce575b61400081166121b3575b6180008116612198575b62010000811661217d575b620200008116612163575b620400008116612149575b620800001661212e575b50600012612109575b63ffffffff8116612101576000905b60201c60ff91909116016001600160a01b031690565b6001906120eb565b801561211857600019046120dc565b634e487b7160e01b600052601260045260246000fd5b6b048a170391f7dc42444e8fa26000929302901c91906120d3565b6d2216e584f5fa1ea926041bedfe98909302811c926120c9565b926e5d6af8dedb81196699c329225ee60402811c926120be565b926f09aa508b5b7a84e1c677de54f3e99bc902811c926120b3565b926f31be135f97d08fd981231505542fcfa602811c926120a8565b926f70d869a156d2a1b890bb3df62baf32f702811c9261209e565b926fa9f746462d870fdf8a65dc1f90e061e502811c92612094565b926fd097f3bdfd2022b8845ad8f792aa582502811c9261208a565b926fe7159475a2c29b7443b29c7fa6e889d902811c92612080565b926ff3392b0822b70005940c7a398e4b70f302811c92612076565b926ff987a7253ac413176f2b074cf7815e5402811c9261206c565b926ffcbe86c7900a88aedcffc83b479aa3a402811c92612062565b926ffe5dee046a99a2a811c461f1969c305302811c92612058565b916fff2ea16466c96a3843ec78b326b528610260801c9161204d565b916fff973b41fa98c081472e6896dfb254c00260801c91612044565b916fffcb9843d60f6159c9db58835c9266440260801c9161203b565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c91612032565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91612029565b916ffff97272373d413259a46990580e213a0260801c91612020565b6001600160881b03600160801b612015565b6040516333a3bdff60e21b8152600490fd5b80611fe856fea164736f6c6343000813000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e200000000000000000000000077dcc9b09c6ae94cdc726540735682a38e18d69000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000000004544573740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047474747300000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _entropyAddress (address): 0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320
Arg [1] : _coin (address): 0xfffff4d5c35B709809BBA92E76b421A246C7e7E2
Arg [2] : _positionManagerAddress (address): 0x77DcC9b09C6Ae94CDC726540735682A38e18d690
Arg [3] : _name (string): TEst
Arg [4] : _symbol (string): ttts
Arg [5] : _pumpInterval (uint256): 600
Arg [6] : _pumpBPS (uint256): 5000
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
Arg [1] : 000000000000000000000000fffff4d5c35b709809bba92e76b421a246c7e7e2
Arg [2] : 00000000000000000000000077dcc9b09c6ae94cdc726540735682a38e18d690
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000258
Arg [6] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 5445737400000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 7474747300000000000000000000000000000000000000000000000000000000
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.