Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Pair | 4062144 | 21 hrs ago | IN | 0 S | 0.11080106 |
Latest 13 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
4146190 | 7 hrs ago | Contract Creation | 0 S | |||
4099210 | 15 hrs ago | Contract Creation | 0 S | |||
4078621 | 19 hrs ago | Contract Creation | 0 S | |||
4078170 | 19 hrs ago | Contract Creation | 0 S | |||
4077913 | 19 hrs ago | Contract Creation | 0 S | |||
4075602 | 19 hrs ago | Contract Creation | 0 S | |||
4073625 | 19 hrs ago | Contract Creation | 0 S | |||
4071725 | 20 hrs ago | Contract Creation | 0 S | |||
4062144 | 21 hrs ago | Contract Creation | 0 S | |||
4059604 | 21 hrs ago | Contract Creation | 0 S | |||
4058861 | 21 hrs ago | Contract Creation | 0 S | |||
4057740 | 22 hrs ago | Contract Creation | 0 S | |||
4041572 | 24 hrs ago | Contract Creation | 0 S |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PairFactory
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 1633 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IPairFactory} from "../interfaces/IPairFactory.sol"; import {IPair} from "./../interfaces/IPair.sol"; import {Pair} from "./../Pair.sol"; contract PairFactory is IPairFactory { /// @inheritdoc IPairFactory address public immutable voter; /// @inheritdoc IPairFactory address public treasury; address public accessHub; address public immutable feeRecipientFactory; uint256 public fee; /// @dev max swap fee set to 50% (required for Dynamic Fee token) uint256 public constant MAX_FEE = 500_000; uint256 public feeSplit; mapping(address token0 => mapping(address token1 => mapping(bool stable => address pair))) public getPair; address[] public allPairs; /// @dev simplified check if its a pair, given that `stable` flag might not be available in peripherals mapping(address pair => bool isPair) public isPair; /// @dev pair => fee mapping(address pair => uint256 fee) private _pairFee; /// @dev whether the pair has skim enabled or not mapping(address pair => bool skimEnabled) public skimEnabled; /// @dev if enabled, fee split to treasury if no gauge bool public feeSplitWhenNoGauge; /// @inheritdoc IPairFactory bytes32 public immutable pairCodeHash; constructor( address _voter, address _treasury, address _accessHub, address _feeRecipientFactory ) { /// @dev default of 0.30% fee = 3000; voter = _voter; treasury = _treasury; accessHub = _accessHub; feeRecipientFactory = _feeRecipientFactory; pairCodeHash = keccak256(type(Pair).creationCode); } modifier onlyGovernanceOrVoter() { require(msg.sender == accessHub || msg.sender == voter); _; } modifier onlyGovernance() { require(msg.sender == accessHub, NOT_AUTHORIZED()); _; } /// @inheritdoc IPairFactory function allPairsLength() external view returns (uint256) { return allPairs.length; } /// @inheritdoc IPairFactory /** @dev for GLOBAL */ function setFee(uint256 _fee) external onlyGovernanceOrVoter { /// @dev ensure it's not zero require(_fee != 0, ZERO_FEE()); /// @dev ensure less than or equal to MAX_FEE require(_fee <= MAX_FEE, FEE_TOO_HIGH()); /// @dev set the global fee fee = _fee; emit SetFee(_fee); } /// @inheritdoc IPairFactory /** @dev for INDIVIDUAL PAIRS */ function setPairFee( address _pair, uint256 _fee ) external onlyGovernanceOrVoter { /// @dev ensure less than or equal to MAX_FEE require(_fee <= MAX_FEE, FEE_TOO_HIGH()); /// @dev if _fee is set to 0, fallback to default fee for the pair uint256 __fee = (_fee == 0 ? fee : _fee); /// @dev set to the new fee IPair(_pair).setFee(__fee); /// @dev store the fee _pairFee[_pair] = __fee; emit SetPairFee(_pair, _fee); } /// @inheritdoc IPairFactory function pairFee(address _pair) public view returns (uint256 feeForPair) { return _pairFee[_pair]; } /// @inheritdoc IPairFactory function setTreasury(address _treasury) external onlyGovernance { treasury = _treasury; emit NewTreasury(msg.sender, _treasury); } /// @inheritdoc IPairFactory /// @notice allow feeSplit directly to treasury if (gauge) does not exist function setFeeSplitWhenNoGauge(bool status) external onlyGovernance { feeSplitWhenNoGauge = status; emit FeeSplitWhenNoGauge(msg.sender, status); } /// @inheritdoc IPairFactory /// @notice set the percent of fee growth to mint in BP e.g. (9500 to mint 95% of fees) /// @dev gated to voter or AccessHub function setFeeSplit(uint256 _feeSplit) external onlyGovernanceOrVoter { /// @dev ensure feeSplit is within bounds require(_feeSplit <= 10_000, INVALID_FEE_SPLIT()); /// @dev update the global feeSplit for newly created pairs feeSplit = _feeSplit; emit SetFeeSplit(_feeSplit); } /// @inheritdoc IPairFactory function setPairFeeSplit( address _pair, uint256 _feeSplit ) external onlyGovernanceOrVoter { /// @dev ensure feeSplit is within bounds require(_feeSplit <= 10_000, INVALID_FEE_SPLIT()); /// @dev set the feeSplit for the specific pair IPair(_pair).setFeeSplit(_feeSplit); emit SetPairFeeSplit(_pair, _feeSplit); } /// @inheritdoc IPairFactory function createPair( address tokenA, address tokenB, bool stable ) external returns (address pair) { /// @dev ensure that tokenA and tokenB are not the same require(tokenA != tokenB, IA()); /// @dev calculate token0 and token1 of the pair by sorting the addresses (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); /// @dev require token is not the 0 address /// @dev we only check token0 because address(0) would be sorted first require(token0 != address(0), ZA()); /// @dev ensure the pairing does not already exist require(getPair[token0][token1][stable] == address(0), PE()); /// @dev pair creation logic bytes32 salt = keccak256(abi.encodePacked(token0, token1, stable)); pair = address(new Pair{salt: salt}()); /// @dev initialize the pair upon creation IPair(pair).initialize(token0, token1, stable); /// @dev should almost always default to the global fee IPair(pair).setFee(fee); /// @dev update the factory’s record so pairFee(_pair) returns the right value _pairFee[pair] = fee; /// @dev if we want an active fee split for gaugeless pairs if (feeSplitWhenNoGauge) { /// @dev set the fee recipient as the treasury IPair(pair).setFeeRecipient(treasury); /// @dev set the global fee split to the pair IPair(pair).setFeeSplit(feeSplit); } /// @dev populate mapping getPair[token0][token1][stable] = pair; /// @dev populate mapping in the reverse direction getPair[token1][token0][stable] = pair; /// @dev push to the allPairs set allPairs.push(pair); /// @dev set the pair status as true isPair[pair] = true; emit PairCreated(token0, token1, pair, allPairs.length); } /// @inheritdoc IPairFactory /// @dev gated to voter or AccessHub function setFeeRecipient(address _pair, address _feeRecipient) external { /// @dev only voter can call upon creation require(msg.sender == voter, NOT_AUTHORIZED()); /// @dev set the fee receiving contract for a pair IPair(_pair).setFeeRecipient(_feeRecipient); emit SetFeeRecipient(_pair, _feeRecipient); } /// @inheritdoc IPairFactory /// @dev function restrict or enable skim functionality on legacy pairs function setSkimEnabled( address _pair, bool _status ) external onlyGovernance { skimEnabled[_pair] = skimEnabled[_pair] != _status ? _status : skimEnabled[_pair]; emit SkimStatus(_pair, _status); } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IPairFactory { error FEE_TOO_HIGH(); error ZERO_FEE(); /// @dev invalid assortment error IA(); /// @dev zero address error ZA(); /// @dev pair exists error PE(); error NOT_AUTHORIZED(); error INVALID_FEE_SPLIT(); event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); event SetFee(uint256 indexed fee); event SetPairFee(address indexed pair, uint256 indexed fee); event SetFeeSplit(uint256 indexed _feeSplit); event SetPairFeeSplit(address indexed pair, uint256 indexed _feeSplit); event SkimStatus(address indexed _pair, bool indexed _status); event NewTreasury(address indexed _caller, address indexed _newTreasury); event FeeSplitWhenNoGauge(address indexed _caller, bool indexed _status); event SetFeeRecipient(address indexed pair, address indexed feeRecipient); /// @notice returns the total length of legacy pairs /// @return _length the length function allPairsLength() external view returns (uint256 _length); /// @notice calculates if the address is a legacy pair /// @param pair the address to check /// @return _boolean the bool return function isPair(address pair) external view returns (bool _boolean); /// @notice calculates the pairCodeHash /// @return _hash the pair code hash function pairCodeHash() external view returns (bytes32 _hash); /// @param tokenA address of tokenA /// @param tokenB address of tokenB /// @param stable whether it uses the stable curve /// @return _pair the address of the pair function getPair( address tokenA, address tokenB, bool stable ) external view returns (address _pair); /// @notice creates a new legacy pair /// @param tokenA address of tokenA /// @param tokenB address of tokenB /// @param stable whether it uses the stable curve /// @return pair the address of the created pair function createPair( address tokenA, address tokenB, bool stable ) external returns (address pair); /// @notice the address of the voter /// @return _voter the address of the voter function voter() external view returns (address _voter); /// @notice returns the address of a pair based on the index /// @param _index the index to check for a pair /// @return _pair the address of the pair at the index function allPairs(uint256 _index) external view returns (address _pair); /// @notice the swap fee of a pair /// @param _pair the address of the pair /// @return _fee the fee function pairFee(address _pair) external view returns (uint256 _fee); /// @notice the split of fees /// @return _split the feeSplit function feeSplit() external view returns (uint256 _split); /// @notice sets the swap fee for a pair /// @param _pair the address of the pair /// @param _fee the fee for the pair function setPairFee(address _pair, uint256 _fee) external; /// @notice set the swap fees of the pair /// @param _fee the fee, scaled to MAX 10% of 100_000 function setFee(uint256 _fee) external; /// @notice the address for the treasury /// @return _treasury address of the treasury function treasury() external view returns (address _treasury); /// @notice sets the pairFees contract /// @param _pair the address of the pair /// @param _pairFees the address of the new Pair Fees function setFeeRecipient(address _pair, address _pairFees) external; /// @notice sets the feeSplit for a pair /// @param _pair the address of the pair /// @param _feeSplit the feeSplit function setPairFeeSplit(address _pair, uint256 _feeSplit) external; /// @notice whether there is feeSplit when there's no gauge /// @return _boolean whether there is a feesplit when no gauge function feeSplitWhenNoGauge() external view returns (bool _boolean); /// @notice whether a pair can be skimmed /// @param _pair the pair address /// @return _boolean whether skim is enabled function skimEnabled(address _pair) external view returns (bool _boolean); /// @notice set whether skim is enabled for a specific pair function setSkimEnabled(address _pair, bool _status) external; /// @notice sets a new treasury address /// @param _treasury the new treasury address function setTreasury(address _treasury) external; /// @notice set whether there should be a feesplit without gauges /// @param status whether enabled or not function setFeeSplitWhenNoGauge(bool status) external; /// @notice sets the feesSplit globally /// @param _feeSplit the fee split function setFeeSplit(uint256 _feeSplit) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IPair { error NOT_AUTHORIZED(); error UNSTABLE_RATIO(); /// @dev safe transfer failed error STF(); error OVERFLOW(); /// @dev skim disabled error SD(); /// @dev insufficient liquidity minted error ILM(); /// @dev insufficient liquidity burned error ILB(); /// @dev insufficient output amount error IOA(); /// @dev insufficient input amount error IIA(); error IL(); error IT(); error K(); event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); /// @notice initialize the pool, called only once programatically function initialize( address _token0, address _token1, bool _stable ) external; /// @notice calculate the current reserves of the pool and their last 'seen' timestamp /// @return _reserve0 amount of token0 in reserves /// @return _reserve1 amount of token1 in reserves /// @return _blockTimestampLast the timestamp when the pool was last updated function getReserves() external view returns ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ); /// @notice mint the pair tokens (LPs) /// @param to where to mint the LP tokens to /// @return liquidity amount of LP tokens to mint function mint(address to) external returns (uint256 liquidity); /// @notice burn the pair tokens (LPs) /// @param to where to send the underlying /// @return amount0 amount of amount0 /// @return amount1 amount of amount1 function burn( address to ) external returns (uint256 amount0, uint256 amount1); /// @notice direct swap through the pool function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; /// @notice force balances to match reserves, can be used to harvest rebases from rebasing tokens or other external factors /// @param to where to send the excess tokens to function skim(address to) external; /// @notice force reserves to match balances, prevents skim excess if skim is enabled function sync() external; /// @notice set the pair fees contract address function setFeeRecipient(address _pairFees) external; /// @notice set the feesplit variable function setFeeSplit(uint256 _feeSplit) external; /// @notice sets the swap fee of the pair /// @dev max of 10_000 (10%) /// @param _fee the fee function setFee(uint256 _fee) external; /// @notice 'mint' the fees as LP tokens /// @dev this is used for protocol/voter fees function mintFee() external; /// @notice calculates the amount of tokens to receive post swap /// @param amountIn the token amount /// @param tokenIn the address of the token function getAmountOut( uint256 amountIn, address tokenIn ) external view returns (uint256 amountOut); /// @notice returns various metadata about the pair function metadata() external view returns ( uint256 _decimals0, uint256 _decimals1, uint256 _reserve0, uint256 _reserve1, bool _stable, address _token0, address _token1 ); /// @notice returns the feeSplit of the pair function feeSplit() external view returns (uint256); /// @notice returns the fee of the pair function fee() external view returns (uint256); /// @notice returns the feeRecipient of the pair function feeRecipient() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC20Extended} from "./interfaces/IERC20Extended.sol"; import {UQ112x112} from "./libraries/UQ112x112.sol"; import {IPairCallee} from "./interfaces/IPairCallee.sol"; import {IPairFactory} from "./interfaces/IPairFactory.sol"; import {IPair} from "./interfaces/IPair.sol"; contract Pair is IPair, ERC20, ReentrancyGuard { using UQ112x112 for uint224; /// @dev Structure to capture time period obervations every 30 minutes, used for local oracles struct Observation { uint256 timestamp; uint256 reserve0Cumulative; uint256 reserve1Cumulative; } Observation[] public observations; uint256 internal _unlocked; /// @notice Capture oracle reading every 30 minutes uint256 constant periodSize = 1800; /// @notice min liquidity amount which is burned on creation uint256 public constant MINIMUM_LIQUIDITY = 10 ** 3; /// @notice legacy factory address address public immutable factory; /// @notice token0 in the pool address public token0; /// @notice token1 in the pool address public token1; /// @notice where the swap fees accrue to address public feeRecipient; /// @dev uses single storage slot, accessible via getReserves uint112 private reserve0; /// @dev uses single storage slot, accessible via getReserves uint112 private reserve1; /// @dev uses single storage slot, accessible via getReserves uint32 private blockTimestampLast; uint256 public reserve0CumulativeLast; uint256 public reserve1CumulativeLast; /// @dev reserve0 * reserve1, as of immediately after the most recent liquidity event uint256 public kLast; /// @dev the portion that goes to feeRecipient, rest goes to LPs. 100% of the fees goes to feeRecipient if it's set to 10000 uint256 public feeSplit; uint256 public fee; uint256 internal decimals0; uint256 internal decimals1; /// @dev first MINIMUM_LIQUIDITY tokens are permanently locked uint256 internal constant MINIMUM_K = 10 ** 9; /// @dev 1m = 100% uint256 internal constant FEE_DENOM = 1_000_000; /// @notice whether the pool uses the xy(x^2 * y + y^2 * x) >= k swap curve bool public stable; string internal _name; string internal _symbol; constructor() ERC20("", "") { /// @dev initialize the factory address factory = msg.sender; } /// @inheritdoc IPair function initialize( address _token0, address _token1, bool _stable ) external { /// @dev prevent anyone other than the factory from calling require(msg.sender == factory, NOT_AUTHORIZED()); token0 = _token0; token1 = _token1; string memory __name; string memory __symbol; stable = _stable; if (_stable) { __name = string( string.concat( "Legacy Correlated- ", IERC20Extended(token0).symbol(), "/", IERC20Extended(token1).symbol() ) ); __symbol = string( string.concat( "cAMM-", IERC20Extended(token0).symbol(), "/", IERC20Extended(token1).symbol() ) ); } else { __name = string( string.concat( "Legacy Volatile- ", IERC20Extended(token0).symbol(), "/", IERC20Extended(token1).symbol() ) ); __symbol = string( string.concat( "vAMM-", IERC20Extended(token0).symbol(), "/", IERC20Extended(token1).symbol() ) ); } _name = __name; _symbol = __symbol; observations.push(Observation(block.timestamp, 0, 0)); decimals0 = 10 ** IERC20Extended(token0).decimals(); decimals1 = 10 ** IERC20Extended(token1).decimals(); } /// @inheritdoc IPair function getReserves() public view returns ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ) { _reserve0 = reserve0; _reserve1 = reserve1; _blockTimestampLast = blockTimestampLast; } function _safeTransfer(address token, address to, uint256 value) private { require(token.code.length > 0); (bool success, bytes memory data) = token.call( abi.encodeCall(IERC20Extended.transfer, (to, value)) ); if (!(success && (data.length == 0 || abi.decode(data, (bool))))) { revert STF(); } } /// @dev update reserves and, on the first call per block, reserve accumulators function _update( uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1 ) private { /// @dev ensure no overflow require( balance0 <= type(uint112).max && balance1 <= type(uint112).max, OVERFLOW() ); /// @dev store blockstamp uint256 blockTimestamp = block.timestamp; /// @dev declare uint256 timeElapsed; /// @dev overflow is desired unchecked { /// @dev time elapsed since the last update timeElapsed = blockTimestamp - uint256(blockTimestampLast); /// @dev if timeElapsed is gt 0 and the reserves are not 0 if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { /// @dev update the cumulatives reserve0CumulativeLast += _reserve0 * timeElapsed; reserve1CumulativeLast += _reserve1 * timeElapsed; } } /// @dev fetch the last observation Observation memory _point = lastObservation(); /// @dev compare the last observation with current timestamp, if greater than 30 minutes, record a new event timeElapsed = blockTimestamp - _point.timestamp; /// @dev if > the periodSize (usually 30m twap) if (timeElapsed > periodSize) { observations.push( Observation( blockTimestamp, reserve0CumulativeLast, reserve1CumulativeLast ) ); } reserve0 = uint112(balance0); reserve1 = uint112(balance1); blockTimestampLast = uint32(blockTimestamp); emit Sync(reserve0, reserve1); } /// @dev if fee is on, mint liquidity up to the entire growth in sqrt(k) function _mintFee( uint112 _reserve0, uint112 _reserve1 ) private returns (bool feeOn) { /// @dev gas savings address _feeRecipient = feeRecipient; /// @dev gas savings uint256 _kLast = kLast; /// @dev we define fee being on as the existence of the fee recipient feeOn = _feeRecipient != address(0); /// @dev if there are any fees not going to LP providers if (feeOn) { /// @dev portion of fees that go to feeRecipient uint256 _feeSplit = feeSplit; /// @dev if the reserve calculation is not 0 if (_kLast != 0) { /// @dev if a stableswap/correlated pair with curve: xy(x^2y + y^2x) >= k if (stable) { /// @dev fetch current k value uint256 k = _k(_reserve0, _reserve1); /// @dev if k is greater than the _kLast variable if (k > _kLast) { uint256 fourthRoot_e18 = Math.sqrt( Math.mulDiv(Math.sqrt(_kLast), 1e36, Math.sqrt(k)) ); uint256 numerator = _feeSplit * (1e18 - fourthRoot_e18) * 1e18; uint256 denominator = ((10_000 * 1e18) - (_feeSplit * (1e18 - fourthRoot_e18))); /// @dev new liquidity to be minted uint256 feeAsLiquidity = (totalSupply() * numerator) / denominator / 1e18; if (feeAsLiquidity > 0) { _mint(_feeRecipient, feeAsLiquidity); } } } /// @dev if !stable else { uint256 rootK = Math.sqrt( _k(uint256(_reserve0), uint256(_reserve1)) ); uint256 rootKLast = Math.sqrt(_kLast); if (rootK > rootKLast) { /// @dev calculate fee amounts to send uint256 diffK = rootK - rootKLast; uint256 dueToProtocol = (diffK * _feeSplit) / 10_000; uint256 dueToLp = rootKLast + diffK - dueToProtocol; /// @dev new liquidity to be minted /// @dev n = s*P/d uint256 feeAsLiquidity = (totalSupply() * dueToProtocol) / dueToLp; if (feeAsLiquidity > 0) { _mint(_feeRecipient, feeAsLiquidity); } } } } } /// @dev if !feeOn else if (_kLast != 0) { /// @dev update kLast to reflect reserves kLast = _k(reserve0, reserve1); } } /// @inheritdoc IPair /// @dev this low-level function should be called from a contract which performs important safety checks function mint( address to ) external nonReentrant returns (uint256 liquidity) { /// @dev gas savings (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); uint256 balance0 = IERC20Extended(token0).balanceOf(address(this)); uint256 balance1 = IERC20Extended(token1).balanceOf(address(this)); uint256 amount0 = balance0 - _reserve0; uint256 amount1 = balance1 - _reserve1; bool feeOn = _mintFee(_reserve0, _reserve1); /// @dev gas savings, must be defined here since totalSupply can update in _mintFee uint256 _totalSupply = totalSupply(); if (_totalSupply == 0) { liquidity = Math.sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY; /// @dev permanently lock the first MINIMUM_LIQUIDITY tokens _mint(address(0xdead), MINIMUM_LIQUIDITY); if (stable) { require(_k(amount0, amount1) >= MINIMUM_K, K()); require( ((amount0 * 1e18) / decimals0 == (amount1 * 1e18) / decimals1), UNSTABLE_RATIO() ); } } else { liquidity = Math.min( (amount0 * _totalSupply) / _reserve0, (amount1 * _totalSupply) / _reserve1 ); } require(liquidity != 0, ILM()); _mint(to, liquidity); _update(balance0, balance1, _reserve0, _reserve1); /// @dev reserve0 and reserve1 are up-to-date if (feeOn) kLast = _k(uint256(reserve0), uint256(reserve1)); emit Mint(msg.sender, amount0, amount1); } /// @inheritdoc IPair /// @dev this low-level function should be called from a contract which performs important safety checks function burn( address to ) external nonReentrant returns (uint256 amount0, uint256 amount1) { /// @dev gas savings (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); /// @dev gas savings address _token0 = token0; /// @dev gas savings address _token1 = token1; uint256 balance0 = IERC20Extended(_token0).balanceOf(address(this)); uint256 balance1 = IERC20Extended(_token1).balanceOf(address(this)); /// @dev fetch the balance of the liquidity of the Pair uint256 liquidity = balanceOf(address(this)); /// @dev attempt to mint fees and calculate if feeOn is active bool feeOn = _mintFee(_reserve0, _reserve1); /// @dev gas savings, must be defined here since totalSupply can update in _mintFee uint256 _totalSupply = totalSupply(); /// @dev using balances ensures pro-rata distribution amount0 = (liquidity * balance0) / _totalSupply; /// @dev using balances ensures pro-rata distribution amount1 = (liquidity * balance1) / _totalSupply; /// @dev require the amounts are not zero, else it's insufficient liquidity burned and revert require(amount0 != 0 && amount1 != 0, ILB()); /// @dev burn the liquidity tokens _burn(address(this), liquidity); /// @dev safe transfer the two underlying tokens (incase of tax tokens etc) _safeTransfer(_token0, to, amount0); _safeTransfer(_token1, to, amount1); /// @dev fetch updated balances balance0 = IERC20Extended(_token0).balanceOf(address(this)); balance1 = IERC20Extended(_token1).balanceOf(address(this)); /// @dev update with the new balances _update(balance0, balance1, _reserve0, _reserve1); /// @dev reserve0 and reserve1 are up-to-date if (feeOn) kLast = _k(reserve0, reserve1); emit Burn(msg.sender, amount0, amount1, to); } /// @inheritdoc IPair /// @dev this low-level function should be called from a contract which performs important safety checks function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external nonReentrant { /// @dev require at least one is not 0, else revert for Insufficient Output Amount require(amount0Out != 0 || amount1Out != 0, IOA()); /// @dev gas savings (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); /// @dev ensure there is enough liquidity for the swap require(amount0Out < _reserve0 && amount1Out < _reserve1, IL()); /// @dev gas savings address _token0 = token0; address _token1 = token1; require(to != _token0 && to != _token1, IT()); /// @dev optimistically transfer tokens if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); /// @dev optimistically transfer tokens if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); if (data.length > 0) IPairCallee(to).hook(msg.sender, amount0Out, amount1Out, data); uint256 balance0 = IERC20Extended(_token0).balanceOf(address(this)); uint256 balance1 = IERC20Extended(_token1).balanceOf(address(this)); uint256 amount0In; uint256 amount1In; unchecked { amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0; amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0; } require(amount0In != 0 || amount1In != 0, IIA()); /// @dev FEE_DENOM as the denominator invariant for calculating swap fees uint256 balance0Adjusted = balance0 - ((amount0In * fee) / FEE_DENOM); uint256 balance1Adjusted = balance1 - ((amount1In * fee) / FEE_DENOM); require( _k(balance0Adjusted, balance1Adjusted) >= _k(uint256(_reserve0), uint256(_reserve1)), K() ); _update(balance0, balance1, _reserve0, _reserve1); emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to); } /// @inheritdoc IPair function skim(address to) external nonReentrant { /// @dev if skim disabled, revert /// @dev by default it is disabled as it uses a mapping in the pair factory contract require((IPairFactory(factory).skimEnabled(address(this))), SD()); /// @dev gas savings address _token0 = token0; /// @dev gas savings address _token1 = token1; _safeTransfer( _token0, to, IERC20Extended(_token0).balanceOf(address(this)) - reserve0 ); _safeTransfer( _token1, to, IERC20Extended(_token1).balanceOf(address(this)) - reserve1 ); } /// @inheritdoc IPair function sync() external nonReentrant { /// @dev update the reserves to match balances _update( IERC20Extended(token0).balanceOf(address(this)), IERC20Extended(token1).balanceOf(address(this)), reserve0, reserve1 ); } /// @inheritdoc IPair function setFeeRecipient(address _feeRecipient) external { /// @dev gate to the PairFactory require(msg.sender == factory, NOT_AUTHORIZED()); feeRecipient = _feeRecipient; } /// @inheritdoc IPair function setFeeSplit(uint256 _feeSplit) external { /// @dev gate to the PairFactory require(msg.sender == factory, NOT_AUTHORIZED()); feeSplit = _feeSplit; } /// @inheritdoc IPair function setFee(uint256 _fee) external { /// @dev gate to the PairFactory require(msg.sender == factory, NOT_AUTHORIZED()); fee = _fee; } /// @inheritdoc IPair function mintFee() external nonReentrant { /// @dev fetch the current public reserves uint112 _reserve0 = reserve0; uint112 _reserve1 = reserve1; /// @dev mint the accumulated fees bool feeOn = _mintFee(_reserve0, _reserve1); /// @dev if minting was successful if (feeOn) kLast = _k(uint256(_reserve0), uint256(_reserve1)); } function _k(uint256 x, uint256 y) internal view returns (uint256) { if (stable) { uint256 _x = (x * 10 ** 18) / decimals0; uint256 _y = (y * 10 ** 18) / decimals1; uint256 _a = (_x * _y) / 10 ** 18; uint256 _b = ((_x * _x) / 10 ** 18 + (_y * _y) / 10 ** 18); /// @dev x3y+y3x >= k return (_a * _b) / 10 ** 18; } else { /// @dev xy >= k return x * y; } } function _f(uint256 x0, uint256 y) internal pure returns (uint256) { return (x0 * ((((y * y) / 1e18) * y) / 1e18)) / 1e18 + (((((x0 * x0) / 1e18) * x0) / 1e18) * y) / 1e18; } function _d(uint256 x0, uint256 y) internal pure returns (uint256) { return (3 * x0 * ((y * y) / 1e18)) / 1e18 + ((((x0 * x0) / 1e18) * x0) / 1e18); } function _get_y( uint256 x0, uint256 xy, uint256 y ) internal pure returns (uint256) { for (uint256 i = 0; i < 255; ++i) { uint256 y_prev = y; uint256 k = _f(x0, y); if (k < xy) { uint256 dy = ((xy - k) * 1e18) / _d(x0, y); y = y + dy; } else { uint256 dy = ((k - xy) * 1e18) / _d(x0, y); y = y - dy; } if (y > y_prev) { if (y - y_prev <= 1) { return y; } } else { if (y_prev - y <= 1) { return y; } } } return y; } /// @inheritdoc IPair function getAmountOut( uint256 amountIn, address tokenIn ) external view returns (uint256) { (uint256 _reserve0, uint256 _reserve1) = (reserve0, reserve1); /// @dev remove fee from amount received amountIn -= (amountIn * fee) / FEE_DENOM; return _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1) - 1; } function _getAmountOut( uint256 amountIn, address tokenIn, uint256 _reserve0, uint256 _reserve1 ) internal view returns (uint256) { if (stable) { uint256 xy = _k(_reserve0, _reserve1); _reserve0 = (_reserve0 * 1e18) / decimals0; _reserve1 = (_reserve1 * 1e18) / decimals1; (uint256 reserveA, uint256 reserveB) = tokenIn == token0 ? (_reserve0, _reserve1) : (_reserve1, _reserve0); amountIn = tokenIn == token0 ? (amountIn * 1e18) / decimals0 : (amountIn * 1e18) / decimals1; uint256 y = reserveB - _get_y(amountIn + reserveA, xy, reserveB); return (y * (tokenIn == token0 ? decimals1 : decimals0)) / 1e18; } else { (uint256 reserveA, uint256 reserveB) = tokenIn == token0 ? (_reserve0, _reserve1) : (_reserve1, _reserve0); return (amountIn * reserveB) / (reserveA + amountIn); } } function metadata() external view returns ( uint256 _decimals0, uint256 _decimals1, uint256 _reserve0, uint256 _reserve1, bool _stable, address _token0, address _token1 ) { return ( decimals0, decimals1, reserve0, reserve1, stable, token0, token1 ); } function observationLength() external view returns (uint256) { return observations.length; } function lastObservation() public view returns (Observation memory) { return observations[observations.length - 1]; } /// @dev produces the cumulative price using counterfactuals to save gas and avoid a call to sync. function currentCumulativePrices() public view returns ( uint256 reserve0Cumulative, uint256 reserve1Cumulative, uint256 blockTimestamp ) { blockTimestamp = block.timestamp; reserve0Cumulative = reserve0CumulativeLast; reserve1Cumulative = reserve1CumulativeLast; /// @dev if time has elapsed since the last update on the pair, mock the accumulated price values ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ) = getReserves(); if (_blockTimestampLast != uint32(blockTimestamp)) { /// @dev subtraction overflow is desired uint256 timeElapsed = blockTimestamp - uint256(_blockTimestampLast); reserve0Cumulative += _reserve0 * timeElapsed; reserve1Cumulative += _reserve1 * timeElapsed; } } /// @dev gives the current twap price measured from amountIn * tokenIn gives amountOut function current( address tokenIn, uint256 amountIn ) external view returns (uint256 amountOut) { Observation memory _observation = lastObservation(); ( uint256 reserve0Cumulative, uint256 reserve1Cumulative, ) = currentCumulativePrices(); if (block.timestamp == _observation.timestamp) { _observation = observations[observations.length - 2]; } uint256 timeElapsed = block.timestamp - _observation.timestamp; uint256 _reserve0 = (reserve0Cumulative - _observation.reserve0Cumulative) / timeElapsed; uint256 _reserve1 = (reserve1Cumulative - _observation.reserve1Cumulative) / timeElapsed; amountOut = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1); } /// @dev as per `current`, however allows user configured granularity, up to the full window size function quote( address tokenIn, uint256 amountIn, uint256 granularity ) external view returns (uint256 amountOut) { uint256[] memory _prices = sample(tokenIn, amountIn, granularity, 1); uint256 priceAverageCumulative; for (uint256 i = 0; i < _prices.length; ++i) { priceAverageCumulative += _prices[i]; } return priceAverageCumulative / granularity; } /// @dev returns a memory set of twap prices function prices( address tokenIn, uint256 amountIn, uint256 points ) external view returns (uint256[] memory) { return sample(tokenIn, amountIn, points, 1); } function sample( address tokenIn, uint256 amountIn, uint256 points, uint256 window ) public view returns (uint256[] memory) { uint256[] memory _prices = new uint256[](points); uint256 length = observations.length - 1; uint256 i = length - (points * window); uint256 nextIndex = 0; uint256 index = 0; for (; i < length; i += window) { nextIndex = i + window; uint256 timeElapsed = observations[nextIndex].timestamp - observations[i].timestamp; uint256 _reserve0 = (observations[nextIndex].reserve0Cumulative - observations[i].reserve0Cumulative) / timeElapsed; uint256 _reserve1 = (observations[nextIndex].reserve1Cumulative - observations[i].reserve1Cumulative) / timeElapsed; _prices[index] = _getAmountOut( amountIn, tokenIn, _reserve0, _reserve1 ); /// @dev index < length; length cannot overflow unchecked { index = index + 1; } } return _prices; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.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}. * * 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 ERC-20 * applications. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => 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 returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual 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 returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual 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 `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` 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 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Skips emitting an {Approval} event indicating an allowance update. This is not * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. * * 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 `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` 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. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` 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. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * * ```solidity * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 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²⁵⁶ + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // 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²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @dev Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 1); } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 1); } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol"; interface IERC20Extended is IERC20, IERC20Metadata, IERC20Permit { function mint(address account, uint256 amount) external; function burn(uint256 amount) external; function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function burnFrom(address account, uint256 value) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112 library UQ112x112 { uint224 constant Q112 = 2 ** 112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { unchecked { z = uint224(y) * Q112; // never overflows } } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { unchecked { z = x / uint224(y); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; interface IPairCallee { function hook( address sender, uint256 amount0, uint256 amount1, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC-20 standard. */ 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 v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612]. * * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
{ "remappings": [ "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@forge-std-1.9.4/=dependencies/forge-std-1.9.4/", "@layerzerolabs/=node_modules/@layerzerolabs/", "@layerzerolabs/lz-evm-protocol-v2/=node_modules/@layerzerolabs/lz-evm-protocol-v2/", "@openzeppelin-contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@openzeppelin-contracts/contracts/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.1.0/", "erc4626-tests/=dependencies/erc4626-property-tests-1.0/", "forge-std/=dependencies/forge-std-1.9.4/src/", "permit2/=lib/permit2/", "@openzeppelin-3.4.2/=node_modules/@openzeppelin-3.4.2/", "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@uniswap/=node_modules/@uniswap/", "base64-sol/=node_modules/base64-sol/", "ds-test/=node_modules/ds-test/", "erc4626-property-tests-1.0/=dependencies/erc4626-property-tests-1.0/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std-1.9.4/=dependencies/forge-std-1.9.4/src/", "hardhat/=node_modules/hardhat/", "solidity-bytes-utils/=node_modules/solidity-bytes-utils/", "solmate/=node_modules/solmate/" ], "optimizer": { "enabled": true, "runs": 1633 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": true, "libraries": { "contracts/libraries/RewardClaimers.sol": { "RewardClaimers": "0xdc9a095cF9558F01541a55d839e5Db70f0FF7ed3" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_accessHub","type":"address"},{"internalType":"address","name":"_feeRecipientFactory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FEE_TOO_HIGH","type":"error"},{"inputs":[],"name":"IA","type":"error"},{"inputs":[],"name":"INVALID_FEE_SPLIT","type":"error"},{"inputs":[],"name":"NOT_AUTHORIZED","type":"error"},{"inputs":[],"name":"PE","type":"error"},{"inputs":[],"name":"ZA","type":"error"},{"inputs":[],"name":"ZERO_FEE","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":true,"internalType":"bool","name":"_status","type":"bool"}],"name":"FeeSplitWhenNoGauge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":true,"internalType":"address","name":"_newTreasury","type":"address"}],"name":"NewTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":true,"internalType":"address","name":"feeRecipient","type":"address"}],"name":"SetFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_feeSplit","type":"uint256"}],"name":"SetFeeSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetPairFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":true,"internalType":"uint256","name":"_feeSplit","type":"uint256"}],"name":"SetPairFeeSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_pair","type":"address"},{"indexed":true,"internalType":"bool","name":"_status","type":"bool"}],"name":"SkimStatus","type":"event"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessHub","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPairsLength","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":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipientFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeSplit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeSplitWhenNoGauge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"getPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"}],"name":"isPair","outputs":[{"internalType":"bool","name":"isPair","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairCodeHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"}],"name":"pairFee","outputs":[{"internalType":"uint256","name":"feeForPair","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"address","name":"_feeRecipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeSplit","type":"uint256"}],"name":"setFeeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setFeeSplitWhenNoGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setPairFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"uint256","name":"_feeSplit","type":"uint256"}],"name":"setPairFeeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setSkimEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"}],"name":"skimEnabled","outputs":[{"internalType":"bool","name":"skimEnabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e060405234610103576182cd6080813803918261001c81610107565b9384928339810103126101035761003281610140565b9061003f60208201610140565b610057606061005060408501610140565b9301610140565b610bb86002556080939093525f80546001600160a01b039283166001600160a01b0319918216179091556001805493909216921691909117905560a0526138eb6100a360208201610107565b81815260208101916149e2833951902060c05260405161488d908161015582396080518181816103fb0152818161054701528181610b7b01528181610c8301528181610d770152610dcb015260a05181610319015260c051816105860152f35b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761012c57604052565b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036101035756fe60806040526004361015610011575f80fd5b5f5f3560e01c80631e3dd18b14610e8e578063270401cb14610d9e578063407c301e14610ca757806346c96aac14610c63578063574f2ba314610c4557806361d027b314610c1f5780636373ea6914610c015780636801cc3014610ba257806369fe0e2d14610ad057806382dfdce41461066c57806383b274f214610649578063841fa66b1461061157806390291058146105a95780639aab92481461056e578063a93a897d14610440578063bc063e1a14610422578063cd962a061461037a578063d2b663841461033d578063d32af6c1146102f9578063ddca3f43146102db578063e0bd111d14610211578063e5e31b13146101d4578063e7589b39146101ad5763f0f4426014610122575f80fd5b346101aa5760203660031901126101aa5761013b610efb565b6001600160a01b0360015416330361019b576001600160a01b03168073ffffffffffffffffffffffffffffffffffffffff19835416178255337f567657fa3f286518b318f4a29870674f433f622fdfc819691acb13105b2282258380a380f35b600482633d83866f60e01b8152fd5b80fd5b50346101aa57806003193601126101aa5760206001600160a01b0360015416604051908152f35b50346101aa5760203660031901126101aa5760ff60406020926001600160a01b036101fd610efb565b168152600684522054166040519015158152f35b50346101aa5760403660031901126101aa5761022b610efb565b602435801515918282036102d7576001600160a01b036001541633036102c8576001600160a01b03168084526008602052604084205490919060ff16151583146102b2575b8184526008602052604084209060ff8019835416911515161790557f13af6400168c56d7a03760d35e1d3d7e60d3f86c654d857e5c77ed8a83ffc1198380a380f35b50808352600860205260ff604084205416610270565b600484633d83866f60e01b8152fd5b8380fd5b50346101aa57806003193601126101aa576020600254604051908152f35b50346101aa57806003193601126101aa5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101aa5760203660031901126101aa5760ff60406020926001600160a01b03610366610efb565b168152600884522054166040519015158152f35b50346101aa5760203660031901126101aa576004356001600160a01b0360015416331480156103f0575b156103ec5761271081116103dd57806003557f2b29780fbcadbddb5194d8c2c6a834e1cd71e5a38456738fb1c9d39c7821066b8280a280f35b60048263740efc0360e01b8152fd5b5080fd5b506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633146103a4565b50346101aa57806003193601126101aa5760206040516207a1208152f35b50346101aa5760403660031901126101aa5761045a610efb565b602435906001600160a01b03600154163314801561053c575b15610538576207a1208211610529578161051a576001600160a01b03600254915b1690813b156102d757836040516369fe0e2d60e01b8152826004820152818160248183885af1801561050f576104fa575b50829052600760205260408420557fc792b1e9d2b63c63a75f8146a0b5bd7f568bdd6a0b97b9c31d585398718d4c468380a380f35b8161050491610f36565b6102d757835f6104c5565b6040513d84823e3d90fd5b6001600160a01b038291610494565b6004836345fbd9c160e01b8152fd5b8280fd5b506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314610473565b50346101aa57806003193601126101aa5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346101aa5760203660031901126101aa576004358015158091036103ec576001600160a01b0360015416330361019b5760ff196009541660ff821617600955337f09f29919de9bbce805ed8b6088457163a7508940470e70a1c67a8d58a70b433d8380a380f35b50346101aa5760203660031901126101aa5760406020916001600160a01b03610638610efb565b168152600783522054604051908152f35b50346101aa57806003193601126101aa57602060ff600954166040519015158152f35b50346101aa5760603660031901126101aa57610686610efb565b61068e610f11565b610696610f27565b916001600160a01b0382166001600160a01b038216818114610aa8571015610aa2575b6001600160a01b038116908115610a7a578185526004602052604085206001600160a01b0384165f5260205260405f20931515938486526020526001600160a01b03604086205416610a52576040516bffffffffffffffffffffffff19602082019260601b1682526bffffffffffffffffffffffff196001600160a01b0385169460601b1660348201528460f81b60488201526029815261075b604982610f36565b5190206040516138eb8082019082821067ffffffffffffffff831117610a3e57908291610f6d8339039086f58015610a33576001600160a01b031692833b156109f057846040517fe4bbb5a80000000000000000000000000000000000000000000000000000000081528360048201528460248201528260448201528181606481838a5af1801561050f57610a1e575b50600254853b156103ec57604051906369fe0e2d60e01b825260048201528181602481838a5af1801561050f57610a09575b50506002548486526007602052604086205560ff60095416610968575b818552600460205260408520835f5260205260405f20818652602052604085206001600160a01b03851673ffffffffffffffffffffffffffffffffffffffff19825416179055828552600460205260408520825f5260205260405f20908552602052604084206001600160a01b03841673ffffffffffffffffffffffffffffffffffffffff1982541617905560055468010000000000000000811015610954576020946108ef82600160409401600555610ecf565b81549060031b906001600160a01b0388831b921b19161790558481526006865220600160ff198254161790557f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9604060055481519086825287820152a3604051908152f35b602485634e487b7160e01b81526041600452fd5b846001600160a01b03815416853b156103ec576040519063e74b981b60e01b825260048201528181602481838a5af1801561050f576109f4575b50600354853b156103ec57604051906366cb150360e11b825260048201528181602481838a5af1801561050f576109db575b505061083a565b816109e591610f36565b6109f057845f6109d4565b8480fd5b816109fe91610f36565b6109f057845f6109a2565b81610a1391610f36565b6109f057845f61081d565b81610a2891610f36565b6109f057845f6107eb565b6040513d86823e3d90fd5b602488634e487b7160e01b81526041600452fd5b6004857f6d47e01d000000000000000000000000000000000000000000000000000000008152fd5b6004857f7759ce3f000000000000000000000000000000000000000000000000000000008152fd5b906106b9565b6004867f782e49d8000000000000000000000000000000000000000000000000000000008152fd5b50346101aa5760203660031901126101aa576004356001600160a01b036001541633148015610b70575b156103ec578015610b48576207a1208111610b3957806002557e172ddfc5ae88d08b3de01a5a187667c37a5a53989e8c175055cb6c993792a78280a280f35b6004826345fbd9c160e01b8152fd5b6004827f3ac4c7fe000000000000000000000000000000000000000000000000000000008152fd5b506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314610afa565b50346101aa5760603660031901126101aa576001600160a01b036040602092610bc9610efb565b610bd1610f11565b84610bda610f27565b92168352600486528484842091165f528552825f2090151582528452205416604051908152f35b50346101aa57806003193601126101aa576020600354604051908152f35b50346101aa57806003193601126101aa576001600160a01b036020915416604051908152f35b50346101aa57806003193601126101aa576020600554604051908152f35b50346101aa57806003193601126101aa5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101aa5760403660031901126101aa57610cc1610efb565b602435906001600160a01b036001541633148015610d6c575b15610538576127108211610d5d576001600160a01b0316803b1561053857826040516366cb150360e11b8152836004820152818160248183875af1801561050f57610d48575b50807f40c433a8082166fcd8218fba9d4247bb08e03016d0056fc857d6363673ded03191a380f35b81610d5291610f36565b61053857825f610d20565b60048363740efc0360e01b8152fd5b506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314610cda565b5034610e7b576040366003190112610e7b57610db8610efb565b610dc0610f11565b906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610e7f576001600160a01b0316803b15610e7b576001600160a01b036040519263e74b981b60e01b845216918260048201525f8160248183865af18015610e7057610e5b575b507fd9d6b85b6d670cd443496fc6d03390f739bbff47f96a8e33fb0cdd52ad26f5c28380a380f35b610e689193505f90610f36565b5f915f610e33565b6040513d5f823e3d90fd5b5f80fd5b633d83866f60e01b5f5260045ffd5b34610e7b576020366003190112610e7b57600435600554811015610e7b576001600160a01b03610ebf602092610ecf565b90549060031b1c16604051908152f35b600554811015610ee75760055f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b600435906001600160a01b0382168203610e7b57565b602435906001600160a01b0382168203610e7b57565b604435908115158203610e7b57565b90601f8019910116810190811067ffffffffffffffff821117610f5857604052565b634e487b7160e01b5f52604160045260245ffdfe60a0604052346102f9576100116102fd565b6100196102fd565b81516001600160401b03811161020c57600354600181811c911680156102ef575b60208210146101ee57601f811161028c575b50602092601f821160011461022b57928192935f92610220575b50508160011b915f199060031b1c1916176003555b80516001600160401b03811161020c57600454600181811c91168015610202575b60208210146101ee57601f811161018b575b50602091601f821160011461012b579181925f92610120575b50508160011b915f199060031b1c1916176004555b6001600555336080526040516135cb908161032082396080518181816103d30152818161046e01528181610d6f01528181610dcd01528181610e8b015261197a0152f35b015190505f806100c7565b601f1982169260045f52805f20915f5b8581106101735750836001951061015b575b505050811b016004556100dc565b01515f1960f88460031b161c191690555f808061014d565b9192602060018192868501518155019401920161013b565b60045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c810191602084106101e4575b601f0160051c01905b8181106101d957506100ae565b5f81556001016101cc565b90915081906101c3565b634e487b7160e01b5f52602260045260245ffd5b90607f169061009c565b634e487b7160e01b5f52604160045260245ffd5b015190505f80610066565b601f1982169360035f52805f20915f5b868110610274575083600195961061025c575b505050811b0160035561007b565b01515f1960f88460031b161c191690555f808061024e565b9192602060018192868501518155019401920161023b565b60035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810191602084106102e5575b601f0160051c01905b8181106102da575061004c565b5f81556001016102cd565b90915081906102c4565b90607f169061003a565b5f80fd5b60405190602082016001600160401b0381118382101761020c576040525f825256fe60806040526004361015610011575f80fd5b5f5f3560e01c8063022c0d9f146120a057806306fdde0314611ff95780630902f1ac14611f9b578063095ea7b314611ef25780630dfe168114611ecb57806313345fe114611d9057806313966db514611d3957806318160ddd14611d1b5780631df8c71714611ce257806322be3de114611cbf57806323b872dd14611bbe578063252c09d714611b65578063313ce56714611b49578063392f37e914611ad65780634690484014611aaf578063517b3f82146119ee5780635881c475146119c75780636373ea69146119a957806369fe0e2d1461195e5780636a627842146115fc57806370a08231146115c55780637464fc3d146115a757806389afcb44146111fe5780638a7b8cf2146111c757806395d89b41146110e85780639e8cc04b1461108e578063a9059cbb1461105c578063ba9a7a561461103f578063bc25cf7714610e2d578063bf944dbc14610e0f578063c245febc14610df1578063c45a015514610dad578063cd962a0614610d53578063d21220a714610d2c578063dd62ed3e14610cde578063ddca3f4314610cc0578063e4bbb5a814610432578063e74b981b146103af578063ebeb31db14610391578063f140a35a146103115763fff6cae9146101dd575f80fd5b3461030e578060031936011261030e576101f56129fb565b602460206001600160a01b0360085416604051928380926370a0823160e01b82523060048301525afa80156103035782906102d0575b6024915060206001600160a01b0360095416604051938480926370a0823160e01b82523060048301525afa9081156102c557839161028b575b6102839250600b54916001600160701b03808460701c16931691612bde565b600160055580f35b90506020823d6020116102bd575b816102a66020938361261c565b810103126102b957610283915190610264565b5f80fd5b3d9150610299565b6040513d85823e3d90fd5b506020813d6020116102fb575b816102ea6020938361261c565b810103126102b9576024905161022b565b3d91506102dd565b6040513d84823e3d90fd5b80fd5b503461030e57604036600319011261030e57610366600435610331612519565b90600b54916103616001600160701b03808560701c16941692620f424061035a6010548361263e565b0490612683565b612d5c565b5f1981019190821161037d57602082604051908152f35b80634e487b7160e01b602492526011600452fd5b503461030e578060031936011261030e576020600654604051908152f35b503461030e57602036600319011261030e576103c9612503565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610423576001600160a01b031673ffffffffffffffffffffffffffffffffffffffff19600a541617600a5580f35b600482633d83866f60e01b8152fd5b503461030e57606036600319011261030e5761044c612503565b90610455612519565b9160443580151591828203610cbc576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610cad576001600160a01b03809116948573ffffffffffffffffffffffffffffffffffffffff19600854161760085516918273ffffffffffffffffffffffffffffffffffffffff19600954161760095560ff8019601354169116176013555f14610ac8576040516395d89b4160e01b81528281600481875afa9081156102c5578391610aae575b506040516395d89b4160e01b81528381600481865afa908115610aa3576105ae600160049460336020899681968891610a89575b506040519687947f4c656761637920436f7272656c617465642d2000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603483015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610a6c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610668946001948891610a4a575b506040519687947f63414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b905b825167ffffffffffffffff811161090a57610686601454612690565b601f81116109a9575b506020601f82116001146109295782939482939261091e575b50508160011b915f199060031b1c1916176014555b815167ffffffffffffffff811161090a576106d9601554612690565b601f8111610869575b50602092601f82116001146107ea579282938293926107df575b50508160011b915f199060031b1c1916176015555b610734604051610720816125ec565b428152826020820152826040820152612968565b600460206001600160a01b03600854166040519283809263313ce56760e01b82525afa80156103035761076e9183916107b0575b506129ea565b601155600460206001600160a01b03600954166040519283809263313ce56760e01b82525afa8015610303576107aa9183916107b057506129ea565b60125580f35b6107d2915060203d6020116107d8575b6107ca818361261c565b8101906129d1565b5f610768565b503d6107c0565b015190505f806106fc565b60158352601f198216937f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591845b8681106108515750836001959610610839575b505050811b01601555610711565b01515f1960f88460031b161c191690555f808061082b565b91926020600181928685015181550194019201610818565b60158352601f820160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4750190602083106108e2575b601f0160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501905b8181106108d757506106e2565b8381556001016108ca565b7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591506108a0565b602482634e487b7160e01b81526041600452fd5b015190505f806106a8565b601483527fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90601f198316845b81811061099157509583600195969710610979575b505050811b016014556106bd565b01515f1960f88460031b161c191690555f808061096b565b9192602060018192868b015181550194019201610956565b60148352601f820160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec019060208310610a22575b601f0160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec01905b818110610a17575061068f565b838155600101610a0a565b7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec91506109e0565b610a6691503d808a833e610a5e818361261c565b810190612905565b5f610605565b60049250610a83903d8084833e610a5e818361261c565b916105d2565b610a9d91503d808a833e610a5e818361261c565b5f61054b565b6040513d86823e3d90fd5b610ac291503d8085833e610a5e818361261c565b5f610517565b6040516395d89b4160e01b81528281600481875afa9081156102c5578391610c93575b506040516395d89b4160e01b81528381600481865afa908115610aa357610b82600160049460316020899681968891610c79575b506040519687947f4c656761637920566f6c6174696c652d20000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603283015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610c5c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610c3c946001948891610c42575b506040519687947f76414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b9061066a565b610c5691503d808a833e610a5e818361261c565b5f610bd9565b60049250610c73903d8084833e610a5e818361261c565b91610ba6565b610c8d91503d808a833e610a5e818361261c565b5f610b1f565b610ca791503d8085833e610a5e818361261c565b5f610aeb565b600484633d83866f60e01b8152fd5b8380fd5b503461030e578060031936011261030e576020601054604051908152f35b503461030e57604036600319011261030e576001600160a01b036040610d02612503565b9282610d0c612519565b9416815260016020522091165f52602052602060405f2054604051908152f35b503461030e578060031936011261030e5760206001600160a01b0360095416604051908152f35b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e57600435600f5580f35b80633d83866f60e01b60049252fd5b503461030e578060031936011261030e5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b503461030e578060031936011261030e576020600d54604051908152f35b503461030e578060031936011261030e576020600c54604051908152f35b503461030e57602036600319011261030e57610e47612503565b610e4f6129fb565b6040517fd2b663840000000000000000000000000000000000000000000000000000000081523060048201526020816024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9081156102c5578391611010575b5015610fe8576001600160a01b03600854166001600160a01b036009541690604051906370a0823160e01b8252306004830152602082602481845afa918215610fdd5784908693610fa5575b50610f21610f27936001600160701b03600b541690612683565b91612a34565b604051916370a0823160e01b8352306004840152602083602481855afa928315610aa3578493610f6f575b50610f21610283936001600160701b03600b5460701c1690612683565b92506020833d602011610f9d575b81610f8a6020938361261c565b810103126102b957915191610f21610f52565b3d9150610f7d565b9250506020823d602011610fd5575b81610fc16020938361261c565b810103126102b95790519083610f21610f07565b3d9150610fb4565b6040513d87823e3d90fd5b6004827f384002a2000000000000000000000000000000000000000000000000000000008152fd5b611032915060203d602011611038575b61102a818361261c565b8101906128d1565b5f610ebb565b503d611020565b503461030e578060031936011261030e5760206040516103e88152f35b503461030e57604036600319011261030e57611083611079612503565b60243590336130cc565b602060405160018152f35b503461030e576110aa6110a0366125c2565b9291908391612701565b825b81518410156110d4576110cc6001916110c586856126ed565b51906126e0565b9301926110ac565b6110e083602092612665565b604051908152f35b503461030e578060031936011261030e5760405190806004549061110b82612690565b80855291600181169081156111a05750600114611143575b61113f846111338186038261261c565b6040519182918261252f565b0390f35b600481527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b8082106111865750909150810160200161113382611123565b91926001816020925483858801015201910190929161116d565b60ff191660208087019190915292151560051b850190920192506111339150839050611123565b503461030e578060031936011261030e5760606111e261289b565b6040805191805183526020810151602084015201516040820152f35b503461030e57602036600319011261030e57611218612503565b6112206129fb565b611245600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160a01b0360085416916001600160a01b036009541694604051916370a0823160e01b8352306004840152602083602481885afa92831561159a578193611566575b50604051966370a0823160e01b8852306004890152602088602481845afa95861561030357879883989761152f575b50308352826020526112f96112ed6112ed6112f26112e08860408920549c612ee9565b986002549384918d61263e565b612665565b9a8a61263e565b9688151580611526575b156114fe5730156114eb573084528360205260408420548181106114d2579184826020936024969530845283865203604083205580600254036002556040519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef843092a36113758a8983612a34565b611380898985612a34565b604051938480926370a0823160e01b82523060048301525afa9182156102c557839261149d575b506020602491604051928380926370a0823160e01b82523060048301525afa9283156114915792611456575b50966113e29291604098612bde565b611433575b6001600160a01b0384519184835283602084015216907fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496853392a3600160055582519182526020820152f35b61144e600b546001600160701b03808260701c169116612b29565b600e556113e7565b929150966020833d602011611489575b816114736020938361261c565b810103126102b9579151919690919060406113d3565b3d9150611466565b604051903d90823e3d90fd5b9091506020813d6020116114ca575b816114b96020938361261c565b810103126102b957519060206113a7565b3d91506114ac565b63391434e360e21b855230600452602452604452606483fd5b602484634b637e8f60e11b815280600452fd5b6004847f42a0889c000000000000000000000000000000000000000000000000000000008152fd5b50871515611303565b965096506020863d60201161155e575b8161154c6020938361261c565b810103126102b957879551965f6112bd565b3d915061153f565b9092506020813d602011611592575b816115826020938361261c565b810103126102b95751915f61128e565b3d9150611575565b50604051903d90823e3d90fd5b503461030e578060031936011261030e576020600e54604051908152f35b503461030e57602036600319011261030e5760406020916001600160a01b036115ec612503565b1681528083522054604051908152f35b503461030e57602036600319011261030e57602490611619612503565b6116216129fb565b611646600b546001600160701b038116916001600160701b038260701c169160e01c90565b5093909160206001600160a01b0360085416604051938480926370a0823160e01b82523060048301525afa918215610aa3578492611929575b506024919260206001600160a01b0360095416604051948580926370a0823160e01b82523060048301525afa928315610fdd5785936118f5575b506001600160701b038116926116cf8486612683565b946001600160701b038816936116e58584612683565b95876116f18b87612ee9565b966002549283155f146118cb57505061171491508761170f9161263e565b6131a2565b6103e71981019081116118b757976117306103e861dead6134e7565b60ff601354166117e7575b88156117bf57509161175a93916117558960209b956132db565b612bde565b61179c575b604051918252838201527f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f60403392a26001600555604051908152f35b6117b7600b546001600160701b03808260701c169116612b29565b600e5561175f565b807fad69186f0000000000000000000000000000000000000000000000000000000060049252fd5b633b9aca006117f6888a612b29565b106118a857670de0b6b3a76400008802888104670de0b6b3a764000014891517156118945760115461182791612665565b670de0b6b3a76400008802888104670de0b6b3a764000014891517156118805760125461185391612665565b1461173b57807fde5011e80000000000000000000000000000000000000000000000000000000060049252fd5b602483634e487b7160e01b81526011600452fd5b602482634e487b7160e01b81526011600452fd5b8063a932492f60e01b60049252fd5b602489634e487b7160e01b81526011600452fd5b6118df6112ed916112ed866118e69661263e565b938a61263e565b9081808210911802189761173b565b9092506020813d602011611921575b816119116020938361261c565b810103126102b95751915f6116b9565b3d9150611904565b91506020823d602011611956575b816119446020938361261c565b810103126102b957602491519161167f565b3d9150611937565b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e5760043560105580f35b503461030e578060031936011261030e576020600f54604051908152f35b503461030e5761113f6119e26119dc366125c2565b91612701565b60405191829182612559565b503461030e57604036600319011261030e57611a08612503565b90611a1161289b565b90611a1a6127ed565b509183514214611a66575b60206110e08686611a5d6112ed6112ed896040611a548b611a47885142612683565b9586918c8a015190612683565b95015190612683565b91602435612d5c565b600654919350600119820191821161037d575091611a5d6112ed6112ed602096946040611a54611aa1611a9b6110e09a612592565b50612873565b985050509496505050611a25565b503461030e578060031936011261030e5760206001600160a01b03600a5416604051908152f35b503461030e578060031936011261030e5760e0601154601254600b5460ff601354166001600160701b036001600160a01b0360085416926001600160a01b0360095416946040519687526020870152818116604087015260701c1660608501521515608084015260a083015260c0820152f35b503461030e578060031936011261030e57602060405160128152f35b503461030e57602036600319011261030e57600435600654811015611bba57611b8d90612592565b50805461113f60026001840154930154604051938493846040919493926060820195825260208201520152565b5080fd5b503461030e57606036600319011261030e57611bd8612503565b611be0612519565b604435916001600160a01b0381168085526001602052604085206001600160a01b0333165f5260205260405f2054905f198203611c24575b505061108393506130cc565b848210611c8b578015611c78573315611c65578560409161108397526001602052206001600160a01b0333165f526020528360405f20910390555f80611c18565b602486634a1406b160e11b815280600452fd5b60248663e602df0560e01b815280600452fd5b60648686847ffb8f41b200000000000000000000000000000000000000000000000000000000835233600452602452604452fd5b503461030e578060031936011261030e57602060ff601354166040519015158152f35b503461030e578060031936011261030e5761113f611cfe6127ed565b604080519384526020840192909252908201529081906060820190565b503461030e578060031936011261030e576020600254604051908152f35b503461030e578060031936011261030e57611d526129fb565b600b546001600160701b038082169160701c16611d6f8183612ee9565b611d7d575b82600160055580f35b611d8691612b29565b600e555f80611d74565b503461030e57608036600319011261030e57611daa612503565b9060643590604435602435611dbe826126c8565b94611dcc604051968761261c565b828652601f19611ddb846126c8565b013660208801376006545f19810193908411611eb757611e0186611e079296959661263e565b85612683565b925b848410611e1e576040518061113f8982612559565b856001611eb192611e9f611e3284896126e0565b611e97611e54611e4183612592565b5054611e4c8c612592565b505490612683565b6112ed8b6002611e7f81611e8e611e88876112ed8e611e728d612592565b5001548f611e7f8a612592565b50015490612683565b98612592565b50015492612592565b908789612d5c565b611ea9828c6126ed565b5201946126e0565b92611e09565b602485634e487b7160e01b81526011600452fd5b503461030e578060031936011261030e5760206001600160a01b0360085416604051908152f35b503461030e57604036600319011261030e57611f0c612503565b602435903315611f88576001600160a01b0316918215611f7557604090338152600160205220825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b80634a1406b160e11b6024925280600452fd5b60248363e602df0560e01b815280600452fd5b503461030e578060031936011261030e5760606001600160701b0363ffffffff611fe0600b546001600160701b038116916001600160701b038260701c169160e01c90565b9193908160405195168552166020840152166040820152f35b503461030e578060031936011261030e5760405190806003549061201c82612690565b80855291600181169081156111a057506001146120435761113f846111338186038261261c565b600381527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b8082106120865750909150810160200161113382611123565b91926001816020925483858801015201910190929161206d565b50346102b95760803660031901126102b957604435906001600160a01b0382166024356004358285036102b95760643567ffffffffffffffff81116102b957366023820112156102b95780600401359067ffffffffffffffff82116102b95736602483830101116102b9576121136129fb565b821590811580926124fa575b156124d257612149600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160701b03831694858710806124c0575b15612498576001600160a01b03600854169a6001600160a01b0360095416938c8b14158061248e575b156124665788828e92612455575b5050508880612444575b50508061239a575b505060206024979899604051988980926370a0823160e01b82523060048301525afa96871561235a578997612365575b506020602491604051928380926370a0823160e01b82523060048301525afa90811561235a578991612328575b5084840380881115612320578703965b6001600160701b0384169487860380841115612318578303955b891580159061230f575b156122e7576122849061227e8b612278620f424061227161226a82612263601054809761263e565b048a612683565b938d61263e565b0488612683565b90612b29565b92612b29565b116122d85790612295939291612bde565b6040519384526020840152604083015260608201527fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d82260803392a3600160055580f35b60048a63a932492f60e01b8152fd5b60048c7fba0b951e000000000000000000000000000000000000000000000000000000008152fd5b5086151561223b565b508a95612231565b508896612217565b90506020813d602011612352575b816123436020938361261c565b810103126102b957515f612207565b3d9150612336565b6040513d8b823e3d90fd5b9096506020813d602011612392575b816123816020938361261c565b810103126102b957519560206121da565b3d9150612374565b883b156102b9578760a488835f94602460405197889687957f9a7bff790000000000000000000000000000000000000000000000000000000087523360048801528387015260448601526080606486015282608486015201848401378181018301859052601f01601f19168101030181838c5af180156124395761241f575b806121aa565b60249798505f61242e9161261c565b60205f989750612419565b6040513d5f823e3d90fd5b61244e9185612a34565b5f886121a2565b61245e92612a34565b8b8882612198565b7fa8fa826d000000000000000000000000000000000000000000000000000000005f5260045ffd5b50848b141561218a565b7f083ff6a1000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b0385168810612161565b7fbfe3b102000000000000000000000000000000000000000000000000000000005f5260045ffd5b5084151561211f565b600435906001600160a01b03821682036102b957565b602435906001600160a01b03821682036102b957565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b60206040818301928281528451809452019201905f5b81811061257c5750505090565b825184526020938401939092019160010161256f565b6006548110156125ae5760065f52600360205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b60609060031901126102b9576004356001600160a01b03811681036102b957906024359060443590565b6060810190811067ffffffffffffffff82111761260857604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761260857604052565b8181029291811591840414171561265157565b634e487b7160e01b5f52601160045260245ffd5b811561266f570490565b634e487b7160e01b5f52601260045260245ffd5b9190820391821161265157565b90600182811c921680156126be575b60208310146126aa57565b634e487b7160e01b5f52602260045260245ffd5b91607f169161269f565b67ffffffffffffffff81116126085760051b60200190565b9190820180921161265157565b80518210156125ae5760209160051b010190565b61270a836126c8565b92612718604051948561261c565b808452601f19612727826126c8565b013660208601376006545f1981019190821161265157801581800460011417156126515761275790829492612683565b905f5b84831061276957505050505090565b6001830190818411612651576127cf826127c761279561278a600196612592565b5054611e4c89612592565b6112ed60026127b96127b3846112ed8d8c611e7f81611e8e8d612592565b95612592565b5001546002611e7f8b612592565b908786612d5c565b6127d982896126ed565b52019160018101809111612651579161275a565b4290600c5491600d549163ffffffff612821600b546001600160701b038116916001600160701b038260701c169160e01c90565b9092164263ffffffff16810361283657505050565b6001600160701b03612869612870959794986128636128639561285a859642612683565b9586911661263e565b906126e0565b971661263e565b91565b90604051612880816125ec565b60406002829480548452600181015460208501520154910152565b5f604080516128a9816125ec565b82815282602082015201526006545f19810190811161265157611a9b6128ce91612592565b90565b908160209103126102b9575180151581036102b95790565b67ffffffffffffffff811161260857601f01601f191660200190565b6020818303126102b95780519067ffffffffffffffff82116102b9570181601f820112156102b957805190612939826128e9565b92612947604051948561261c565b828452602083830101116102b957815f9260208093018386015e8301015290565b6006546801000000000000000081101561260857600181016006556006548110156125ae5760065f526003027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0190604081600292518455602081015160018501550151910155565b908160209103126102b9575160ff811681036102b95790565b60ff16604d811161265157600a0a90565b600260055414612a0c576002600555565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b919091803b156102b9575f92838093604051906001600160a01b0360208301947fa9059cbb000000000000000000000000000000000000000000000000000000008652166024830152604482015260448152612a9160648261261c565b51925af13d15612b22573d612aa5816128e9565b90612ab3604051928361261c565b81523d5f602083013e5b81612af3575b5015612acb57565b7f817275ab000000000000000000000000000000000000000000000000000000005f5260045ffd5b8051801592508215612b08575b50505f612ac3565b612b1b92506020809183010191016128d1565b5f80612b00565b6060612abd565b60135460ff1615612bd457670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157601154612b6191612665565b90670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157670de0b6b3a764000091612bca612ba0612bd09360125490612665565b84612bc381612bbb81612bb3868961263e565b04968061263e565b04928061263e565b04906126e0565b9061263e565b0490565b906128ce9161263e565b91926001600160701b0383111580612d4b575b15612d23576001600160701b0360409381927f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad196600b5460e01c918242039242141580612d18575b80612d0d575b612cef575b505050610708612c5c612c5561289b565b5142612683565b11612cc4575b1691827bffffffffffffffffffffffffffff00000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000004260e01b169260701b16171780600b55835192835260701c166020820152a1565b612cea600c54600d54875191612cd9836125ec565b428352602083015287820152612968565b612c62565b828580931602600c5401600c551602600d5401600d555f8080612c44565b508481161515612c3f565b508482161515612c39565b7f95a5c7f9000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b03821115612bf1565b9291909160ff601354165f14612ea557612d768183612b29565b91670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157612da56011548092612665565b92670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612dd46012548094612665565b946001600160a01b03806008541691161493845f14612ea057945b8415612e5d57670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3888670de0b6b3a76400009d612665565b6126e0565b6132f4565b90612683565b9215612e5557509061263e565b90509061263e565b670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3889670de0b6b3a76400009d612665565b612def565b9091926128ce936001600160a01b0380600854169116145f14612edc57612ed0612ed6925b8261263e565b926126e0565b90612665565b612ed0612ed69293612eca565b91906001600160a01b03600a541690600e549382151594855f146130a257600f549181612f19575b50505050505b565b60135460ff1615613016576001600160701b0380612f3b939495169116612b29565b90808211612f53575b505050505b5f80808080612f11565b612f7291612f6c612f6661170f936131a2565b916131a2565b9061341e565b670de0b6b3a76400000390670de0b6b3a7640000821161265157612f96828261263e565b91670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612fc19161263e565b69021e19e0c9bab2400000039069021e19e0c9bab2400000821161265157670de0b6b3a7640000916112ed612ff89260025461263e565b0480613006575b8080612f44565b61300f916132db565b5f80612fff565b61170f613033916001600160701b03806130399597169116612b29565b926131a2565b80831161304a575b50505050612f49565b61307c8161307761271061306e6130676112ed9661308599612683565b968761263e565b049485926126e0565b612683565b9160025461263e565b80613092575b8080613041565b61309b916132db565b5f8061308b565b925050506130ac57565b6130c7600b546001600160701b03808260701c169116612b29565b600e55565b6001600160a01b031690811561318f576001600160a01b031691821561316357815f525f60205260405f205481811061314a57817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f525f84520360405f2055845f525f825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b634b637e8f60e11b5f525f60045260245ffd5b60018111156128ce578060017001000000000000000000000000000000008310156132c5575b600482680100000000000000006132779410156132b8575b6401000000008110156132ab575b6201000081101561329e575b610100811015613292575b6010811015613286575b101561327e575b60030260011c6132268184612665565b0160011c6132348184612665565b0160011c6132428184612665565b0160011c6132508184612665565b0160011c61325e8184612665565b0160011c61326c8184612665565b0160011c8092612665565b8111900390565b60011b613216565b811c9160021b9161320f565b60081c91811b91613205565b60101c9160081b916131fa565b60201c9160101b916131ee565b60401c9160201b916131e0565b5050608081901c680100000000000000006131c8565b906001600160a01b0382161561316357612f17916134e7565b905f5b60ff81106133055750505090565b83613350670de0b6b3a76400006133328161332b8582613325828061263e565b0461263e565b048761263e565b04670de0b6b3a7640000612bc384826133258a82613325828061263e565b83808210156133da579061336391612683565b670de0b6b3a7640000810290808204670de0b6b3a76400001490151715612651578161286361339892612ed660019589613554565b945b85818111156133c357906133ad91612683565b11156133bd576001905b016132f7565b50505090565b6133cc91612683565b11156133bd576001906133b7565b6133e391612683565b670de0b6b3a7640000810290808204670de0b6b3a764000014901517156126515781612e4261341892612ed660019589613554565b9461339a565b906ec097ce7bc90715b34b9f10000000008202905f196ec097ce7bc90715b34b9f10000000008409928280851094039380850394146134db57838211156134c3576ec097ce7bc90715b34b9f1000000000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b50634e487b715f52156003026011186020526024601cfd5b50906128ce9250612665565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206001600160a01b035f93613520866002546126e0565b60025516938415841461353f5780600254036002555b604051908152a3565b84845283825260408420818154019055613536565b8060030260038104820361265157612bc3670de0b6b3a7640000613588819382613581886128ce9961263e565b049061263e565b049282613325828061263e56fea264697066735822122085f7e6129e4054acb7a9f7db9d22ada0f4dc074e356061eba1f6a8a7eee64eaf64736f6c634300081c0033a26469706673582212203ca80b9284d4e61a44df17bd0463679e92fa34d5e82e1a62d73cd09ed56d1ebe64736f6c634300081c003360a0604052346102f9576100116102fd565b6100196102fd565b81516001600160401b03811161020c57600354600181811c911680156102ef575b60208210146101ee57601f811161028c575b50602092601f821160011461022b57928192935f92610220575b50508160011b915f199060031b1c1916176003555b80516001600160401b03811161020c57600454600181811c91168015610202575b60208210146101ee57601f811161018b575b50602091601f821160011461012b579181925f92610120575b50508160011b915f199060031b1c1916176004555b6001600555336080526040516135cb908161032082396080518181816103d30152818161046e01528181610d6f01528181610dcd01528181610e8b015261197a0152f35b015190505f806100c7565b601f1982169260045f52805f20915f5b8581106101735750836001951061015b575b505050811b016004556100dc565b01515f1960f88460031b161c191690555f808061014d565b9192602060018192868501518155019401920161013b565b60045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c810191602084106101e4575b601f0160051c01905b8181106101d957506100ae565b5f81556001016101cc565b90915081906101c3565b634e487b7160e01b5f52602260045260245ffd5b90607f169061009c565b634e487b7160e01b5f52604160045260245ffd5b015190505f80610066565b601f1982169360035f52805f20915f5b868110610274575083600195961061025c575b505050811b0160035561007b565b01515f1960f88460031b161c191690555f808061024e565b9192602060018192868501518155019401920161023b565b60035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810191602084106102e5575b601f0160051c01905b8181106102da575061004c565b5f81556001016102cd565b90915081906102c4565b90607f169061003a565b5f80fd5b60405190602082016001600160401b0381118382101761020c576040525f825256fe60806040526004361015610011575f80fd5b5f5f3560e01c8063022c0d9f146120a057806306fdde0314611ff95780630902f1ac14611f9b578063095ea7b314611ef25780630dfe168114611ecb57806313345fe114611d9057806313966db514611d3957806318160ddd14611d1b5780631df8c71714611ce257806322be3de114611cbf57806323b872dd14611bbe578063252c09d714611b65578063313ce56714611b49578063392f37e914611ad65780634690484014611aaf578063517b3f82146119ee5780635881c475146119c75780636373ea69146119a957806369fe0e2d1461195e5780636a627842146115fc57806370a08231146115c55780637464fc3d146115a757806389afcb44146111fe5780638a7b8cf2146111c757806395d89b41146110e85780639e8cc04b1461108e578063a9059cbb1461105c578063ba9a7a561461103f578063bc25cf7714610e2d578063bf944dbc14610e0f578063c245febc14610df1578063c45a015514610dad578063cd962a0614610d53578063d21220a714610d2c578063dd62ed3e14610cde578063ddca3f4314610cc0578063e4bbb5a814610432578063e74b981b146103af578063ebeb31db14610391578063f140a35a146103115763fff6cae9146101dd575f80fd5b3461030e578060031936011261030e576101f56129fb565b602460206001600160a01b0360085416604051928380926370a0823160e01b82523060048301525afa80156103035782906102d0575b6024915060206001600160a01b0360095416604051938480926370a0823160e01b82523060048301525afa9081156102c557839161028b575b6102839250600b54916001600160701b03808460701c16931691612bde565b600160055580f35b90506020823d6020116102bd575b816102a66020938361261c565b810103126102b957610283915190610264565b5f80fd5b3d9150610299565b6040513d85823e3d90fd5b506020813d6020116102fb575b816102ea6020938361261c565b810103126102b9576024905161022b565b3d91506102dd565b6040513d84823e3d90fd5b80fd5b503461030e57604036600319011261030e57610366600435610331612519565b90600b54916103616001600160701b03808560701c16941692620f424061035a6010548361263e565b0490612683565b612d5c565b5f1981019190821161037d57602082604051908152f35b80634e487b7160e01b602492526011600452fd5b503461030e578060031936011261030e576020600654604051908152f35b503461030e57602036600319011261030e576103c9612503565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610423576001600160a01b031673ffffffffffffffffffffffffffffffffffffffff19600a541617600a5580f35b600482633d83866f60e01b8152fd5b503461030e57606036600319011261030e5761044c612503565b90610455612519565b9160443580151591828203610cbc576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610cad576001600160a01b03809116948573ffffffffffffffffffffffffffffffffffffffff19600854161760085516918273ffffffffffffffffffffffffffffffffffffffff19600954161760095560ff8019601354169116176013555f14610ac8576040516395d89b4160e01b81528281600481875afa9081156102c5578391610aae575b506040516395d89b4160e01b81528381600481865afa908115610aa3576105ae600160049460336020899681968891610a89575b506040519687947f4c656761637920436f7272656c617465642d2000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603483015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610a6c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610668946001948891610a4a575b506040519687947f63414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b905b825167ffffffffffffffff811161090a57610686601454612690565b601f81116109a9575b506020601f82116001146109295782939482939261091e575b50508160011b915f199060031b1c1916176014555b815167ffffffffffffffff811161090a576106d9601554612690565b601f8111610869575b50602092601f82116001146107ea579282938293926107df575b50508160011b915f199060031b1c1916176015555b610734604051610720816125ec565b428152826020820152826040820152612968565b600460206001600160a01b03600854166040519283809263313ce56760e01b82525afa80156103035761076e9183916107b0575b506129ea565b601155600460206001600160a01b03600954166040519283809263313ce56760e01b82525afa8015610303576107aa9183916107b057506129ea565b60125580f35b6107d2915060203d6020116107d8575b6107ca818361261c565b8101906129d1565b5f610768565b503d6107c0565b015190505f806106fc565b60158352601f198216937f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591845b8681106108515750836001959610610839575b505050811b01601555610711565b01515f1960f88460031b161c191690555f808061082b565b91926020600181928685015181550194019201610818565b60158352601f820160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4750190602083106108e2575b601f0160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501905b8181106108d757506106e2565b8381556001016108ca565b7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591506108a0565b602482634e487b7160e01b81526041600452fd5b015190505f806106a8565b601483527fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90601f198316845b81811061099157509583600195969710610979575b505050811b016014556106bd565b01515f1960f88460031b161c191690555f808061096b565b9192602060018192868b015181550194019201610956565b60148352601f820160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec019060208310610a22575b601f0160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec01905b818110610a17575061068f565b838155600101610a0a565b7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec91506109e0565b610a6691503d808a833e610a5e818361261c565b810190612905565b5f610605565b60049250610a83903d8084833e610a5e818361261c565b916105d2565b610a9d91503d808a833e610a5e818361261c565b5f61054b565b6040513d86823e3d90fd5b610ac291503d8085833e610a5e818361261c565b5f610517565b6040516395d89b4160e01b81528281600481875afa9081156102c5578391610c93575b506040516395d89b4160e01b81528381600481865afa908115610aa357610b82600160049460316020899681968891610c79575b506040519687947f4c656761637920566f6c6174696c652d20000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603283015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610c5c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610c3c946001948891610c42575b506040519687947f76414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b9061066a565b610c5691503d808a833e610a5e818361261c565b5f610bd9565b60049250610c73903d8084833e610a5e818361261c565b91610ba6565b610c8d91503d808a833e610a5e818361261c565b5f610b1f565b610ca791503d8085833e610a5e818361261c565b5f610aeb565b600484633d83866f60e01b8152fd5b8380fd5b503461030e578060031936011261030e576020601054604051908152f35b503461030e57604036600319011261030e576001600160a01b036040610d02612503565b9282610d0c612519565b9416815260016020522091165f52602052602060405f2054604051908152f35b503461030e578060031936011261030e5760206001600160a01b0360095416604051908152f35b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e57600435600f5580f35b80633d83866f60e01b60049252fd5b503461030e578060031936011261030e5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b503461030e578060031936011261030e576020600d54604051908152f35b503461030e578060031936011261030e576020600c54604051908152f35b503461030e57602036600319011261030e57610e47612503565b610e4f6129fb565b6040517fd2b663840000000000000000000000000000000000000000000000000000000081523060048201526020816024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9081156102c5578391611010575b5015610fe8576001600160a01b03600854166001600160a01b036009541690604051906370a0823160e01b8252306004830152602082602481845afa918215610fdd5784908693610fa5575b50610f21610f27936001600160701b03600b541690612683565b91612a34565b604051916370a0823160e01b8352306004840152602083602481855afa928315610aa3578493610f6f575b50610f21610283936001600160701b03600b5460701c1690612683565b92506020833d602011610f9d575b81610f8a6020938361261c565b810103126102b957915191610f21610f52565b3d9150610f7d565b9250506020823d602011610fd5575b81610fc16020938361261c565b810103126102b95790519083610f21610f07565b3d9150610fb4565b6040513d87823e3d90fd5b6004827f384002a2000000000000000000000000000000000000000000000000000000008152fd5b611032915060203d602011611038575b61102a818361261c565b8101906128d1565b5f610ebb565b503d611020565b503461030e578060031936011261030e5760206040516103e88152f35b503461030e57604036600319011261030e57611083611079612503565b60243590336130cc565b602060405160018152f35b503461030e576110aa6110a0366125c2565b9291908391612701565b825b81518410156110d4576110cc6001916110c586856126ed565b51906126e0565b9301926110ac565b6110e083602092612665565b604051908152f35b503461030e578060031936011261030e5760405190806004549061110b82612690565b80855291600181169081156111a05750600114611143575b61113f846111338186038261261c565b6040519182918261252f565b0390f35b600481527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b8082106111865750909150810160200161113382611123565b91926001816020925483858801015201910190929161116d565b60ff191660208087019190915292151560051b850190920192506111339150839050611123565b503461030e578060031936011261030e5760606111e261289b565b6040805191805183526020810151602084015201516040820152f35b503461030e57602036600319011261030e57611218612503565b6112206129fb565b611245600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160a01b0360085416916001600160a01b036009541694604051916370a0823160e01b8352306004840152602083602481885afa92831561159a578193611566575b50604051966370a0823160e01b8852306004890152602088602481845afa95861561030357879883989761152f575b50308352826020526112f96112ed6112ed6112f26112e08860408920549c612ee9565b986002549384918d61263e565b612665565b9a8a61263e565b9688151580611526575b156114fe5730156114eb573084528360205260408420548181106114d2579184826020936024969530845283865203604083205580600254036002556040519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef843092a36113758a8983612a34565b611380898985612a34565b604051938480926370a0823160e01b82523060048301525afa9182156102c557839261149d575b506020602491604051928380926370a0823160e01b82523060048301525afa9283156114915792611456575b50966113e29291604098612bde565b611433575b6001600160a01b0384519184835283602084015216907fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496853392a3600160055582519182526020820152f35b61144e600b546001600160701b03808260701c169116612b29565b600e556113e7565b929150966020833d602011611489575b816114736020938361261c565b810103126102b9579151919690919060406113d3565b3d9150611466565b604051903d90823e3d90fd5b9091506020813d6020116114ca575b816114b96020938361261c565b810103126102b957519060206113a7565b3d91506114ac565b63391434e360e21b855230600452602452604452606483fd5b602484634b637e8f60e11b815280600452fd5b6004847f42a0889c000000000000000000000000000000000000000000000000000000008152fd5b50871515611303565b965096506020863d60201161155e575b8161154c6020938361261c565b810103126102b957879551965f6112bd565b3d915061153f565b9092506020813d602011611592575b816115826020938361261c565b810103126102b95751915f61128e565b3d9150611575565b50604051903d90823e3d90fd5b503461030e578060031936011261030e576020600e54604051908152f35b503461030e57602036600319011261030e5760406020916001600160a01b036115ec612503565b1681528083522054604051908152f35b503461030e57602036600319011261030e57602490611619612503565b6116216129fb565b611646600b546001600160701b038116916001600160701b038260701c169160e01c90565b5093909160206001600160a01b0360085416604051938480926370a0823160e01b82523060048301525afa918215610aa3578492611929575b506024919260206001600160a01b0360095416604051948580926370a0823160e01b82523060048301525afa928315610fdd5785936118f5575b506001600160701b038116926116cf8486612683565b946001600160701b038816936116e58584612683565b95876116f18b87612ee9565b966002549283155f146118cb57505061171491508761170f9161263e565b6131a2565b6103e71981019081116118b757976117306103e861dead6134e7565b60ff601354166117e7575b88156117bf57509161175a93916117558960209b956132db565b612bde565b61179c575b604051918252838201527f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f60403392a26001600555604051908152f35b6117b7600b546001600160701b03808260701c169116612b29565b600e5561175f565b807fad69186f0000000000000000000000000000000000000000000000000000000060049252fd5b633b9aca006117f6888a612b29565b106118a857670de0b6b3a76400008802888104670de0b6b3a764000014891517156118945760115461182791612665565b670de0b6b3a76400008802888104670de0b6b3a764000014891517156118805760125461185391612665565b1461173b57807fde5011e80000000000000000000000000000000000000000000000000000000060049252fd5b602483634e487b7160e01b81526011600452fd5b602482634e487b7160e01b81526011600452fd5b8063a932492f60e01b60049252fd5b602489634e487b7160e01b81526011600452fd5b6118df6112ed916112ed866118e69661263e565b938a61263e565b9081808210911802189761173b565b9092506020813d602011611921575b816119116020938361261c565b810103126102b95751915f6116b9565b3d9150611904565b91506020823d602011611956575b816119446020938361261c565b810103126102b957602491519161167f565b3d9150611937565b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e5760043560105580f35b503461030e578060031936011261030e576020600f54604051908152f35b503461030e5761113f6119e26119dc366125c2565b91612701565b60405191829182612559565b503461030e57604036600319011261030e57611a08612503565b90611a1161289b565b90611a1a6127ed565b509183514214611a66575b60206110e08686611a5d6112ed6112ed896040611a548b611a47885142612683565b9586918c8a015190612683565b95015190612683565b91602435612d5c565b600654919350600119820191821161037d575091611a5d6112ed6112ed602096946040611a54611aa1611a9b6110e09a612592565b50612873565b985050509496505050611a25565b503461030e578060031936011261030e5760206001600160a01b03600a5416604051908152f35b503461030e578060031936011261030e5760e0601154601254600b5460ff601354166001600160701b036001600160a01b0360085416926001600160a01b0360095416946040519687526020870152818116604087015260701c1660608501521515608084015260a083015260c0820152f35b503461030e578060031936011261030e57602060405160128152f35b503461030e57602036600319011261030e57600435600654811015611bba57611b8d90612592565b50805461113f60026001840154930154604051938493846040919493926060820195825260208201520152565b5080fd5b503461030e57606036600319011261030e57611bd8612503565b611be0612519565b604435916001600160a01b0381168085526001602052604085206001600160a01b0333165f5260205260405f2054905f198203611c24575b505061108393506130cc565b848210611c8b578015611c78573315611c65578560409161108397526001602052206001600160a01b0333165f526020528360405f20910390555f80611c18565b602486634a1406b160e11b815280600452fd5b60248663e602df0560e01b815280600452fd5b60648686847ffb8f41b200000000000000000000000000000000000000000000000000000000835233600452602452604452fd5b503461030e578060031936011261030e57602060ff601354166040519015158152f35b503461030e578060031936011261030e5761113f611cfe6127ed565b604080519384526020840192909252908201529081906060820190565b503461030e578060031936011261030e576020600254604051908152f35b503461030e578060031936011261030e57611d526129fb565b600b546001600160701b038082169160701c16611d6f8183612ee9565b611d7d575b82600160055580f35b611d8691612b29565b600e555f80611d74565b503461030e57608036600319011261030e57611daa612503565b9060643590604435602435611dbe826126c8565b94611dcc604051968761261c565b828652601f19611ddb846126c8565b013660208801376006545f19810193908411611eb757611e0186611e079296959661263e565b85612683565b925b848410611e1e576040518061113f8982612559565b856001611eb192611e9f611e3284896126e0565b611e97611e54611e4183612592565b5054611e4c8c612592565b505490612683565b6112ed8b6002611e7f81611e8e611e88876112ed8e611e728d612592565b5001548f611e7f8a612592565b50015490612683565b98612592565b50015492612592565b908789612d5c565b611ea9828c6126ed565b5201946126e0565b92611e09565b602485634e487b7160e01b81526011600452fd5b503461030e578060031936011261030e5760206001600160a01b0360085416604051908152f35b503461030e57604036600319011261030e57611f0c612503565b602435903315611f88576001600160a01b0316918215611f7557604090338152600160205220825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b80634a1406b160e11b6024925280600452fd5b60248363e602df0560e01b815280600452fd5b503461030e578060031936011261030e5760606001600160701b0363ffffffff611fe0600b546001600160701b038116916001600160701b038260701c169160e01c90565b9193908160405195168552166020840152166040820152f35b503461030e578060031936011261030e5760405190806003549061201c82612690565b80855291600181169081156111a057506001146120435761113f846111338186038261261c565b600381527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b8082106120865750909150810160200161113382611123565b91926001816020925483858801015201910190929161206d565b50346102b95760803660031901126102b957604435906001600160a01b0382166024356004358285036102b95760643567ffffffffffffffff81116102b957366023820112156102b95780600401359067ffffffffffffffff82116102b95736602483830101116102b9576121136129fb565b821590811580926124fa575b156124d257612149600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160701b03831694858710806124c0575b15612498576001600160a01b03600854169a6001600160a01b0360095416938c8b14158061248e575b156124665788828e92612455575b5050508880612444575b50508061239a575b505060206024979899604051988980926370a0823160e01b82523060048301525afa96871561235a578997612365575b506020602491604051928380926370a0823160e01b82523060048301525afa90811561235a578991612328575b5084840380881115612320578703965b6001600160701b0384169487860380841115612318578303955b891580159061230f575b156122e7576122849061227e8b612278620f424061227161226a82612263601054809761263e565b048a612683565b938d61263e565b0488612683565b90612b29565b92612b29565b116122d85790612295939291612bde565b6040519384526020840152604083015260608201527fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d82260803392a3600160055580f35b60048a63a932492f60e01b8152fd5b60048c7fba0b951e000000000000000000000000000000000000000000000000000000008152fd5b5086151561223b565b508a95612231565b508896612217565b90506020813d602011612352575b816123436020938361261c565b810103126102b957515f612207565b3d9150612336565b6040513d8b823e3d90fd5b9096506020813d602011612392575b816123816020938361261c565b810103126102b957519560206121da565b3d9150612374565b883b156102b9578760a488835f94602460405197889687957f9a7bff790000000000000000000000000000000000000000000000000000000087523360048801528387015260448601526080606486015282608486015201848401378181018301859052601f01601f19168101030181838c5af180156124395761241f575b806121aa565b60249798505f61242e9161261c565b60205f989750612419565b6040513d5f823e3d90fd5b61244e9185612a34565b5f886121a2565b61245e92612a34565b8b8882612198565b7fa8fa826d000000000000000000000000000000000000000000000000000000005f5260045ffd5b50848b141561218a565b7f083ff6a1000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b0385168810612161565b7fbfe3b102000000000000000000000000000000000000000000000000000000005f5260045ffd5b5084151561211f565b600435906001600160a01b03821682036102b957565b602435906001600160a01b03821682036102b957565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b60206040818301928281528451809452019201905f5b81811061257c5750505090565b825184526020938401939092019160010161256f565b6006548110156125ae5760065f52600360205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b60609060031901126102b9576004356001600160a01b03811681036102b957906024359060443590565b6060810190811067ffffffffffffffff82111761260857604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761260857604052565b8181029291811591840414171561265157565b634e487b7160e01b5f52601160045260245ffd5b811561266f570490565b634e487b7160e01b5f52601260045260245ffd5b9190820391821161265157565b90600182811c921680156126be575b60208310146126aa57565b634e487b7160e01b5f52602260045260245ffd5b91607f169161269f565b67ffffffffffffffff81116126085760051b60200190565b9190820180921161265157565b80518210156125ae5760209160051b010190565b61270a836126c8565b92612718604051948561261c565b808452601f19612727826126c8565b013660208601376006545f1981019190821161265157801581800460011417156126515761275790829492612683565b905f5b84831061276957505050505090565b6001830190818411612651576127cf826127c761279561278a600196612592565b5054611e4c89612592565b6112ed60026127b96127b3846112ed8d8c611e7f81611e8e8d612592565b95612592565b5001546002611e7f8b612592565b908786612d5c565b6127d982896126ed565b52019160018101809111612651579161275a565b4290600c5491600d549163ffffffff612821600b546001600160701b038116916001600160701b038260701c169160e01c90565b9092164263ffffffff16810361283657505050565b6001600160701b03612869612870959794986128636128639561285a859642612683565b9586911661263e565b906126e0565b971661263e565b91565b90604051612880816125ec565b60406002829480548452600181015460208501520154910152565b5f604080516128a9816125ec565b82815282602082015201526006545f19810190811161265157611a9b6128ce91612592565b90565b908160209103126102b9575180151581036102b95790565b67ffffffffffffffff811161260857601f01601f191660200190565b6020818303126102b95780519067ffffffffffffffff82116102b9570181601f820112156102b957805190612939826128e9565b92612947604051948561261c565b828452602083830101116102b957815f9260208093018386015e8301015290565b6006546801000000000000000081101561260857600181016006556006548110156125ae5760065f526003027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0190604081600292518455602081015160018501550151910155565b908160209103126102b9575160ff811681036102b95790565b60ff16604d811161265157600a0a90565b600260055414612a0c576002600555565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b919091803b156102b9575f92838093604051906001600160a01b0360208301947fa9059cbb000000000000000000000000000000000000000000000000000000008652166024830152604482015260448152612a9160648261261c565b51925af13d15612b22573d612aa5816128e9565b90612ab3604051928361261c565b81523d5f602083013e5b81612af3575b5015612acb57565b7f817275ab000000000000000000000000000000000000000000000000000000005f5260045ffd5b8051801592508215612b08575b50505f612ac3565b612b1b92506020809183010191016128d1565b5f80612b00565b6060612abd565b60135460ff1615612bd457670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157601154612b6191612665565b90670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157670de0b6b3a764000091612bca612ba0612bd09360125490612665565b84612bc381612bbb81612bb3868961263e565b04968061263e565b04928061263e565b04906126e0565b9061263e565b0490565b906128ce9161263e565b91926001600160701b0383111580612d4b575b15612d23576001600160701b0360409381927f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad196600b5460e01c918242039242141580612d18575b80612d0d575b612cef575b505050610708612c5c612c5561289b565b5142612683565b11612cc4575b1691827bffffffffffffffffffffffffffff00000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000004260e01b169260701b16171780600b55835192835260701c166020820152a1565b612cea600c54600d54875191612cd9836125ec565b428352602083015287820152612968565b612c62565b828580931602600c5401600c551602600d5401600d555f8080612c44565b508481161515612c3f565b508482161515612c39565b7f95a5c7f9000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b03821115612bf1565b9291909160ff601354165f14612ea557612d768183612b29565b91670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157612da56011548092612665565b92670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612dd46012548094612665565b946001600160a01b03806008541691161493845f14612ea057945b8415612e5d57670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3888670de0b6b3a76400009d612665565b6126e0565b6132f4565b90612683565b9215612e5557509061263e565b90509061263e565b670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3889670de0b6b3a76400009d612665565b612def565b9091926128ce936001600160a01b0380600854169116145f14612edc57612ed0612ed6925b8261263e565b926126e0565b90612665565b612ed0612ed69293612eca565b91906001600160a01b03600a541690600e549382151594855f146130a257600f549181612f19575b50505050505b565b60135460ff1615613016576001600160701b0380612f3b939495169116612b29565b90808211612f53575b505050505b5f80808080612f11565b612f7291612f6c612f6661170f936131a2565b916131a2565b9061341e565b670de0b6b3a76400000390670de0b6b3a7640000821161265157612f96828261263e565b91670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612fc19161263e565b69021e19e0c9bab2400000039069021e19e0c9bab2400000821161265157670de0b6b3a7640000916112ed612ff89260025461263e565b0480613006575b8080612f44565b61300f916132db565b5f80612fff565b61170f613033916001600160701b03806130399597169116612b29565b926131a2565b80831161304a575b50505050612f49565b61307c8161307761271061306e6130676112ed9661308599612683565b968761263e565b049485926126e0565b612683565b9160025461263e565b80613092575b8080613041565b61309b916132db565b5f8061308b565b925050506130ac57565b6130c7600b546001600160701b03808260701c169116612b29565b600e55565b6001600160a01b031690811561318f576001600160a01b031691821561316357815f525f60205260405f205481811061314a57817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f525f84520360405f2055845f525f825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b634b637e8f60e11b5f525f60045260245ffd5b60018111156128ce578060017001000000000000000000000000000000008310156132c5575b600482680100000000000000006132779410156132b8575b6401000000008110156132ab575b6201000081101561329e575b610100811015613292575b6010811015613286575b101561327e575b60030260011c6132268184612665565b0160011c6132348184612665565b0160011c6132428184612665565b0160011c6132508184612665565b0160011c61325e8184612665565b0160011c61326c8184612665565b0160011c8092612665565b8111900390565b60011b613216565b811c9160021b9161320f565b60081c91811b91613205565b60101c9160081b916131fa565b60201c9160101b916131ee565b60401c9160201b916131e0565b5050608081901c680100000000000000006131c8565b906001600160a01b0382161561316357612f17916134e7565b905f5b60ff81106133055750505090565b83613350670de0b6b3a76400006133328161332b8582613325828061263e565b0461263e565b048761263e565b04670de0b6b3a7640000612bc384826133258a82613325828061263e565b83808210156133da579061336391612683565b670de0b6b3a7640000810290808204670de0b6b3a76400001490151715612651578161286361339892612ed660019589613554565b945b85818111156133c357906133ad91612683565b11156133bd576001905b016132f7565b50505090565b6133cc91612683565b11156133bd576001906133b7565b6133e391612683565b670de0b6b3a7640000810290808204670de0b6b3a764000014901517156126515781612e4261341892612ed660019589613554565b9461339a565b906ec097ce7bc90715b34b9f10000000008202905f196ec097ce7bc90715b34b9f10000000008409928280851094039380850394146134db57838211156134c3576ec097ce7bc90715b34b9f1000000000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b50634e487b715f52156003026011186020526024601cfd5b50906128ce9250612665565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206001600160a01b035f93613520866002546126e0565b60025516938415841461353f5780600254036002555b604051908152a3565b84845283825260408420818154019055613536565b8060030260038104820361265157612bc3670de0b6b3a7640000613588819382613581886128ce9961263e565b049061263e565b049282613325828061263e56fea264697066735822122085f7e6129e4054acb7a9f7db9d22ada0f4dc074e356061eba1f6a8a7eee64eaf64736f6c634300081c00330000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f0000000000000000000000005be2e859d0c2453c9aa062860ca27711ff5534320000000000000000000000005e7a9eea6988063a4dbb9ccddb3e04c923e8e37f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f5f3560e01c80631e3dd18b14610e8e578063270401cb14610d9e578063407c301e14610ca757806346c96aac14610c63578063574f2ba314610c4557806361d027b314610c1f5780636373ea6914610c015780636801cc3014610ba257806369fe0e2d14610ad057806382dfdce41461066c57806383b274f214610649578063841fa66b1461061157806390291058146105a95780639aab92481461056e578063a93a897d14610440578063bc063e1a14610422578063cd962a061461037a578063d2b663841461033d578063d32af6c1146102f9578063ddca3f43146102db578063e0bd111d14610211578063e5e31b13146101d4578063e7589b39146101ad5763f0f4426014610122575f80fd5b346101aa5760203660031901126101aa5761013b610efb565b6001600160a01b0360015416330361019b576001600160a01b03168073ffffffffffffffffffffffffffffffffffffffff19835416178255337f567657fa3f286518b318f4a29870674f433f622fdfc819691acb13105b2282258380a380f35b600482633d83866f60e01b8152fd5b80fd5b50346101aa57806003193601126101aa5760206001600160a01b0360015416604051908152f35b50346101aa5760203660031901126101aa5760ff60406020926001600160a01b036101fd610efb565b168152600684522054166040519015158152f35b50346101aa5760403660031901126101aa5761022b610efb565b602435801515918282036102d7576001600160a01b036001541633036102c8576001600160a01b03168084526008602052604084205490919060ff16151583146102b2575b8184526008602052604084209060ff8019835416911515161790557f13af6400168c56d7a03760d35e1d3d7e60d3f86c654d857e5c77ed8a83ffc1198380a380f35b50808352600860205260ff604084205416610270565b600484633d83866f60e01b8152fd5b8380fd5b50346101aa57806003193601126101aa576020600254604051908152f35b50346101aa57806003193601126101aa5760206040516001600160a01b037f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1168152f35b50346101aa5760203660031901126101aa5760ff60406020926001600160a01b03610366610efb565b168152600884522054166040519015158152f35b50346101aa5760203660031901126101aa576004356001600160a01b0360015416331480156103f0575b156103ec5761271081116103dd57806003557f2b29780fbcadbddb5194d8c2c6a834e1cd71e5a38456738fb1c9d39c7821066b8280a280f35b60048263740efc0360e01b8152fd5b5080fd5b506001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f1633146103a4565b50346101aa57806003193601126101aa5760206040516207a1208152f35b50346101aa5760403660031901126101aa5761045a610efb565b602435906001600160a01b03600154163314801561053c575b15610538576207a1208211610529578161051a576001600160a01b03600254915b1690813b156102d757836040516369fe0e2d60e01b8152826004820152818160248183885af1801561050f576104fa575b50829052600760205260408420557fc792b1e9d2b63c63a75f8146a0b5bd7f568bdd6a0b97b9c31d585398718d4c468380a380f35b8161050491610f36565b6102d757835f6104c5565b6040513d84823e3d90fd5b6001600160a01b038291610494565b6004836345fbd9c160e01b8152fd5b8280fd5b506001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f163314610473565b50346101aa57806003193601126101aa5760206040517f4ed7aeec7c0286cad1e282dee1c391719fc17fe923b04fb0775731e413ed35548152f35b50346101aa5760203660031901126101aa576004358015158091036103ec576001600160a01b0360015416330361019b5760ff196009541660ff821617600955337f09f29919de9bbce805ed8b6088457163a7508940470e70a1c67a8d58a70b433d8380a380f35b50346101aa5760203660031901126101aa5760406020916001600160a01b03610638610efb565b168152600783522054604051908152f35b50346101aa57806003193601126101aa57602060ff600954166040519015158152f35b50346101aa5760603660031901126101aa57610686610efb565b61068e610f11565b610696610f27565b916001600160a01b0382166001600160a01b038216818114610aa8571015610aa2575b6001600160a01b038116908115610a7a578185526004602052604085206001600160a01b0384165f5260205260405f20931515938486526020526001600160a01b03604086205416610a52576040516bffffffffffffffffffffffff19602082019260601b1682526bffffffffffffffffffffffff196001600160a01b0385169460601b1660348201528460f81b60488201526029815261075b604982610f36565b5190206040516138eb8082019082821067ffffffffffffffff831117610a3e57908291610f6d8339039086f58015610a33576001600160a01b031692833b156109f057846040517fe4bbb5a80000000000000000000000000000000000000000000000000000000081528360048201528460248201528260448201528181606481838a5af1801561050f57610a1e575b50600254853b156103ec57604051906369fe0e2d60e01b825260048201528181602481838a5af1801561050f57610a09575b50506002548486526007602052604086205560ff60095416610968575b818552600460205260408520835f5260205260405f20818652602052604085206001600160a01b03851673ffffffffffffffffffffffffffffffffffffffff19825416179055828552600460205260408520825f5260205260405f20908552602052604084206001600160a01b03841673ffffffffffffffffffffffffffffffffffffffff1982541617905560055468010000000000000000811015610954576020946108ef82600160409401600555610ecf565b81549060031b906001600160a01b0388831b921b19161790558481526006865220600160ff198254161790557f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9604060055481519086825287820152a3604051908152f35b602485634e487b7160e01b81526041600452fd5b846001600160a01b03815416853b156103ec576040519063e74b981b60e01b825260048201528181602481838a5af1801561050f576109f4575b50600354853b156103ec57604051906366cb150360e11b825260048201528181602481838a5af1801561050f576109db575b505061083a565b816109e591610f36565b6109f057845f6109d4565b8480fd5b816109fe91610f36565b6109f057845f6109a2565b81610a1391610f36565b6109f057845f61081d565b81610a2891610f36565b6109f057845f6107eb565b6040513d86823e3d90fd5b602488634e487b7160e01b81526041600452fd5b6004857f6d47e01d000000000000000000000000000000000000000000000000000000008152fd5b6004857f7759ce3f000000000000000000000000000000000000000000000000000000008152fd5b906106b9565b6004867f782e49d8000000000000000000000000000000000000000000000000000000008152fd5b50346101aa5760203660031901126101aa576004356001600160a01b036001541633148015610b70575b156103ec578015610b48576207a1208111610b3957806002557e172ddfc5ae88d08b3de01a5a187667c37a5a53989e8c175055cb6c993792a78280a280f35b6004826345fbd9c160e01b8152fd5b6004827f3ac4c7fe000000000000000000000000000000000000000000000000000000008152fd5b506001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f163314610afa565b50346101aa5760603660031901126101aa576001600160a01b036040602092610bc9610efb565b610bd1610f11565b84610bda610f27565b92168352600486528484842091165f528552825f2090151582528452205416604051908152f35b50346101aa57806003193601126101aa576020600354604051908152f35b50346101aa57806003193601126101aa576001600160a01b036020915416604051908152f35b50346101aa57806003193601126101aa576020600554604051908152f35b50346101aa57806003193601126101aa5760206040516001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f168152f35b50346101aa5760403660031901126101aa57610cc1610efb565b602435906001600160a01b036001541633148015610d6c575b15610538576127108211610d5d576001600160a01b0316803b1561053857826040516366cb150360e11b8152836004820152818160248183875af1801561050f57610d48575b50807f40c433a8082166fcd8218fba9d4247bb08e03016d0056fc857d6363673ded03191a380f35b81610d5291610f36565b61053857825f610d20565b60048363740efc0360e01b8152fd5b506001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f163314610cda565b5034610e7b576040366003190112610e7b57610db8610efb565b610dc0610f11565b906001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f163303610e7f576001600160a01b0316803b15610e7b576001600160a01b036040519263e74b981b60e01b845216918260048201525f8160248183865af18015610e7057610e5b575b507fd9d6b85b6d670cd443496fc6d03390f739bbff47f96a8e33fb0cdd52ad26f5c28380a380f35b610e689193505f90610f36565b5f915f610e33565b6040513d5f823e3d90fd5b5f80fd5b633d83866f60e01b5f5260045ffd5b34610e7b576020366003190112610e7b57600435600554811015610e7b576001600160a01b03610ebf602092610ecf565b90549060031b1c16604051908152f35b600554811015610ee75760055f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b600435906001600160a01b0382168203610e7b57565b602435906001600160a01b0382168203610e7b57565b604435908115158203610e7b57565b90601f8019910116810190811067ffffffffffffffff821117610f5857604052565b634e487b7160e01b5f52604160045260245ffdfe60a0604052346102f9576100116102fd565b6100196102fd565b81516001600160401b03811161020c57600354600181811c911680156102ef575b60208210146101ee57601f811161028c575b50602092601f821160011461022b57928192935f92610220575b50508160011b915f199060031b1c1916176003555b80516001600160401b03811161020c57600454600181811c91168015610202575b60208210146101ee57601f811161018b575b50602091601f821160011461012b579181925f92610120575b50508160011b915f199060031b1c1916176004555b6001600555336080526040516135cb908161032082396080518181816103d30152818161046e01528181610d6f01528181610dcd01528181610e8b015261197a0152f35b015190505f806100c7565b601f1982169260045f52805f20915f5b8581106101735750836001951061015b575b505050811b016004556100dc565b01515f1960f88460031b161c191690555f808061014d565b9192602060018192868501518155019401920161013b565b60045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c810191602084106101e4575b601f0160051c01905b8181106101d957506100ae565b5f81556001016101cc565b90915081906101c3565b634e487b7160e01b5f52602260045260245ffd5b90607f169061009c565b634e487b7160e01b5f52604160045260245ffd5b015190505f80610066565b601f1982169360035f52805f20915f5b868110610274575083600195961061025c575b505050811b0160035561007b565b01515f1960f88460031b161c191690555f808061024e565b9192602060018192868501518155019401920161023b565b60035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810191602084106102e5575b601f0160051c01905b8181106102da575061004c565b5f81556001016102cd565b90915081906102c4565b90607f169061003a565b5f80fd5b60405190602082016001600160401b0381118382101761020c576040525f825256fe60806040526004361015610011575f80fd5b5f5f3560e01c8063022c0d9f146120a057806306fdde0314611ff95780630902f1ac14611f9b578063095ea7b314611ef25780630dfe168114611ecb57806313345fe114611d9057806313966db514611d3957806318160ddd14611d1b5780631df8c71714611ce257806322be3de114611cbf57806323b872dd14611bbe578063252c09d714611b65578063313ce56714611b49578063392f37e914611ad65780634690484014611aaf578063517b3f82146119ee5780635881c475146119c75780636373ea69146119a957806369fe0e2d1461195e5780636a627842146115fc57806370a08231146115c55780637464fc3d146115a757806389afcb44146111fe5780638a7b8cf2146111c757806395d89b41146110e85780639e8cc04b1461108e578063a9059cbb1461105c578063ba9a7a561461103f578063bc25cf7714610e2d578063bf944dbc14610e0f578063c245febc14610df1578063c45a015514610dad578063cd962a0614610d53578063d21220a714610d2c578063dd62ed3e14610cde578063ddca3f4314610cc0578063e4bbb5a814610432578063e74b981b146103af578063ebeb31db14610391578063f140a35a146103115763fff6cae9146101dd575f80fd5b3461030e578060031936011261030e576101f56129fb565b602460206001600160a01b0360085416604051928380926370a0823160e01b82523060048301525afa80156103035782906102d0575b6024915060206001600160a01b0360095416604051938480926370a0823160e01b82523060048301525afa9081156102c557839161028b575b6102839250600b54916001600160701b03808460701c16931691612bde565b600160055580f35b90506020823d6020116102bd575b816102a66020938361261c565b810103126102b957610283915190610264565b5f80fd5b3d9150610299565b6040513d85823e3d90fd5b506020813d6020116102fb575b816102ea6020938361261c565b810103126102b9576024905161022b565b3d91506102dd565b6040513d84823e3d90fd5b80fd5b503461030e57604036600319011261030e57610366600435610331612519565b90600b54916103616001600160701b03808560701c16941692620f424061035a6010548361263e565b0490612683565b612d5c565b5f1981019190821161037d57602082604051908152f35b80634e487b7160e01b602492526011600452fd5b503461030e578060031936011261030e576020600654604051908152f35b503461030e57602036600319011261030e576103c9612503565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610423576001600160a01b031673ffffffffffffffffffffffffffffffffffffffff19600a541617600a5580f35b600482633d83866f60e01b8152fd5b503461030e57606036600319011261030e5761044c612503565b90610455612519565b9160443580151591828203610cbc576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610cad576001600160a01b03809116948573ffffffffffffffffffffffffffffffffffffffff19600854161760085516918273ffffffffffffffffffffffffffffffffffffffff19600954161760095560ff8019601354169116176013555f14610ac8576040516395d89b4160e01b81528281600481875afa9081156102c5578391610aae575b506040516395d89b4160e01b81528381600481865afa908115610aa3576105ae600160049460336020899681968891610a89575b506040519687947f4c656761637920436f7272656c617465642d2000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603483015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610a6c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610668946001948891610a4a575b506040519687947f63414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b905b825167ffffffffffffffff811161090a57610686601454612690565b601f81116109a9575b506020601f82116001146109295782939482939261091e575b50508160011b915f199060031b1c1916176014555b815167ffffffffffffffff811161090a576106d9601554612690565b601f8111610869575b50602092601f82116001146107ea579282938293926107df575b50508160011b915f199060031b1c1916176015555b610734604051610720816125ec565b428152826020820152826040820152612968565b600460206001600160a01b03600854166040519283809263313ce56760e01b82525afa80156103035761076e9183916107b0575b506129ea565b601155600460206001600160a01b03600954166040519283809263313ce56760e01b82525afa8015610303576107aa9183916107b057506129ea565b60125580f35b6107d2915060203d6020116107d8575b6107ca818361261c565b8101906129d1565b5f610768565b503d6107c0565b015190505f806106fc565b60158352601f198216937f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591845b8681106108515750836001959610610839575b505050811b01601555610711565b01515f1960f88460031b161c191690555f808061082b565b91926020600181928685015181550194019201610818565b60158352601f820160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4750190602083106108e2575b601f0160051c7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501905b8181106108d757506106e2565b8381556001016108ca565b7f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47591506108a0565b602482634e487b7160e01b81526041600452fd5b015190505f806106a8565b601483527fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90601f198316845b81811061099157509583600195969710610979575b505050811b016014556106bd565b01515f1960f88460031b161c191690555f808061096b565b9192602060018192868b015181550194019201610956565b60148352601f820160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec019060208310610a22575b601f0160051c7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec01905b818110610a17575061068f565b838155600101610a0a565b7fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec91506109e0565b610a6691503d808a833e610a5e818361261c565b810190612905565b5f610605565b60049250610a83903d8084833e610a5e818361261c565b916105d2565b610a9d91503d808a833e610a5e818361261c565b5f61054b565b6040513d86823e3d90fd5b610ac291503d8085833e610a5e818361261c565b5f610517565b6040516395d89b4160e01b81528281600481875afa9081156102c5578391610c93575b506040516395d89b4160e01b81528381600481865afa908115610aa357610b82600160049460316020899681968891610c79575b506040519687947f4c656761637920566f6c6174696c652d20000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101603283015e010185838201520301601f19810183528261261c565b94604051928380926395d89b4160e01b82525afa9081156102c55783908192610c5c575b5060049192604051928380926395d89b4160e01b82525afa9081156102c557602092602584610c3c946001948891610c42575b506040519687947f76414d4d2d000000000000000000000000000000000000000000000000000000828701528051918291018587015e840190602f60f81b84830152805192839101602683015e010185838201520301601f19810183528261261c565b9061066a565b610c5691503d808a833e610a5e818361261c565b5f610bd9565b60049250610c73903d8084833e610a5e818361261c565b91610ba6565b610c8d91503d808a833e610a5e818361261c565b5f610b1f565b610ca791503d8085833e610a5e818361261c565b5f610aeb565b600484633d83866f60e01b8152fd5b8380fd5b503461030e578060031936011261030e576020601054604051908152f35b503461030e57604036600319011261030e576001600160a01b036040610d02612503565b9282610d0c612519565b9416815260016020522091165f52602052602060405f2054604051908152f35b503461030e578060031936011261030e5760206001600160a01b0360095416604051908152f35b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e57600435600f5580f35b80633d83866f60e01b60049252fd5b503461030e578060031936011261030e5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b503461030e578060031936011261030e576020600d54604051908152f35b503461030e578060031936011261030e576020600c54604051908152f35b503461030e57602036600319011261030e57610e47612503565b610e4f6129fb565b6040517fd2b663840000000000000000000000000000000000000000000000000000000081523060048201526020816024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9081156102c5578391611010575b5015610fe8576001600160a01b03600854166001600160a01b036009541690604051906370a0823160e01b8252306004830152602082602481845afa918215610fdd5784908693610fa5575b50610f21610f27936001600160701b03600b541690612683565b91612a34565b604051916370a0823160e01b8352306004840152602083602481855afa928315610aa3578493610f6f575b50610f21610283936001600160701b03600b5460701c1690612683565b92506020833d602011610f9d575b81610f8a6020938361261c565b810103126102b957915191610f21610f52565b3d9150610f7d565b9250506020823d602011610fd5575b81610fc16020938361261c565b810103126102b95790519083610f21610f07565b3d9150610fb4565b6040513d87823e3d90fd5b6004827f384002a2000000000000000000000000000000000000000000000000000000008152fd5b611032915060203d602011611038575b61102a818361261c565b8101906128d1565b5f610ebb565b503d611020565b503461030e578060031936011261030e5760206040516103e88152f35b503461030e57604036600319011261030e57611083611079612503565b60243590336130cc565b602060405160018152f35b503461030e576110aa6110a0366125c2565b9291908391612701565b825b81518410156110d4576110cc6001916110c586856126ed565b51906126e0565b9301926110ac565b6110e083602092612665565b604051908152f35b503461030e578060031936011261030e5760405190806004549061110b82612690565b80855291600181169081156111a05750600114611143575b61113f846111338186038261261c565b6040519182918261252f565b0390f35b600481527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b8082106111865750909150810160200161113382611123565b91926001816020925483858801015201910190929161116d565b60ff191660208087019190915292151560051b850190920192506111339150839050611123565b503461030e578060031936011261030e5760606111e261289b565b6040805191805183526020810151602084015201516040820152f35b503461030e57602036600319011261030e57611218612503565b6112206129fb565b611245600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160a01b0360085416916001600160a01b036009541694604051916370a0823160e01b8352306004840152602083602481885afa92831561159a578193611566575b50604051966370a0823160e01b8852306004890152602088602481845afa95861561030357879883989761152f575b50308352826020526112f96112ed6112ed6112f26112e08860408920549c612ee9565b986002549384918d61263e565b612665565b9a8a61263e565b9688151580611526575b156114fe5730156114eb573084528360205260408420548181106114d2579184826020936024969530845283865203604083205580600254036002556040519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef843092a36113758a8983612a34565b611380898985612a34565b604051938480926370a0823160e01b82523060048301525afa9182156102c557839261149d575b506020602491604051928380926370a0823160e01b82523060048301525afa9283156114915792611456575b50966113e29291604098612bde565b611433575b6001600160a01b0384519184835283602084015216907fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496853392a3600160055582519182526020820152f35b61144e600b546001600160701b03808260701c169116612b29565b600e556113e7565b929150966020833d602011611489575b816114736020938361261c565b810103126102b9579151919690919060406113d3565b3d9150611466565b604051903d90823e3d90fd5b9091506020813d6020116114ca575b816114b96020938361261c565b810103126102b957519060206113a7565b3d91506114ac565b63391434e360e21b855230600452602452604452606483fd5b602484634b637e8f60e11b815280600452fd5b6004847f42a0889c000000000000000000000000000000000000000000000000000000008152fd5b50871515611303565b965096506020863d60201161155e575b8161154c6020938361261c565b810103126102b957879551965f6112bd565b3d915061153f565b9092506020813d602011611592575b816115826020938361261c565b810103126102b95751915f61128e565b3d9150611575565b50604051903d90823e3d90fd5b503461030e578060031936011261030e576020600e54604051908152f35b503461030e57602036600319011261030e5760406020916001600160a01b036115ec612503565b1681528083522054604051908152f35b503461030e57602036600319011261030e57602490611619612503565b6116216129fb565b611646600b546001600160701b038116916001600160701b038260701c169160e01c90565b5093909160206001600160a01b0360085416604051938480926370a0823160e01b82523060048301525afa918215610aa3578492611929575b506024919260206001600160a01b0360095416604051948580926370a0823160e01b82523060048301525afa928315610fdd5785936118f5575b506001600160701b038116926116cf8486612683565b946001600160701b038816936116e58584612683565b95876116f18b87612ee9565b966002549283155f146118cb57505061171491508761170f9161263e565b6131a2565b6103e71981019081116118b757976117306103e861dead6134e7565b60ff601354166117e7575b88156117bf57509161175a93916117558960209b956132db565b612bde565b61179c575b604051918252838201527f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f60403392a26001600555604051908152f35b6117b7600b546001600160701b03808260701c169116612b29565b600e5561175f565b807fad69186f0000000000000000000000000000000000000000000000000000000060049252fd5b633b9aca006117f6888a612b29565b106118a857670de0b6b3a76400008802888104670de0b6b3a764000014891517156118945760115461182791612665565b670de0b6b3a76400008802888104670de0b6b3a764000014891517156118805760125461185391612665565b1461173b57807fde5011e80000000000000000000000000000000000000000000000000000000060049252fd5b602483634e487b7160e01b81526011600452fd5b602482634e487b7160e01b81526011600452fd5b8063a932492f60e01b60049252fd5b602489634e487b7160e01b81526011600452fd5b6118df6112ed916112ed866118e69661263e565b938a61263e565b9081808210911802189761173b565b9092506020813d602011611921575b816119116020938361261c565b810103126102b95751915f6116b9565b3d9150611904565b91506020823d602011611956575b816119446020938361261c565b810103126102b957602491519161167f565b3d9150611937565b503461030e57602036600319011261030e576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610d9e5760043560105580f35b503461030e578060031936011261030e576020600f54604051908152f35b503461030e5761113f6119e26119dc366125c2565b91612701565b60405191829182612559565b503461030e57604036600319011261030e57611a08612503565b90611a1161289b565b90611a1a6127ed565b509183514214611a66575b60206110e08686611a5d6112ed6112ed896040611a548b611a47885142612683565b9586918c8a015190612683565b95015190612683565b91602435612d5c565b600654919350600119820191821161037d575091611a5d6112ed6112ed602096946040611a54611aa1611a9b6110e09a612592565b50612873565b985050509496505050611a25565b503461030e578060031936011261030e5760206001600160a01b03600a5416604051908152f35b503461030e578060031936011261030e5760e0601154601254600b5460ff601354166001600160701b036001600160a01b0360085416926001600160a01b0360095416946040519687526020870152818116604087015260701c1660608501521515608084015260a083015260c0820152f35b503461030e578060031936011261030e57602060405160128152f35b503461030e57602036600319011261030e57600435600654811015611bba57611b8d90612592565b50805461113f60026001840154930154604051938493846040919493926060820195825260208201520152565b5080fd5b503461030e57606036600319011261030e57611bd8612503565b611be0612519565b604435916001600160a01b0381168085526001602052604085206001600160a01b0333165f5260205260405f2054905f198203611c24575b505061108393506130cc565b848210611c8b578015611c78573315611c65578560409161108397526001602052206001600160a01b0333165f526020528360405f20910390555f80611c18565b602486634a1406b160e11b815280600452fd5b60248663e602df0560e01b815280600452fd5b60648686847ffb8f41b200000000000000000000000000000000000000000000000000000000835233600452602452604452fd5b503461030e578060031936011261030e57602060ff601354166040519015158152f35b503461030e578060031936011261030e5761113f611cfe6127ed565b604080519384526020840192909252908201529081906060820190565b503461030e578060031936011261030e576020600254604051908152f35b503461030e578060031936011261030e57611d526129fb565b600b546001600160701b038082169160701c16611d6f8183612ee9565b611d7d575b82600160055580f35b611d8691612b29565b600e555f80611d74565b503461030e57608036600319011261030e57611daa612503565b9060643590604435602435611dbe826126c8565b94611dcc604051968761261c565b828652601f19611ddb846126c8565b013660208801376006545f19810193908411611eb757611e0186611e079296959661263e565b85612683565b925b848410611e1e576040518061113f8982612559565b856001611eb192611e9f611e3284896126e0565b611e97611e54611e4183612592565b5054611e4c8c612592565b505490612683565b6112ed8b6002611e7f81611e8e611e88876112ed8e611e728d612592565b5001548f611e7f8a612592565b50015490612683565b98612592565b50015492612592565b908789612d5c565b611ea9828c6126ed565b5201946126e0565b92611e09565b602485634e487b7160e01b81526011600452fd5b503461030e578060031936011261030e5760206001600160a01b0360085416604051908152f35b503461030e57604036600319011261030e57611f0c612503565b602435903315611f88576001600160a01b0316918215611f7557604090338152600160205220825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b80634a1406b160e11b6024925280600452fd5b60248363e602df0560e01b815280600452fd5b503461030e578060031936011261030e5760606001600160701b0363ffffffff611fe0600b546001600160701b038116916001600160701b038260701c169160e01c90565b9193908160405195168552166020840152166040820152f35b503461030e578060031936011261030e5760405190806003549061201c82612690565b80855291600181169081156111a057506001146120435761113f846111338186038261261c565b600381527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b8082106120865750909150810160200161113382611123565b91926001816020925483858801015201910190929161206d565b50346102b95760803660031901126102b957604435906001600160a01b0382166024356004358285036102b95760643567ffffffffffffffff81116102b957366023820112156102b95780600401359067ffffffffffffffff82116102b95736602483830101116102b9576121136129fb565b821590811580926124fa575b156124d257612149600b546001600160701b038116916001600160701b038260701c169160e01c90565b509290916001600160701b03831694858710806124c0575b15612498576001600160a01b03600854169a6001600160a01b0360095416938c8b14158061248e575b156124665788828e92612455575b5050508880612444575b50508061239a575b505060206024979899604051988980926370a0823160e01b82523060048301525afa96871561235a578997612365575b506020602491604051928380926370a0823160e01b82523060048301525afa90811561235a578991612328575b5084840380881115612320578703965b6001600160701b0384169487860380841115612318578303955b891580159061230f575b156122e7576122849061227e8b612278620f424061227161226a82612263601054809761263e565b048a612683565b938d61263e565b0488612683565b90612b29565b92612b29565b116122d85790612295939291612bde565b6040519384526020840152604083015260608201527fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d82260803392a3600160055580f35b60048a63a932492f60e01b8152fd5b60048c7fba0b951e000000000000000000000000000000000000000000000000000000008152fd5b5086151561223b565b508a95612231565b508896612217565b90506020813d602011612352575b816123436020938361261c565b810103126102b957515f612207565b3d9150612336565b6040513d8b823e3d90fd5b9096506020813d602011612392575b816123816020938361261c565b810103126102b957519560206121da565b3d9150612374565b883b156102b9578760a488835f94602460405197889687957f9a7bff790000000000000000000000000000000000000000000000000000000087523360048801528387015260448601526080606486015282608486015201848401378181018301859052601f01601f19168101030181838c5af180156124395761241f575b806121aa565b60249798505f61242e9161261c565b60205f989750612419565b6040513d5f823e3d90fd5b61244e9185612a34565b5f886121a2565b61245e92612a34565b8b8882612198565b7fa8fa826d000000000000000000000000000000000000000000000000000000005f5260045ffd5b50848b141561218a565b7f083ff6a1000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b0385168810612161565b7fbfe3b102000000000000000000000000000000000000000000000000000000005f5260045ffd5b5084151561211f565b600435906001600160a01b03821682036102b957565b602435906001600160a01b03821682036102b957565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b60206040818301928281528451809452019201905f5b81811061257c5750505090565b825184526020938401939092019160010161256f565b6006548110156125ae5760065f52600360205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b60609060031901126102b9576004356001600160a01b03811681036102b957906024359060443590565b6060810190811067ffffffffffffffff82111761260857604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761260857604052565b8181029291811591840414171561265157565b634e487b7160e01b5f52601160045260245ffd5b811561266f570490565b634e487b7160e01b5f52601260045260245ffd5b9190820391821161265157565b90600182811c921680156126be575b60208310146126aa57565b634e487b7160e01b5f52602260045260245ffd5b91607f169161269f565b67ffffffffffffffff81116126085760051b60200190565b9190820180921161265157565b80518210156125ae5760209160051b010190565b61270a836126c8565b92612718604051948561261c565b808452601f19612727826126c8565b013660208601376006545f1981019190821161265157801581800460011417156126515761275790829492612683565b905f5b84831061276957505050505090565b6001830190818411612651576127cf826127c761279561278a600196612592565b5054611e4c89612592565b6112ed60026127b96127b3846112ed8d8c611e7f81611e8e8d612592565b95612592565b5001546002611e7f8b612592565b908786612d5c565b6127d982896126ed565b52019160018101809111612651579161275a565b4290600c5491600d549163ffffffff612821600b546001600160701b038116916001600160701b038260701c169160e01c90565b9092164263ffffffff16810361283657505050565b6001600160701b03612869612870959794986128636128639561285a859642612683565b9586911661263e565b906126e0565b971661263e565b91565b90604051612880816125ec565b60406002829480548452600181015460208501520154910152565b5f604080516128a9816125ec565b82815282602082015201526006545f19810190811161265157611a9b6128ce91612592565b90565b908160209103126102b9575180151581036102b95790565b67ffffffffffffffff811161260857601f01601f191660200190565b6020818303126102b95780519067ffffffffffffffff82116102b9570181601f820112156102b957805190612939826128e9565b92612947604051948561261c565b828452602083830101116102b957815f9260208093018386015e8301015290565b6006546801000000000000000081101561260857600181016006556006548110156125ae5760065f526003027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0190604081600292518455602081015160018501550151910155565b908160209103126102b9575160ff811681036102b95790565b60ff16604d811161265157600a0a90565b600260055414612a0c576002600555565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b919091803b156102b9575f92838093604051906001600160a01b0360208301947fa9059cbb000000000000000000000000000000000000000000000000000000008652166024830152604482015260448152612a9160648261261c565b51925af13d15612b22573d612aa5816128e9565b90612ab3604051928361261c565b81523d5f602083013e5b81612af3575b5015612acb57565b7f817275ab000000000000000000000000000000000000000000000000000000005f5260045ffd5b8051801592508215612b08575b50505f612ac3565b612b1b92506020809183010191016128d1565b5f80612b00565b6060612abd565b60135460ff1615612bd457670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157601154612b6191612665565b90670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157670de0b6b3a764000091612bca612ba0612bd09360125490612665565b84612bc381612bbb81612bb3868961263e565b04968061263e565b04928061263e565b04906126e0565b9061263e565b0490565b906128ce9161263e565b91926001600160701b0383111580612d4b575b15612d23576001600160701b0360409381927f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad196600b5460e01c918242039242141580612d18575b80612d0d575b612cef575b505050610708612c5c612c5561289b565b5142612683565b11612cc4575b1691827bffffffffffffffffffffffffffff00000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000004260e01b169260701b16171780600b55835192835260701c166020820152a1565b612cea600c54600d54875191612cd9836125ec565b428352602083015287820152612968565b612c62565b828580931602600c5401600c551602600d5401600d555f8080612c44565b508481161515612c3f565b508482161515612c39565b7f95a5c7f9000000000000000000000000000000000000000000000000000000005f5260045ffd5b506001600160701b03821115612bf1565b9291909160ff601354165f14612ea557612d768183612b29565b91670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561265157612da56011548092612665565b92670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612dd46012548094612665565b946001600160a01b03806008541691161493845f14612ea057945b8415612e5d57670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3888670de0b6b3a76400009d612665565b6126e0565b6132f4565b90612683565b9215612e5557509061263e565b90509061263e565b670de0b6b3a7640000870296808804670de0b6b3a7640000149015171561265157612e4281612e4893612e3d612bd099612e3889670de0b6b3a76400009d612665565b612def565b9091926128ce936001600160a01b0380600854169116145f14612edc57612ed0612ed6925b8261263e565b926126e0565b90612665565b612ed0612ed69293612eca565b91906001600160a01b03600a541690600e549382151594855f146130a257600f549181612f19575b50505050505b565b60135460ff1615613016576001600160701b0380612f3b939495169116612b29565b90808211612f53575b505050505b5f80808080612f11565b612f7291612f6c612f6661170f936131a2565b916131a2565b9061341e565b670de0b6b3a76400000390670de0b6b3a7640000821161265157612f96828261263e565b91670de0b6b3a7640000830292808404670de0b6b3a7640000149015171561265157612fc19161263e565b69021e19e0c9bab2400000039069021e19e0c9bab2400000821161265157670de0b6b3a7640000916112ed612ff89260025461263e565b0480613006575b8080612f44565b61300f916132db565b5f80612fff565b61170f613033916001600160701b03806130399597169116612b29565b926131a2565b80831161304a575b50505050612f49565b61307c8161307761271061306e6130676112ed9661308599612683565b968761263e565b049485926126e0565b612683565b9160025461263e565b80613092575b8080613041565b61309b916132db565b5f8061308b565b925050506130ac57565b6130c7600b546001600160701b03808260701c169116612b29565b600e55565b6001600160a01b031690811561318f576001600160a01b031691821561316357815f525f60205260405f205481811061314a57817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f525f84520360405f2055845f525f825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b634b637e8f60e11b5f525f60045260245ffd5b60018111156128ce578060017001000000000000000000000000000000008310156132c5575b600482680100000000000000006132779410156132b8575b6401000000008110156132ab575b6201000081101561329e575b610100811015613292575b6010811015613286575b101561327e575b60030260011c6132268184612665565b0160011c6132348184612665565b0160011c6132428184612665565b0160011c6132508184612665565b0160011c61325e8184612665565b0160011c61326c8184612665565b0160011c8092612665565b8111900390565b60011b613216565b811c9160021b9161320f565b60081c91811b91613205565b60101c9160081b916131fa565b60201c9160101b916131ee565b60401c9160201b916131e0565b5050608081901c680100000000000000006131c8565b906001600160a01b0382161561316357612f17916134e7565b905f5b60ff81106133055750505090565b83613350670de0b6b3a76400006133328161332b8582613325828061263e565b0461263e565b048761263e565b04670de0b6b3a7640000612bc384826133258a82613325828061263e565b83808210156133da579061336391612683565b670de0b6b3a7640000810290808204670de0b6b3a76400001490151715612651578161286361339892612ed660019589613554565b945b85818111156133c357906133ad91612683565b11156133bd576001905b016132f7565b50505090565b6133cc91612683565b11156133bd576001906133b7565b6133e391612683565b670de0b6b3a7640000810290808204670de0b6b3a764000014901517156126515781612e4261341892612ed660019589613554565b9461339a565b906ec097ce7bc90715b34b9f10000000008202905f196ec097ce7bc90715b34b9f10000000008409928280851094039380850394146134db57838211156134c3576ec097ce7bc90715b34b9f1000000000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b50634e487b715f52156003026011186020526024601cfd5b50906128ce9250612665565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206001600160a01b035f93613520866002546126e0565b60025516938415841461353f5780600254036002555b604051908152a3565b84845283825260408420818154019055613536565b8060030260038104820361265157612bc3670de0b6b3a7640000613588819382613581886128ce9961263e565b049061263e565b049282613325828061263e56fea264697066735822122085f7e6129e4054acb7a9f7db9d22ada0f4dc074e356061eba1f6a8a7eee64eaf64736f6c634300081c0033a26469706673582212203ca80b9284d4e61a44df17bd0463679e92fa34d5e82e1a62d73cd09ed56d1ebe64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f0000000000000000000000005be2e859d0c2453c9aa062860ca27711ff5534320000000000000000000000005e7a9eea6988063a4dbb9ccddb3e04c923e8e37f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
-----Decoded View---------------
Arg [0] : _voter (address): 0x3aF1dD7A2755201F8e2D6dCDA1a61d9f54838f4f
Arg [1] : _treasury (address): 0x5Be2e859D0c2453C9aA062860cA27711ff553432
Arg [2] : _accessHub (address): 0x5e7A9eea6988063A4dBb9CcDDB3E04C923E8E37f
Arg [3] : _feeRecipientFactory (address): 0x5712bD693aC758158146aa151F31BD74CFBF37c1
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f
Arg [1] : 0000000000000000000000005be2e859d0c2453c9aa062860ca27711ff553432
Arg [2] : 0000000000000000000000005e7a9eea6988063a4dbb9ccddb3e04c923e8e37f
Arg [3] : 0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.