Source Code
Overview
CELO Balance
CELO Value
$0.00Multichain Info
Latest 10 internal transactions
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 45426206 | 138 days ago | Contract Creation | 0 CELO | |||
| 45425910 | 138 days ago | Contract Creation | 0 CELO | |||
| 41786606 | 180 days ago | Contract Creation | 0 CELO | |||
| 40151291 | 199 days ago | Contract Creation | 0 CELO | |||
| 37957112 | 224 days ago | Contract Creation | 0 CELO | |||
| 34665938 | 262 days ago | Contract Creation | 0 CELO | |||
| 33984654 | 270 days ago | Contract Creation | 0 CELO | |||
| 31708345 | 297 days ago | Contract Creation | 0 CELO | |||
| 31640510 | 297 days ago | Contract Creation | 0 CELO | |||
| 31609067 | 298 days ago | Contract Creation | 0 CELO |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x332F9092...8393D3983 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
PoolFactory
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.19 <0.9.0;
import {Clones} from "@openzeppelin5/contracts/proxy/Clones.sol";
import {ExcessivelySafeCall} from "@nomad-xyz/src/ExcessivelySafeCall.sol";
import {IPoolFactory} from "../interfaces/pools/IPoolFactory.sol";
import {IFeeModule} from "../interfaces/fees/IFeeModule.sol";
import {IPool} from "../interfaces/pools/IPool.sol";
/*
██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗
██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝
██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗
╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝
╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗
╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗
██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║
███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║
╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║
███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║
╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
██████╗ ██████╗ ██████╗ ██╗ ███████╗ █████╗ ██████╗████████╗ ██████╗ ██████╗ ██╗ ██╗
██╔══██╗██╔═══██╗██╔═══██╗██║ ██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝
██████╔╝██║ ██║██║ ██║██║ █████╗ ███████║██║ ██║ ██║ ██║██████╔╝ ╚████╔╝
██╔═══╝ ██║ ██║██║ ██║██║ ██╔══╝ ██╔══██║██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝
██║ ╚██████╔╝╚██████╔╝███████╗██║ ██║ ██║╚██████╗ ██║ ╚██████╔╝██║ ██║ ██║
╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
*/
/// @title PoolFactory
/// @author velodrome.finance, Solidly, Uniswap Labs
/// @notice Velodrome V2 pool factory
contract PoolFactory is IPoolFactory {
using ExcessivelySafeCall for address;
/// @inheritdoc IPoolFactory
address public immutable implementation;
/// @inheritdoc IPoolFactory
bool public isPaused;
/// @inheritdoc IPoolFactory
address public pauser;
/// @inheritdoc IPoolFactory
uint256 public stableFee;
/// @inheritdoc IPoolFactory
uint256 public volatileFee;
/// @inheritdoc IPoolFactory
uint256 public constant MAX_FEE = 300; // 3%
/// @inheritdoc IPoolFactory
address public feeManager;
/// @inheritdoc IPoolFactory
address public feeModule;
/// @inheritdoc IPoolFactory
address public poolAdmin;
mapping(address => mapping(address => mapping(bool => address))) internal _getPool;
address[] internal _allPools;
/// @dev simplified check if its a pool, given that `stable` flag might not be available in peripherals
mapping(address => bool) internal _isPool;
constructor(address _implementation, address _poolAdmin, address _pauser, address _feeManager) {
implementation = _implementation;
poolAdmin = _poolAdmin;
pauser = _pauser;
feeManager = _feeManager;
isPaused = false;
stableFee = 5; // 0.05%
volatileFee = 30; // 0.3%
emit SetPoolAdmin(_poolAdmin);
emit SetPauser(_pauser);
emit SetFeeManager(_feeManager);
emit SetDefaultFee(true, 5);
emit SetDefaultFee(false, 30);
}
/// @inheritdoc IPoolFactory
function allPools(uint256 index) external view returns (address) {
return _allPools[index];
}
/// @inheritdoc IPoolFactory
function allPools() external view returns (address[] memory) {
return _allPools;
}
/// @inheritdoc IPoolFactory
function allPoolsLength() external view returns (uint256) {
return _allPools.length;
}
/// @inheritdoc IPoolFactory
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address) {
return fee > 1 ? address(0) : _getPool[tokenA][tokenB][fee == 1];
}
/// @inheritdoc IPoolFactory
function getPool(address tokenA, address tokenB, bool stable) external view returns (address) {
return _getPool[tokenA][tokenB][stable];
}
/// @inheritdoc IPoolFactory
function isPool(address pool) external view returns (bool) {
return _isPool[pool];
}
/// @inheritdoc IPoolFactory
function setPoolAdmin(address _poolAdmin) external {
if (msg.sender != poolAdmin) revert NotPoolAdmin();
if (_poolAdmin == address(0)) revert ZeroAddress();
poolAdmin = _poolAdmin;
emit SetPoolAdmin(_poolAdmin);
}
/// @inheritdoc IPoolFactory
function setPauser(address _pauser) external {
if (msg.sender != pauser) revert NotPauser();
if (_pauser == address(0)) revert ZeroAddress();
pauser = _pauser;
emit SetPauser(_pauser);
}
/// @inheritdoc IPoolFactory
function setPauseState(bool _state) external {
if (msg.sender != pauser) revert NotPauser();
isPaused = _state;
emit SetPauseState(_state);
}
/// @inheritdoc IPoolFactory
function setFeeManager(address _feeManager) external {
if (msg.sender != feeManager) revert NotFeeManager();
if (_feeManager == address(0)) revert ZeroAddress();
feeManager = _feeManager;
emit SetFeeManager(_feeManager);
}
/// @inheritdoc IPoolFactory
function setFeeModule(address _feeModule) external {
if (msg.sender != feeManager) revert NotFeeManager();
if (_feeModule == address(0)) revert ZeroAddress();
address oldFeeModule = feeModule;
feeModule = _feeModule;
emit FeeModuleChanged({oldFeeModule: oldFeeModule, newFeeModule: _feeModule});
}
/// @inheritdoc IPoolFactory
function setFee(bool _stable, uint256 _fee) external {
if (msg.sender != feeManager) revert NotFeeManager();
if (_fee > MAX_FEE) revert FeeTooHigh();
if (_fee == 0) revert ZeroFee();
if (_stable) {
stableFee = _fee;
} else {
volatileFee = _fee;
}
emit SetDefaultFee(_stable, _fee);
}
/// @inheritdoc IPoolFactory
function getFee(address _pool, bool _stable) external view returns (uint256) {
if (feeModule != address(0)) {
(bool success, bytes memory data) = feeModule.excessivelySafeStaticCall(
500_000, 32, abi.encodeWithSelector(IFeeModule.getFee.selector, _pool)
);
if (success) {
uint256 fee = abi.decode(data, (uint24));
if (fee <= 1_000) {
return fee;
}
}
}
return _stable ? stableFee : volatileFee;
}
/// @inheritdoc IPoolFactory
function createPool(address tokenA, address tokenB, uint24 fee) external returns (address pool) {
if (fee > 1) revert FeeInvalid();
bool stable = fee == 1;
return createPool(tokenA, tokenB, stable);
}
/// @inheritdoc IPoolFactory
function createPool(address tokenA, address tokenB, bool stable) public returns (address pool) {
if (tokenA == tokenB) revert SameAddress();
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
if (token0 == address(0)) revert ZeroAddress();
if (_getPool[token0][token1][stable] != address(0)) revert PoolAlreadyExists();
bytes32 salt = keccak256(abi.encodePacked(token0, token1, stable)); // salt includes stable as well, 3 parameters
pool = Clones.cloneDeterministic(implementation, salt);
IPool(pool).initialize(token0, token1, stable);
_getPool[token0][token1][stable] = pool;
_getPool[token1][token0][stable] = pool; // populate mapping in the reverse direction
_allPools.push(pool);
_isPool[pool] = true;
emit PoolCreated(token0, token1, stable, pool, _allPools.length);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Clones.sol)
pragma solidity ^0.8.20;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*/
library Clones {
/**
* @dev A clone instance deployment failed.
*/
error ERC1167FailedCreateClone();
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(0, 0x09, 0x37)
}
if (instance == address(0)) {
revert ERC1167FailedCreateClone();
}
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
if (instance == address(0)) {
revert ERC1167FailedCreateClone();
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt
) internal view returns (address predicted) {
return predictDeterministicAddress(implementation, salt, address(this));
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.7.6;
library ExcessivelySafeCall {
uint256 constant LOW_28_MASK =
0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
/// @notice Use when you _really_ really _really_ don't trust the called
/// contract. This prevents the called contract from causing reversion of
/// the caller in as many ways as we can.
/// @dev The main difference between this and a solidity low-level call is
/// that we limit the number of bytes that the callee can cause to be
/// copied to caller memory. This prevents stupid things like malicious
/// contracts returning 10,000,000 bytes causing a local OOG when copying
/// to memory.
/// @param _target The address to call
/// @param _gas The amount of gas to forward to the remote contract
/// @param _value The value in wei to send to the remote contract
/// @param _maxCopy The maximum number of bytes of returndata to copy
/// to memory.
/// @param _calldata The data to send to the remote contract
/// @return success and returndata, as `.call()`. Returndata is capped to
/// `_maxCopy` bytes.
function excessivelySafeCall(
address _target,
uint256 _gas,
uint256 _value,
uint16 _maxCopy,
bytes memory _calldata
) internal returns (bool, bytes memory) {
// set up for assembly call
uint256 _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
// dispatch message to recipient
// by assembly calling "handle" function
// we call via assembly to avoid memcopying a very large returndata
// returned by a malicious contract
assembly {
_success := call(
_gas, // gas
_target, // recipient
_value, // ether value
add(_calldata, 0x20), // inloc
mload(_calldata), // inlen
0, // outloc
0 // outlen
)
// limit our copy to 256 bytes
_toCopy := returndatasize()
if gt(_toCopy, _maxCopy) {
_toCopy := _maxCopy
}
// Store the length of the copied bytes
mstore(_returnData, _toCopy)
// copy the bytes from returndata[0:_toCopy]
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
}
return (_success, _returnData);
}
/// @notice Use when you _really_ really _really_ don't trust the called
/// contract. This prevents the called contract from causing reversion of
/// the caller in as many ways as we can.
/// @dev The main difference between this and a solidity low-level call is
/// that we limit the number of bytes that the callee can cause to be
/// copied to caller memory. This prevents stupid things like malicious
/// contracts returning 10,000,000 bytes causing a local OOG when copying
/// to memory.
/// @param _target The address to call
/// @param _gas The amount of gas to forward to the remote contract
/// @param _maxCopy The maximum number of bytes of returndata to copy
/// to memory.
/// @param _calldata The data to send to the remote contract
/// @return success and returndata, as `.call()`. Returndata is capped to
/// `_maxCopy` bytes.
function excessivelySafeStaticCall(
address _target,
uint256 _gas,
uint16 _maxCopy,
bytes memory _calldata
) internal view returns (bool, bytes memory) {
// set up for assembly call
uint256 _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
// dispatch message to recipient
// by assembly calling "handle" function
// we call via assembly to avoid memcopying a very large returndata
// returned by a malicious contract
assembly {
_success := staticcall(
_gas, // gas
_target, // recipient
add(_calldata, 0x20), // inloc
mload(_calldata), // inlen
0, // outloc
0 // outlen
)
// limit our copy to 256 bytes
_toCopy := returndatasize()
if gt(_toCopy, _maxCopy) {
_toCopy := _maxCopy
}
// Store the length of the copied bytes
mstore(_returnData, _toCopy)
// copy the bytes from returndata[0:_toCopy]
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
}
return (_success, _returnData);
}
/**
* @notice Swaps function selectors in encoded contract calls
* @dev Allows reuse of encoded calldata for functions with identical
* argument types but different names. It simply swaps out the first 4 bytes
* for the new selector. This function modifies memory in place, and should
* only be used with caution.
* @param _newSelector The new 4-byte selector
* @param _buf The encoded contract args
*/
function swapSelector(bytes4 _newSelector, bytes memory _buf)
internal
pure
{
require(_buf.length >= 4);
uint256 _mask = LOW_28_MASK;
assembly {
// load the first word of
let _word := mload(add(_buf, 0x20))
// mask out the top 4 bytes
// /x
_word := and(_word, _mask)
_word := or(_newSelector, _word)
mstore(add(_buf, 0x20), _word)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IPoolFactory {
event SetFeeManager(address indexed feeManager);
event SetPauser(address indexed pauser);
event SetPauseState(bool indexed state);
event SetPoolAdmin(address indexed poolAdmin);
event PoolCreated(address indexed token0, address indexed token1, bool indexed stable, address pool, uint256);
event SetDefaultFee(bool indexed stable, uint256 fee);
event FeeModuleChanged(address indexed oldFeeModule, address indexed newFeeModule);
error FeeInvalid();
error FeeTooHigh();
error NotFeeManager();
error NotPauser();
error NotPoolAdmin();
error PoolAlreadyExists();
error SameAddress();
error ZeroFee();
error ZeroAddress();
/// @notice Return a single pool created by this factory
/// @return Address of pool
function allPools(uint256 index) external view returns (address);
/// @notice Returns all pools created by this factory
/// @return Array of pool addresses
function allPools() external view returns (address[] memory);
/// @notice returns the number of pools created from this factory
function allPoolsLength() external view returns (uint256);
/// @notice Is a valid pool created by this factory.
/// @param .
function isPool(address pool) external view returns (bool);
/// @notice Return address of pool created by this factory
/// @param tokenA .
/// @param tokenB .
/// @param stable True if stable, false if volatile
function getPool(address tokenA, address tokenB, bool stable) external view returns (address);
/// @notice Support for v3-style pools which wraps around getPool(tokenA,tokenB,stable)
/// @dev fee is converted to stable boolean.
/// @param tokenA .
/// @param tokenB .
/// @param fee 1 if stable, 0 if volatile, else returns address(0)
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address);
/// @notice Set pool administrator
/// @dev Allowed to change the name and symbol of any pool created by this factory
/// @param _poolAdmin Address of the pool administrator
function setPoolAdmin(address _poolAdmin) external;
/// @notice Set the pauser for the factory contract
/// @dev The pauser can pause swaps on pools associated with the factory. Liquidity will always be withdrawable.
/// @dev Must be called by the pauser
/// @param _pauser Address of the pauser
function setPauser(address _pauser) external;
/// @notice Pause or unpause swaps on pools associated with the factory
/// @param _state True to pause, false to unpause
function setPauseState(bool _state) external;
/// @notice Set the fee manager for the factory contract
/// @dev The fee manager can set fees on pools associated with the factory.
/// @dev Must be called by the fee manager
/// @param _feeManager Address of the fee manager
function setFeeManager(address _feeManager) external;
/// @notice Updates the feeModule of the factory
/// @dev Must be called by the current fee manager
/// @param _feeModule The new feeModule of the factory
function setFeeModule(address _feeModule) external;
/// @notice Set default fee for stable and volatile pools.
/// @dev Throws if higher than maximum fee.
/// Throws if fee is zero.
/// @param _stable Stable or volatile pool.
/// @param _fee .
function setFee(bool _stable, uint256 _fee) external;
/// @notice Returns fee for a pool, as custom fees are possible.
function getFee(address _pool, bool _stable) external view returns (uint256);
/// @notice Create a pool given two tokens and if they're stable/volatile
/// @dev token order does not matter
/// @param tokenA .
/// @param tokenB .
/// @param stable .
function createPool(address tokenA, address tokenB, bool stable) external returns (address pool);
/// @notice Support for v3-style pools which wraps around createPool(tokenA,tokenB,stable)
/// @dev fee is converted to stable boolean
/// @dev token order does not matter
/// @param tokenA .
/// @param tokenB .
/// @param fee 1 if stable, 0 if volatile, else revert
function createPool(address tokenA, address tokenB, uint24 fee) external returns (address pool);
/// @notice The pool implementation used to create pools
/// @return Address of pool implementation
function implementation() external view returns (address);
/// @notice Whether the pools associated with the factory are paused or not.
/// @dev Pause only pauses swaps, liquidity will always be withdrawable.
function isPaused() external view returns (bool);
/// @notice The address of the pauser, can pause swaps on pools associated with factory.
/// @return Address of the pauser
function pauser() external view returns (address);
/// @notice The default fee for all stable pools
/// @return Default stable fee
function stableFee() external view returns (uint256);
/// @notice The default fee for all volatile pools
/// @return Default volatile fee
function volatileFee() external view returns (uint256);
/// @notice Maximum possible fee for default stable or volatile fee
/// @return 3%
function MAX_FEE() external view returns (uint256);
/// @notice Address of the fee manager, can set fees on pools associated with factory.
/// @notice This overrides the default fee for that pool.
/// @return Address of the fee manager
function feeManager() external view returns (address);
/// @notice Address of the fee module of the factory
/// @dev Can be changed by the current fee manager via setFeeModule
/// @return Address of the fee module
function feeModule() external view returns (address);
/// @notice Address of the pool administrator, can change the name and symbol of pools created by factory.
/// @return Address of the pool administrator
function poolAdmin() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../pools/IPoolFactory.sol";
interface IFeeModule {
/// @notice Get the factory that the fee module belongs to
function factory() external view returns (IPoolFactory);
/// @notice Get fee for a given pool. Accounts for default and dynamic fees
/// @dev Fee is denominated in bips.
/// @param pool The pool to get the fee for
/// @return The fee for the given pool
function getFee(address pool) external view returns (uint24);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IPool {
error DepositsNotEqual();
error BelowMinimumK();
error FactoryAlreadySet();
error InsufficientLiquidity();
error InsufficientLiquidityMinted();
error InsufficientLiquidityBurned();
error InsufficientOutputAmount();
error InsufficientInputAmount();
error IsPaused();
error InvalidTo();
error K();
event Fees(address indexed sender, uint256 amount0, uint256 amount1);
event Mint(address indexed sender, address indexed to, uint256 amount0, uint256 amount1);
event Burn(address indexed sender, address indexed to, uint256 amount0, uint256 amount1);
event Swap(
address indexed sender,
address indexed to,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out
);
event Sync(uint256 reserve0, uint256 reserve1);
event Claim(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1);
// Struct to capture time period obervations every 30 minutes, used for local oracles
struct Observation {
uint256 timestamp;
uint256 reserve0Cumulative;
uint256 reserve1Cumulative;
}
/// @notice Returns the decimal (dec), reserves (r), stable (st), and tokens (t) of token0 and token1
function metadata()
external
view
returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1);
/// @notice Claim accumulated but unclaimed fees (claimable0 and claimable1)
function claimFees() external returns (uint256, uint256);
/// @notice Returns [token0, token1]
function tokens() external view returns (address, address);
/// @notice Address of token in the pool with the lower address value
function token0() external view returns (address);
/// @notice Address of token in the pool with the higher address value
function token1() external view returns (address);
/// @notice Address of linked PoolFees.sol
function poolFees() external view returns (address);
/// @notice Address of PoolFactory that created this contract
function factory() external view returns (address);
/// @notice Capture oracle reading every 30 minutes (1800 seconds)
function periodSize() external view returns (uint256);
/// @notice Amount of token0 in pool
function reserve0() external view returns (uint256);
/// @notice Amount of token1 in pool
function reserve1() external view returns (uint256);
/// @notice Timestamp of last update to pool
function blockTimestampLast() external view returns (uint256);
/// @notice Cumulative of reserve0 factoring in time elapsed
function reserve0CumulativeLast() external view returns (uint256);
/// @notice Cumulative of reserve1 factoring in time elapsed
function reserve1CumulativeLast() external view returns (uint256);
/// @notice Accumulated fees of token0 (global)
function index0() external view returns (uint256);
/// @notice Accumulated fees of token1 (global)
function index1() external view returns (uint256);
/// @notice Get an LP's relative index0 to index0
function supplyIndex0(address) external view returns (uint256);
/// @notice Get an LP's relative index1 to index1
function supplyIndex1(address) external view returns (uint256);
/// @notice Amount of unclaimed, but claimable tokens from fees of token0 for an LP
function claimable0(address) external view returns (uint256);
/// @notice Amount of unclaimed, but claimable tokens from fees of token1 for an LP
function claimable1(address) external view returns (uint256);
/// @notice Returns the value of K in the Pool, based on its reserves.
function getK() external returns (uint256);
/// @notice Set pool name
/// Only callable by Voter.emergencyCouncil()
/// @param __name String of new name
function setName(string calldata __name) external;
/// @notice Set pool symbol
/// Only callable by Voter.emergencyCouncil()
/// @param __symbol String of new symbol
function setSymbol(string calldata __symbol) external;
/// @notice Get the number of observations recorded
function observationLength() external view returns (uint256);
/// @notice Get the value of the most recent observation
function lastObservation() external view returns (Observation memory);
/// @notice True if pool is stable, false if volatile
function stable() external view returns (bool);
/// @notice Produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices()
external
view
returns (uint256 reserve0Cumulative, uint256 reserve1Cumulative, uint256 blockTimestamp);
/// @notice Provides twap price with user configured granularity, up to the full window size
/// @param tokenIn .
/// @param amountIn .
/// @param granularity .
/// @return amountOut .
function quote(address tokenIn, uint256 amountIn, uint256 granularity) external view returns (uint256 amountOut);
/// @notice Returns a memory set of TWAP prices
/// Same as calling sample(tokenIn, amountIn, points, 1)
/// @param tokenIn .
/// @param amountIn .
/// @param points Number of points to return
/// @return Array of TWAP prices
function prices(address tokenIn, uint256 amountIn, uint256 points) external view returns (uint256[] memory);
/// @notice Same as prices with with an additional window argument.
/// Window = 2 means 2 * 30min (or 1 hr) between observations
/// @param tokenIn .
/// @param amountIn .
/// @param points .
/// @param window .
/// @return Array of TWAP prices
function sample(address tokenIn, uint256 amountIn, uint256 points, uint256 window)
external
view
returns (uint256[] memory);
/// @notice This low-level function should be called from a contract which performs important safety checks
/// @param amount0Out Amount of token0 to send to `to`
/// @param amount1Out Amount of token1 to send to `to`
/// @param to Address to recieve the swapped output
/// @param data Additional calldata for flashloans
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
/// @notice This low-level function should be called from a contract which performs important safety checks
/// standard uniswap v2 implementation
/// @param to Address to receive token0 and token1 from burning the pool token
/// @return amount0 Amount of token0 returned
/// @return amount1 Amount of token1 returned
function burn(address to) external returns (uint256 amount0, uint256 amount1);
/// @notice This low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks
/// standard uniswap v2 implementation
/// @param to Address to receive the minted LP token
/// @return liquidity Amount of LP token minted
function mint(address to) external returns (uint256 liquidity);
/// @notice Update reserves and, on the first call per block, price accumulators
/// @return _reserve0 .
/// @return _reserve1 .
/// @return _blockTimestampLast .
function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);
/// @notice Get the amount of tokenOut given the amount of tokenIn
/// @param amountIn Amount of token in
/// @param tokenIn Address of token
/// @return Amount out
function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256);
/// @notice Force balances to match reserves
/// @param to Address to receive any skimmed rewards
function skim(address to) external;
/// @notice Force reserves to match balances
function sync() external;
/// @notice Called on pool creation by PoolFactory
/// @param _token0 Address of token0
/// @param _token1 Address of token1
/// @param _stable True if stable, false if volatile
function initialize(address _token0, address _token1, bool _stable) external;
}{
"remappings": [
"@openzeppelin5/contracts/=lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/src/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"createX/=lib/createX/src/",
"@nomad-xyz/=lib/ExcessivelySafeCall/",
"@hyperlane/=node_modules/@hyperlane-xyz/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
"ExcessivelySafeCall/=lib/ExcessivelySafeCall/src/",
"openzeppelin/=lib/createX/lib/openzeppelin-contracts/contracts/",
"solady/=lib/createX/lib/solady/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {
"src/libraries/rateLimits/RateLimitMidpointCommonLibrary.sol": {
"RateLimitMidpointCommonLibrary": "0x50f6F01b1804eAf2e53830A5a6890b70FE45937E"
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_poolAdmin","type":"address"},{"internalType":"address","name":"_pauser","type":"address"},{"internalType":"address","name":"_feeManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC1167FailedCreateClone","type":"error"},{"inputs":[],"name":"FeeInvalid","type":"error"},{"inputs":[],"name":"FeeTooHigh","type":"error"},{"inputs":[],"name":"NotFeeManager","type":"error"},{"inputs":[],"name":"NotPauser","type":"error"},{"inputs":[],"name":"NotPoolAdmin","type":"error"},{"inputs":[],"name":"PoolAlreadyExists","type":"error"},{"inputs":[],"name":"SameAddress","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroFee","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeeModule","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeModule","type":"address"}],"name":"FeeModuleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":true,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PoolCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetDefaultFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeManager","type":"address"}],"name":"SetFeeManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"state","type":"bool"}],"name":"SetPauseState","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pauser","type":"address"}],"name":"SetPauser","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"poolAdmin","type":"address"}],"name":"SetPoolAdmin","type":"event"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"allPools","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPoolsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"bool","name":"_stable","type":"bool"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeManager","type":"address"}],"name":"setFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeModule","type":"address"}],"name":"setFeeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPauseState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pauser","type":"address"}],"name":"setPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAdmin","type":"address"}],"name":"setPoolAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stableFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"volatileFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60a060405234801561000f575f5ffd5b5060405161111338038061111383398101604081905261002e91610188565b6001600160a01b03848116608052600580546001600160a01b031990811686841690811783555f805460038054909416878716179093556001600160a81b03199092166101009487169490940260ff1916939093178155600191909155601e6002556040517fc0ef652ec5e1ffbc985804cde4457ba9413f0747ac6f2f4a7e195de5330bbd909190a26040516001600160a01b038316907fe02efb9e8f0fc21546730ab32d594f62d586e1bbb15bb5045edd0b1878a77b35905f90a26040516001600160a01b038216907f5d0517e3a4eabea892d9750138cd21d4a6cf3b935b43d0598df7055f463819b2905f90a2604051600581526001905f5160206110f35f395f51905f529060200160405180910390a2604051601e81525f905f5160206110f35f395f51905f529060200160405180910390a2505050506101d9565b80516001600160a01b0381168114610183575f5ffd5b919050565b5f5f5f5f6080858703121561019b575f5ffd5b6101a48561016d565b93506101b26020860161016d565b92506101c06040860161016d565b91506101ce6060860161016d565b905092959194509250565b608051610efb6101f85f395f818161025b01526106ea0152610efb5ff3fe608060405234801561000f575f5ffd5b5060043610610153575f3560e01c80639fd0506d116100bf578063c5c63e6511610079578063c5c63e6514610325578063cc56b2c51461033a578063cdb88ad11461034d578063d0fb020314610360578063e1f76b4414610373578063efde4e6414610386575f5ffd5b80639fd0506d146102c0578063a1671295146102d7578063b187bd26146102ea578063b782cc49146102f6578063bae41cbf14610309578063bc063e1a1461031c575f5ffd5b806341d1de971161011057806341d1de97146101ec578063472d35b9146101ff5780635084ed03146102125780635b16ebb71461021b5780635c60da1b1461025657806379bc57d51461027d575f5ffd5b80631698ee82146101575780632088df1b14610187578063283d62ad1461019c5780632d88af4a146101af57806336bf95a0146101c257806340bbd775146101d5575b5f5ffd5b61016a610165366004610cfb565b61038e565b6040516001600160a01b0390911681526020015b60405180910390f35b61019a610195366004610d3f565b6103e2565b005b61019a6101aa366004610d3f565b610485565b61019a6101bd366004610d3f565b61051f565b61016a6101d0366004610d67565b6105c4565b6101de60015481565b60405190815260200161017e565b61016a6101fa366004610da7565b610879565b61019a61020d366004610d3f565b6108a7565b6101de60025481565b610246610229366004610d3f565b6001600160a01b03165f9081526008602052604090205460ff1690565b604051901515815260200161017e565b61016a7f000000000000000000000000000000000000000000000000000000000000000081565b61016a61028b366004610d67565b6001600160a01b039283165f908152600660209081526040808320948616835293815283822092151582529190915220541690565b5f5461016a9061010090046001600160a01b031681565b61016a6102e5366004610cfb565b610942565b5f546102469060ff1681565b60055461016a906001600160a01b031681565b60045461016a906001600160a01b031681565b6101de61012c81565b61032d610987565b60405161017e9190610dbe565b6101de610348366004610e09565b6109e7565b61019a61035b366004610e3a565b610ab1565b60035461016a906001600160a01b031681565b61019a610381366004610e53565b610b1a565b6007546101de565b5f60018262ffffff16116103d8576001600160a01b038085165f90815260066020908152604080832087851684528252808320600162ffffff8816148452909152902054166103da565b5f5b949350505050565b6003546001600160a01b0316331461040d5760405163f5d267eb60e01b815260040160405180910390fd5b6001600160a01b0381166104345760405163d92e233d60e01b815260040160405180910390fd5b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f307ab001eeada03f10e50285db18fcf7dc97c742531d046e2043eb828cd8d51a905f90a35050565b6005546001600160a01b031633146104af5760405162b145b560e31b815260040160405180910390fd5b6001600160a01b0381166104d65760405163d92e233d60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0383169081179091556040517fc0ef652ec5e1ffbc985804cde4457ba9413f0747ac6f2f4a7e195de5330bbd90905f90a250565b5f5461010090046001600160a01b0316331461054e5760405163492f678160e01b815260040160405180910390fd5b6001600160a01b0381166105755760405163d92e233d60e01b815260040160405180910390fd5b5f8054610100600160a81b0319166101006001600160a01b03841690810291909117825560405190917fe02efb9e8f0fc21546730ab32d594f62d586e1bbb15bb5045edd0b1878a77b3591a250565b5f826001600160a01b0316846001600160a01b0316036105f75760405163367558c360e01b815260040160405180910390fd5b5f5f846001600160a01b0316866001600160a01b03161061061957848661061c565b85855b90925090506001600160a01b0382166106485760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038281165f908152600660209081526040808320858516845282528083208815158452909152902054161561069757604051630188c99160e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b60488201525f9060490160405160208183030381529060405280519060200120905061070f7f000000000000000000000000000000000000000000000000000000000000000082610bde565b604051631c9776b560e31b81526001600160a01b038581166004830152848116602483015287151560448301529195509085169063e4bbb5a8906064015f604051808303815f87803b158015610763575f5ffd5b505af1158015610775573d5f5f3e3d5ffd5b505050506001600160a01b038381165f8181526006602081815260408084208887168086529083528185208c15158087529084528286208054988d166001600160a01b0319998a16811790915582875294845282862087875284528286208187528452828620805489168617905560078054600181810183557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889091018054909a1687179099558587526008855295839020805460ff191690981790975593548151938452918301919091529192917f2128d88d14c80cb081c1252a5acff7a264671bf199ce226b53788fb26065005e910160405180910390a45050509392505050565b5f6007828154811061088d5761088d610e7b565b5f918252602090912001546001600160a01b031692915050565b6003546001600160a01b031633146108d25760405163f5d267eb60e01b815260040160405180910390fd5b6001600160a01b0381166108f95760405163d92e233d60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f5d0517e3a4eabea892d9750138cd21d4a6cf3b935b43d0598df7055f463819b2905f90a250565b5f60018262ffffff16111561096a576040516352dadcf960e01b815260040160405180910390fd5b600162ffffff83161461097e8585836105c4565b95945050505050565b606060078054806020026020016040519081016040528092919081815260200182805480156109dd57602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116109bf575b5050505050905090565b6004545f906001600160a01b031615610a9757604080516001600160a01b03858116602480840191909152835180840390910181526044909201909252602081810180516001600160e01b0316631711922960e31b1790526004545f938493610a599392909116916207a12091610c49565b915091508115610a94575f81806020019051810190610a789190610e8f565b62ffffff1690506103e88111610a92579250610aab915050565b505b50505b81610aa457600254610aa8565b6001545b90505b92915050565b5f5461010090046001600160a01b03163314610ae05760405163492f678160e01b815260040160405180910390fd5b5f805460ff1916821515908117825560405190917f0d76538efc408318a051137c2720a9e82902acdbd46b802d488b74ca3a09a11691a250565b6003546001600160a01b03163314610b455760405163f5d267eb60e01b815260040160405180910390fd5b61012c811115610b685760405163cd4e616760e01b815260040160405180910390fd5b805f03610b885760405163af13986d60e01b815260040160405180910390fd5b8115610b98576001819055610b9e565b60028190555b8115157f3f15a5f4cc98ad5cfa4ae55040b513ee00b15b742d2b2274d91964c6ff92a34f82604051610bd291815260200190565b60405180910390a25050565b5f763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c175f526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760095ff590506001600160a01b038116610aab576040516330be1a3d60e21b815260040160405180910390fd5b5f60605f5f5f8661ffff1667ffffffffffffffff811115610c6c57610c6c610eb1565b6040519080825280601f01601f191660200182016040528015610c96576020820181803683370190505b5090505f5f8751602089018c8cfa91503d925086831115610cb5578692505b828152825f602083013e909890975095505050505050565b80356001600160a01b0381168114610ce3575f5ffd5b919050565b62ffffff81168114610cf8575f5ffd5b50565b5f5f5f60608486031215610d0d575f5ffd5b610d1684610ccd565b9250610d2460208501610ccd565b91506040840135610d3481610ce8565b809150509250925092565b5f60208284031215610d4f575f5ffd5b610aa882610ccd565b80358015158114610ce3575f5ffd5b5f5f5f60608486031215610d79575f5ffd5b610d8284610ccd565b9250610d9060208501610ccd565b9150610d9e60408501610d58565b90509250925092565b5f60208284031215610db7575f5ffd5b5035919050565b602080825282518282018190525f918401906040840190835b81811015610dfe5783516001600160a01b0316835260209384019390920191600101610dd7565b509095945050505050565b5f5f60408385031215610e1a575f5ffd5b610e2383610ccd565b9150610e3160208401610d58565b90509250929050565b5f60208284031215610e4a575f5ffd5b610aa882610d58565b5f5f60408385031215610e64575f5ffd5b610e6d83610d58565b946020939093013593505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610e9f575f5ffd5b8151610eaa81610ce8565b9392505050565b634e487b7160e01b5f52604160045260245ffdfea26469706673582212204cf19a388d1abc97a88f2fed2d112b3652b98275455121a1bf98fa826e1d3bed64736f6c634300081b00333f15a5f4cc98ad5cfa4ae55040b513ee00b15b742d2b2274d91964c6ff92a34f00000000000000000000000010499d88bd32af443fc936f67de32be1c8bb374c0000000000000000000000009d5064e4910410f56626d2d187758d83d8e858600000000000000000000000009d5064e4910410f56626d2d187758d83d8e858600000000000000000000000004994dacdb9c57a811affbf878d92e00ef2e5c4c2
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610153575f3560e01c80639fd0506d116100bf578063c5c63e6511610079578063c5c63e6514610325578063cc56b2c51461033a578063cdb88ad11461034d578063d0fb020314610360578063e1f76b4414610373578063efde4e6414610386575f5ffd5b80639fd0506d146102c0578063a1671295146102d7578063b187bd26146102ea578063b782cc49146102f6578063bae41cbf14610309578063bc063e1a1461031c575f5ffd5b806341d1de971161011057806341d1de97146101ec578063472d35b9146101ff5780635084ed03146102125780635b16ebb71461021b5780635c60da1b1461025657806379bc57d51461027d575f5ffd5b80631698ee82146101575780632088df1b14610187578063283d62ad1461019c5780632d88af4a146101af57806336bf95a0146101c257806340bbd775146101d5575b5f5ffd5b61016a610165366004610cfb565b61038e565b6040516001600160a01b0390911681526020015b60405180910390f35b61019a610195366004610d3f565b6103e2565b005b61019a6101aa366004610d3f565b610485565b61019a6101bd366004610d3f565b61051f565b61016a6101d0366004610d67565b6105c4565b6101de60015481565b60405190815260200161017e565b61016a6101fa366004610da7565b610879565b61019a61020d366004610d3f565b6108a7565b6101de60025481565b610246610229366004610d3f565b6001600160a01b03165f9081526008602052604090205460ff1690565b604051901515815260200161017e565b61016a7f00000000000000000000000010499d88bd32af443fc936f67de32be1c8bb374c81565b61016a61028b366004610d67565b6001600160a01b039283165f908152600660209081526040808320948616835293815283822092151582529190915220541690565b5f5461016a9061010090046001600160a01b031681565b61016a6102e5366004610cfb565b610942565b5f546102469060ff1681565b60055461016a906001600160a01b031681565b60045461016a906001600160a01b031681565b6101de61012c81565b61032d610987565b60405161017e9190610dbe565b6101de610348366004610e09565b6109e7565b61019a61035b366004610e3a565b610ab1565b60035461016a906001600160a01b031681565b61019a610381366004610e53565b610b1a565b6007546101de565b5f60018262ffffff16116103d8576001600160a01b038085165f90815260066020908152604080832087851684528252808320600162ffffff8816148452909152902054166103da565b5f5b949350505050565b6003546001600160a01b0316331461040d5760405163f5d267eb60e01b815260040160405180910390fd5b6001600160a01b0381166104345760405163d92e233d60e01b815260040160405180910390fd5b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f307ab001eeada03f10e50285db18fcf7dc97c742531d046e2043eb828cd8d51a905f90a35050565b6005546001600160a01b031633146104af5760405162b145b560e31b815260040160405180910390fd5b6001600160a01b0381166104d65760405163d92e233d60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0383169081179091556040517fc0ef652ec5e1ffbc985804cde4457ba9413f0747ac6f2f4a7e195de5330bbd90905f90a250565b5f5461010090046001600160a01b0316331461054e5760405163492f678160e01b815260040160405180910390fd5b6001600160a01b0381166105755760405163d92e233d60e01b815260040160405180910390fd5b5f8054610100600160a81b0319166101006001600160a01b03841690810291909117825560405190917fe02efb9e8f0fc21546730ab32d594f62d586e1bbb15bb5045edd0b1878a77b3591a250565b5f826001600160a01b0316846001600160a01b0316036105f75760405163367558c360e01b815260040160405180910390fd5b5f5f846001600160a01b0316866001600160a01b03161061061957848661061c565b85855b90925090506001600160a01b0382166106485760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038281165f908152600660209081526040808320858516845282528083208815158452909152902054161561069757604051630188c99160e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b60488201525f9060490160405160208183030381529060405280519060200120905061070f7f00000000000000000000000010499d88bd32af443fc936f67de32be1c8bb374c82610bde565b604051631c9776b560e31b81526001600160a01b038581166004830152848116602483015287151560448301529195509085169063e4bbb5a8906064015f604051808303815f87803b158015610763575f5ffd5b505af1158015610775573d5f5f3e3d5ffd5b505050506001600160a01b038381165f8181526006602081815260408084208887168086529083528185208c15158087529084528286208054988d166001600160a01b0319998a16811790915582875294845282862087875284528286208187528452828620805489168617905560078054600181810183557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889091018054909a1687179099558587526008855295839020805460ff191690981790975593548151938452918301919091529192917f2128d88d14c80cb081c1252a5acff7a264671bf199ce226b53788fb26065005e910160405180910390a45050509392505050565b5f6007828154811061088d5761088d610e7b565b5f918252602090912001546001600160a01b031692915050565b6003546001600160a01b031633146108d25760405163f5d267eb60e01b815260040160405180910390fd5b6001600160a01b0381166108f95760405163d92e233d60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f5d0517e3a4eabea892d9750138cd21d4a6cf3b935b43d0598df7055f463819b2905f90a250565b5f60018262ffffff16111561096a576040516352dadcf960e01b815260040160405180910390fd5b600162ffffff83161461097e8585836105c4565b95945050505050565b606060078054806020026020016040519081016040528092919081815260200182805480156109dd57602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116109bf575b5050505050905090565b6004545f906001600160a01b031615610a9757604080516001600160a01b03858116602480840191909152835180840390910181526044909201909252602081810180516001600160e01b0316631711922960e31b1790526004545f938493610a599392909116916207a12091610c49565b915091508115610a94575f81806020019051810190610a789190610e8f565b62ffffff1690506103e88111610a92579250610aab915050565b505b50505b81610aa457600254610aa8565b6001545b90505b92915050565b5f5461010090046001600160a01b03163314610ae05760405163492f678160e01b815260040160405180910390fd5b5f805460ff1916821515908117825560405190917f0d76538efc408318a051137c2720a9e82902acdbd46b802d488b74ca3a09a11691a250565b6003546001600160a01b03163314610b455760405163f5d267eb60e01b815260040160405180910390fd5b61012c811115610b685760405163cd4e616760e01b815260040160405180910390fd5b805f03610b885760405163af13986d60e01b815260040160405180910390fd5b8115610b98576001819055610b9e565b60028190555b8115157f3f15a5f4cc98ad5cfa4ae55040b513ee00b15b742d2b2274d91964c6ff92a34f82604051610bd291815260200190565b60405180910390a25050565b5f763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c175f526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760095ff590506001600160a01b038116610aab576040516330be1a3d60e21b815260040160405180910390fd5b5f60605f5f5f8661ffff1667ffffffffffffffff811115610c6c57610c6c610eb1565b6040519080825280601f01601f191660200182016040528015610c96576020820181803683370190505b5090505f5f8751602089018c8cfa91503d925086831115610cb5578692505b828152825f602083013e909890975095505050505050565b80356001600160a01b0381168114610ce3575f5ffd5b919050565b62ffffff81168114610cf8575f5ffd5b50565b5f5f5f60608486031215610d0d575f5ffd5b610d1684610ccd565b9250610d2460208501610ccd565b91506040840135610d3481610ce8565b809150509250925092565b5f60208284031215610d4f575f5ffd5b610aa882610ccd565b80358015158114610ce3575f5ffd5b5f5f5f60608486031215610d79575f5ffd5b610d8284610ccd565b9250610d9060208501610ccd565b9150610d9e60408501610d58565b90509250925092565b5f60208284031215610db7575f5ffd5b5035919050565b602080825282518282018190525f918401906040840190835b81811015610dfe5783516001600160a01b0316835260209384019390920191600101610dd7565b509095945050505050565b5f5f60408385031215610e1a575f5ffd5b610e2383610ccd565b9150610e3160208401610d58565b90509250929050565b5f60208284031215610e4a575f5ffd5b610aa882610d58565b5f5f60408385031215610e64575f5ffd5b610e6d83610d58565b946020939093013593505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610e9f575f5ffd5b8151610eaa81610ce8565b9392505050565b634e487b7160e01b5f52604160045260245ffdfea26469706673582212204cf19a388d1abc97a88f2fed2d112b3652b98275455121a1bf98fa826e1d3bed64736f6c634300081b0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.