More Info
Private Name Tags
ContractCreator
Latest 6 from a total of 6 transactions
Loading...
Loading
Contract Name:
ETHRouter_V5_FromInput
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.0; import "hardhat/console.sol"; //i mport "./libraries/BytesLib.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; //import "../libraries/openzeppelin-contracts/contracts/utils/math/SafeMath.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Callee.sol"; import "../libraries/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; import "../libraries/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; //import "../libraries/v2-core/contracts/interfaces/IERC20.sol"; //import "../libraries/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; //import "../libraries/openzeppelin-contracts/contracts/interfaces/IERC2612.sol"; //import "./libraries/anyswap-v1-core/contracts/AnyswapV4CallProxy.sol"; //import "../libraries/v3-core/contracts/libraries/TickMath.sol"; import "./TickMath_0.8.sol"; import "../libraries/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; import "./interfaces/IWETH9.sol"; import "../libraries/TransferHelper.sol"; //import "../libraries/balancer-v2-monorepo/pkg/interfaces/contracts/vault/IVault.sol"; //import "../libraries/balancer-v2-monorepo/pkg/interfaces/contracts/vault/IBasePool.sol"; //import "../libraries/balancer-v2-monorepo/pkg/interfaces/contracts/vault/IAsset.sol"; import "./CalldataLoader.sol"; //import "./ETHRouter_V4_types.sol"; import "./ETHRouter_V5_types.sol"; import "./addrs_and_selectors.sol"; contract ETHRouter_V5_FromInput is IUniswapV3SwapCallback { // using SafeMath for uint; // using SafeMath for int; using CalldataLoader for uint; // using BytesLoader for uint; using V5CallType_basic_lib for V5CallType_basic_lib.CallType_basic_vars; // using V5CallType_1_lib for V5CallType_1_lib.CallType_1_vars; using V5CallType_5_lib for V5CallType_5_lib.CallType_5_vars; using V5CallType_6_lib for V5CallType_6_lib.CallType_6_vars; using V5CallType_7_lib for V5CallType_7_lib.CallType_7_vars; using V5ExecHeader for V5ExecHeader.Header; // address current_pool; address public owner; address public current_caller; address private callback_to_check; uint public value_to_pay; uint public constant network = 1; uint public constant SLIPPAGE_LIMIT = 200; constructor() { owner = msg.sender; } modifier ownerOnly { require(owner == msg.sender, 'ownerOnly'); _; } modifier isLocked { require(current_caller != address(0), 'isLocked: false'); _; } modifier isUnlocked { require(current_caller == address(0), 'isUnlocked: false'); _; } modifier isCallbackChecked { require(callback_to_check == msg.sender, 'callback_to_check failure'); _; } function setOwner(address newOwner) external ownerOnly { owner = newOwner; } function exec(bytes calldata data) isUnlocked() external payable returns (uint ind) { current_caller = msg.sender; (V5ExecHeader.Header memory h, uint ind_) = V5ExecHeader.load(data); uint tmp; assembly { tmp := data.offset } // uint old_balance = IERC20(uint(h.targetArrInd).loadTokenFromArrayV4(h.tokensOffset + tmp)).balanceOf(msg.sender); if (h.fromInput) { ind = execFromInputExternalHandler(h, ind_, data); } else { // ind = execFromOutputExternalHandler(h, ind_, data); revert("execFromOutput is not implemented"); } // uint new_balance = IERC20(uint(h.targetArrInd).loadTokenFromArrayV4(h.tokensOffset + tmp)).balanceOf(msg.sender); // console.log("balance diff: ", new_balance - old_balance); current_caller = address(0); } function execFromInputExternalHandler(V5ExecHeader.Header memory h, uint ind_, bytes calldata data) internal returns (uint ind) { V5ExecState.V5ExecState memory st = h.newState(); ind = ind_; { uint tmp; assembly { tmp := data.offset } if (st.header.doAcquireInputERC20Token) { if (uint256(st.header.sourceArrInd).loadTokenFromArrayV4(st.header.tokensOffset + tmp) == Addrs.WETH9) { if (st.msgValueLeft > 0) { WETH9(Addrs.WETH9).deposit{value: st.msgValueLeft}(); st.balances[st.header.sourceArrInd] += st.msgValueLeft; st.msgValueLeft = 0; } } else { revert('doAcquireInputERC20Token: only WETH9 tokens are supported'); } } } while (st.callCounter < st.header.numOfCalls) { uint calltype = ind.loadUint8(); ind++; //// console.log("i: ", st.callCounter, " | calltype: ", calltype); if (calltype == 1) { // transfer to univ2-like pair and swap V5CallType_basic_lib.CallType_basic_vars memory basic_vars; { uint tmp; assembly { tmp := data.offset } ind = basic_vars.load(ind, st.header.tokensOffset + tmp, st.header.tokensNum); } V5CallType_1_extra_lib.do_1_FromInput(basic_vars, st); } else if (calltype == 5) { // univ3 V5CallType_5_lib.CallType_5_vars memory vars; { uint tmp; assembly { tmp := data.offset } ind = vars.load(ind, st.header.tokensOffset + tmp, st.header.tokensNum); } vars.prepare(st); callback_to_check = vars.univ3_pool; vars.doItFromInput(st, data); callback_to_check = address(0x0); vars.afterFromInput(st); } else if (calltype == 6) { // balancer V5CallType_6_lib.CallType_6_vars memory vars; { uint tmp; assembly { tmp := data.offset } ind = vars.load(ind, st.header.tokensOffset + tmp, st.header.tokensNum); } vars.prepare(st); vars.doItFromInput(st); // vars.afterFromInput(st); } else if (calltype == 7) { // curve V5CallType_7_lib.CallType_7_vars memory vars; { uint tmp; assembly { tmp := data.offset } ind = vars.load(ind, st.header.tokensOffset + tmp, st.header.tokensNum); } vars.prepare(st); vars.doItFromInput(st); // vars.afterFromInput(st); } else { revert("CT"); } st.callCounter++; } // console.log('st.totals[st.header.targetArrInd]:', st.totals[st.header.targetArrInd]); // console.log('treshold:', st.expected[st.header.targetArrInd] * (SLIPPAGE_LIMIT - st.header.slippage)/SLIPPAGE_LIMIT); require(st.totals[st.header.targetArrInd] > st.expected[st.header.targetArrInd] * (SLIPPAGE_LIMIT - st.header.slippage)/SLIPPAGE_LIMIT, "slippage is above the threshold"); uint tmp; assembly { tmp := data.offset } if (uint256(st.header.targetArrInd).loadTokenFromArrayV4(st.header.tokensOffset + tmp) == Addrs.WETH9) { if (st.header.getNativeETH) { if (st.ethAmountToUnwrap > 0) { // console.log('WETH9.balanceOf:', IERC20(Addrs.WETH9).balanceOf(address(this))); // console.log('st.ethAmountToUnwrap:', st.ethAmountToUnwrap); WETH9(Addrs.WETH9).withdraw(st.ethAmountToUnwrap); } payable(msg.sender).call{value: (st.ethAmountToUnwrap + st.balances[st.header.targetArrInd])}(""); } else { TransferHelper.safeTransfer(Addrs.WETH9, msg.sender, st.balances[st.header.targetArrInd]); } } else { if (st.balances[st.header.targetArrInd] != 0) { TransferHelper.safeTransfer(uint256(st.header.targetArrInd).loadTokenFromArrayV4(st.header.tokensOffset + tmp), msg.sender, st.balances[st.header.targetArrInd]); } } } struct UniswapV3SwapCallbackData { address tokenIn; address tokenOut; uint amountIn; uint amountOut; // address payer; } function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata _data ) external isLocked() isCallbackChecked() override { require(amount0Delta > 0 || amount1Delta > 0, 'zero amounts'); // swaps entirely within 0-liquidity regions are not supported // console.log("amount0Delta:"); // console.logInt(amount0Delta); // console.log("amount1Delta"); // console.logInt(amount1Delta); // (V5ExecState.V5ExecState memory st, V5CallType_5_lib.CallType_5_vars memory vars, bytes memory data) = abi.decode(_data, (V5ExecState.V5ExecState, V5CallType_5_lib.CallType_5_vars, bytes)); // console.log("CT_5: st.callCounter:", st.callCounter); (address tokenIn, address tokenOut, bool isNative, bool fromSender) = abi.decode(_data, (address, address, bool, bool)); (uint amountIn, uint amountOut) = tokenIn < tokenOut ? ( uint256(amount0Delta), uint256(-amount1Delta) ) : ( uint256(amount1Delta), uint256(-amount0Delta) ); // V5Utils.pay(tokenIn, fromSender ? current_caller : address(this), msg.sender, amountIn); if (fromSender) { TransferHelper.safeTransferFrom(tokenIn, current_caller, msg.sender, amountIn); } else { if (isNative) { WETH9(Addrs.WETH9).deposit{value: amountIn}(); } TransferHelper.safeTransfer(tokenIn, msg.sender, amountIn); } } fallback() external payable { // console.log('get paid'); } }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; library Addrs { address internal constant UNISWAP_V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; // ON ETHER OR EVERYWHERE ? address internal constant UNISWAP_V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984; // ON ETHER address internal constant SUSHI_FACTORY = 0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac; // ON ETHER address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // ON ETHER from v3-periphery address internal constant BALANCER_VAULT = 0xBA12222222228d8Ba445958a75a0704d566BF2C8; address internal constant CURVE_USDT_WBTC_WETH_POOL = 0xD51a44d3FaE010294C616388b506AcdA1bfAAE46; address internal constant CURVE_DAI_USDC_USDT_POOL = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7; // address internal constant SUSHI_FACTORY = 0xc35DADB65012eC5796536bD9864eD8773aBc74C4; // ON MOVR // address internal constant ANYSWAP_ETH_TO_MOVR_BRIDGE = 0x10c6b61DbF44a083Aec3780aCF769C77BE747E23; // address internal constant ANYCALLPROXY_ON_ETHER = 0x37414a8662bC1D25be3ee51Fb27C2686e2490A89; } library Selectors { bytes4 internal constant UNISWAP_V2_GETPAIR_SELECTOR = bytes4(keccak256("getPair(address,address)")); bytes4 internal constant UNISWAP_V2_GETRESERVES_SELECTOR = bytes4(keccak256("getReserves()")); bytes4 internal constant UNISWAP_V2_PAIR_SWAP_SELECTOR = bytes4(keccak256("swap(uint256,uint256,address,bytes)")); uint internal constant SLIPPAGE_LIMIT = 200; // bytes4 internal constant ANYCALLPROXY_ANYCALL_SELECTOR = bytes4(keccak256("anyCall(address,bytes,address,uint256)")); bytes4 internal constant TRANSFER_SELECTOR = bytes4(keccak256("transfer(address,uint256)")); bytes4 internal constant TRANSFERFROM_SELECTOR = bytes4(keccak256("transferFrom(address,address,uint256)")); bytes4 internal constant BALANCEOF_SELECTOR = bytes4(keccak256("balanceOf(address)")); bytes4 internal constant ALLOWANCE_SELECTOR = bytes4(keccak256("allowance(address,address)")); }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; //import "../libraries/openzeppelin-contracts/contracts/utils/math/SafeMath.sol"; library CalldataLoader { // using SafeMath for uint; function loadUint8(uint self) pure internal returns (uint x) { assembly { x := shr(248, calldataload(self)) } } function loadUint16(uint self) pure internal returns (uint x) { assembly { x := shr(240, calldataload(self)) } } function loadUint24(uint self) pure internal returns (uint x) { assembly { x := shr(232, calldataload(self)) } } function loadUint256(uint self) pure internal returns (uint x) { assembly { x := calldataload(self) } } function loadAddress(uint self) pure internal returns (address x) { assembly { x := shr(96, calldataload(self)) // 12 * 8 = 96 } } function loadTokenFromArray(uint self) pure internal returns (address x) { assembly { x := shr(96, calldataload(add(73, mul(20, self)))) // 73 = 68 + 5 } } function loadTokenFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (address x) { assembly { x := shr(96, calldataload(add(start_ind, mul(20, arr_idx)))) } } // function loadTotalsFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { // assembly { // x := calldataload(add(start_ind, mul(32, arr_idx))) // } // } // function loadExpectedFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { // assembly { // x := calldataload(add(start_ind, mul(32, arr_idx))) // } // } // function loadBalancesFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { // assembly { // x := calldataload(add(start_ind, mul(32, arr_idx))) // } // } function loadVariableUint(uint self, uint len) pure internal returns (uint x) { uint extra = (uint(32) - len) << 3; assembly { x := shr(extra, calldataload(self)) } } } //library BytesLoader { //// using SafeMath for uint; // // function mloadUint8(uint self) pure internal returns (uint x) { // assembly { // x := shr(248, mload(self)) // } // } // function mloadUint16(uint self) pure internal returns (uint x) { // assembly { // x := shr(240, mload(self)) // } // } // function mloadUint24(uint self) pure internal returns (uint x) { // assembly { // x := shr(232, mload(self)) // } // } // function mloadUint256(uint self) pure internal returns (uint x) { // assembly { // x := mload(self) // } // } // function mloadAddress(uint self) pure internal returns (address x) { // assembly { // x := shr(96, mload(self)) // 12 * 8 = 96 // } // } //// function mloadTokenFromArray(uint self) pure internal returns (address x) { //// assembly { //// x := shr(96, mload(add(73, mul(20, self)))) // 73 = 68 + 5 //// } //// } // function mloadTokenFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (address x) { // assembly { // x := shr(96, mload(add(start_ind, mul(20, arr_idx)))) // } // } //// function mloadTotalsFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { //// assembly { //// x := mload(add(start_ind, mul(32, arr_idx))) //// } //// } //// function mtopUpTotalsAtArrayV4(uint arr_idx, uint start_ind, uint extra) pure internal returns (uint x) { //// uint addr = start_ind + arr_idx * 32; //// uint v; //// assembly { //// v := mload(addr) //// } //// v += extra; //// assembly { //// mstore(addr, v) //// } //// } //// function mloadExpectedFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { //// assembly { //// x := mload(add(start_ind, mul(32, arr_idx))) //// } //// } //// function mtopUpExpectedAtArrayV4(uint arr_idx, uint start_ind, uint extra) pure internal returns (uint x) { //// uint addr = start_ind + arr_idx * 32; //// uint v; //// assembly { //// v := mload(addr) //// } //// v += extra; //// assembly { //// mstore(addr, v) //// } //// } //// function mloadBalancesFromArrayV4(uint arr_idx, uint start_ind) pure internal returns (uint x) { //// assembly { //// x := mload(add(start_ind, mul(32, arr_idx))) //// } //// } //// function mtopUpBalancesAtArrayV4(uint arr_idx, uint start_ind, uint extra) pure internal returns (uint x) { //// uint addr = start_ind + arr_idx * 32; //// uint v; //// assembly { //// v := mload(addr) //// } //// v += extra; //// assembly { //// mstore(addr, v) //// } //// } //// function mwithdrawBalancesAtArrayV4(uint arr_idx, uint start_ind, uint extra) pure internal returns (uint x) { //// uint addr = start_ind + arr_idx * 32; //// uint v; //// assembly { //// v := mload(addr) //// } //// v -= extra; //// assembly { //// mstore(addr, v) //// } //// } //// function mtopUpTotalFrom(uint ind, uint extra) pure internal returns (uint x) { //// uint v; //// assembly { //// v := mload(ind) //// } //// v += extra; //// assembly { //// mstore(ind, v) //// } //// } // function mloadVariableUint(uint self, uint len) pure internal returns (uint x) { // uint extra = (uint(32) - len) << 3; // assembly { // x := shr(extra, mload(self)) // } // } //}
//SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.0; import "hardhat/console.sol"; //import "./libraries/BytesLib.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; //import "../libraries/openzeppelin-contracts/contracts/utils/math/SafeMath.sol"; import "../libraries/v2-core/contracts/interfaces/IUniswapV2Callee.sol"; import "../libraries/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; import "../libraries/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "../libraries/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; //import "../libraries/v2-core/contracts/interfaces/IERC20.sol"; //import "../libraries/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; //import "../libraries/openzeppelin-contracts/contracts/interfaces/IERC2612.sol"; //import "./libraries/anyswap-v1-core/contracts/AnyswapV5CallProxy.sol"; //import "../libraries/v3-core/contracts/libraries/TickMath.sol"; import "./TickMath_0.8.sol"; import "../libraries/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; import "./interfaces/IWETH9.sol"; import "../libraries/TransferHelper.sol"; import "./interfaces/IVault.sol"; import "./CalldataLoader.sol"; import "./ETHRouter_V5_types.sol"; import "./addrs_and_selectors.sol"; library V5CallType_basic_lib { using CalldataLoader for uint; struct CallType_basic_vars { uint flags; uint token_source_ind; uint token_target_ind; address token_source; address token_target; uint amount_in_expected; uint amount_out_expected; uint amount_to_be_sent; uint amount_out; } using V5CallType_basic_lib for CallType_basic_vars; uint internal constant CT_BASIC_FROM_SENDER = 1; uint internal constant CT_BASIC_TO_SENDER = 2; function load(CallType_basic_vars memory self, uint ind, uint tokens_start_ind, uint tokens_num) internal pure returns(uint new_ind) { self.flags = ind.loadUint8(); ind++; //// console.log("self.flags:", self.flags); self.token_source_ind = ind.loadUint8();// = uint8(data[ind]); ind++; //// console.log("self.token_source_ind:", self.token_source_ind); require(self.token_source_ind < tokens_num, "1LSI"); self.token_source = self.token_source_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_source:", self.token_source); self.token_target_ind = ind.loadUint8(); //= uint8(data[ind]); ind++; //// console.log("self.token_target_ind:", self.token_target_ind); require(self.token_target_ind < tokens_num, "1LTI"); self.token_target = self.token_target_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_target:", self.token_target); { uint amount_in_len = ind.loadUint8();// = uint(uint8(data[ind])); ind++; self.amount_in_expected = ind.loadVariableUint(amount_in_len); ind += amount_in_len; //// console.log("self.amount_in_expected:", self.amount_in_expected); } { uint amount_out_len = ind.loadUint8(); ind++; self.amount_out_expected = ind.loadVariableUint(amount_out_len); ind += amount_out_len; //// console.log("self.amount_out_expected:", self.amount_out_expected); } return ind; } } library V5CallType_1_extra_lib { using CalldataLoader for uint; uint internal constant CT_1_UNISWAP_OR_SUSHISWAP = 4; // false == uniswap, true == sushiswap uint internal constant CT_1_SUSHISWAP = 4; function do_1_FromInput(V5CallType_basic_lib.CallType_basic_vars memory self, V5ExecState.V5ExecState memory st) internal { if (self.token_source_ind == st.header.sourceArrInd) { self.amount_to_be_sent = self.amount_in_expected; } else { self.amount_to_be_sent = ((self.amount_in_expected * st.totals[self.token_source_ind]) / st.expected[self.token_source_ind]); } address v2pair; { address factory = (self.flags & CT_1_SUSHISWAP) > 0 ? Addrs.SUSHI_FACTORY : Addrs.UNISWAP_V2_FACTORY ; (address t0, address t1) = self.token_source < self.token_target ? (self.token_source, self.token_target) : (self.token_target, self.token_source) ; v2pair = IUniswapV2Factory(factory).getPair(t0, t1); } (uint112 reserve_0, uint112 reserve_1, ) = IUniswapV2Pair(v2pair).getReserves(); uint amount_out = self.token_source < self.token_target ? calcUniswapV2Out(reserve_0, reserve_1, self.amount_to_be_sent) : calcUniswapV2Out(reserve_1, reserve_0, self.amount_to_be_sent) ; if (amount_out == 0) { return; } if (self.token_source_ind == st.header.sourceArrInd) { if (st.header.doAcquireInputERC20Token) { TransferHelper.safeTransfer(self.token_source, v2pair, self.amount_to_be_sent); st.balances[self.token_source_ind] -= self.amount_to_be_sent; } else { if (self.token_source == Addrs.WETH9) { if (st.msgValueLeft >= self.amount_to_be_sent) { WETH9(Addrs.WETH9).deposit{value: self.amount_to_be_sent}(); TransferHelper.safeTransfer(self.token_source, v2pair, self.amount_to_be_sent); st.msgValueLeft -= self.amount_to_be_sent; } else { revert('CT1: msg.value insufficient'); } } else { TransferHelper.safeTransferFrom(self.token_source, msg.sender, v2pair, self.amount_to_be_sent); } } } else { TransferHelper.safeTransfer(self.token_source, v2pair, self.amount_to_be_sent); st.balances[self.token_source_ind] -= self.amount_to_be_sent; } // V5Utils.pay(self.token_source, (self.token_source_ind != st.header.sourceArrInd || (self.token_source == Addrs.WETH9 && msg.value != 0) || st.header.doPrefetchInputToken) ? address(this) : msg.sender, v2pair, self.amount_to_be_sent); (uint256 a0, uint256 a1) = (self.token_source < self.token_target) ? (uint256(0), amount_out) : (amount_out, uint256(0)) ; IUniswapV2Pair(v2pair).swap(a0, a1, (self.token_target_ind != st.header.targetArrInd || (self.token_target == Addrs.WETH9 && st.header.getNativeETH)) ? address(this): msg.sender, new bytes(0)); // if (self.token_source_ind == st.header.sourceArrInd) { // if (self.token_source == Addrs.WETH9 && msg.value != 0 || st.header.doAcquireInputERC20Token) { // st.balances[self.token_source_ind] -= self.amount_to_be_sent; // } // } else { // st.balances[self.token_source_ind] -= self.amount_to_be_sent; // } if (self.token_target_ind == st.header.targetArrInd) { if (self.token_target == Addrs.WETH9 && st.header.getNativeETH) { st.ethAmountToUnwrap += amount_out; } } else { st.balances[self.token_target_ind] += amount_out; } // if (self.token_target_ind == st.header.targetArrInd && self.token_target == Addrs.WETH9 && st.header.getNativeEth) { // st.ethAmountToUnwrap += amount_out; // } st.totals[self.token_target_ind] += amount_out; st.expected[self.token_target_ind] += self.amount_out_expected; } function calcUniswapV2Out(uint r0, uint r1, uint a0) pure private returns (uint a1) { uint numer = r1 * a0 * 997; uint denom = r0 * 1000 + a0 * 997; a1 = numer / denom; // to round down } } library V5CallType_6_lib { using CalldataLoader for uint; // using BytesLoader for uint; struct CallType_6_vars { uint flags; uint token_source_ind; uint token_target_ind; address token_source; address token_target; uint amount_in_expected; uint amount_out_expected; bytes32 balancer_pool_id; uint amount_to_be_sent; uint amount_out; bool isNative; } using V5CallType_6_lib for CallType_6_vars; uint internal constant CT_6_FROM_SENDER = 1; uint internal constant CT_6_TO_SENDER = 2; function load(CallType_6_vars memory self, uint ind, uint tokens_start_ind, uint tokens_num) internal pure returns (uint new_ind) { self.flags = ind.loadUint8(); ind++; //// console.log("self.flags:", self.flags); self.token_source_ind = ind.loadUint8();// = uint8(data[ind]); ind++; //// console.log("self.token_source_ind:", self.token_source_ind); require(self.token_source_ind < tokens_num, "1LSI"); self.token_source = self.token_source_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_source:", self.token_source); self.token_target_ind = ind.loadUint8(); //= uint8(data[ind]); ind++; //// console.log("self.token_target_ind:", self.token_target_ind); require(self.token_target_ind < tokens_num, "1LTI"); self.token_target = self.token_target_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_target:", self.token_target); { uint amount_in_len = ind.loadUint8();// = uint(uint8(data[ind])); ind++; self.amount_in_expected = ind.loadVariableUint(amount_in_len); ind += amount_in_len; //// console.log("self.amount_in_expected:", self.amount_in_expected); } { uint amount_out_len = ind.loadUint8(); ind++; self.amount_out_expected = ind.loadVariableUint(amount_out_len); ind += amount_out_len; //// console.log("self.amount_out_expected:", self.amount_out_expected); } self.balancer_pool_id = bytes32(ind.loadUint256()); ind += 32; // console.log('pool_id:'); // console.logBytes32(self.balancer_pool_id); return ind; } function prepare(CallType_6_vars memory self, V5ExecState.V5ExecState memory st) internal { if (self.token_source_ind == st.header.sourceArrInd) { self.amount_to_be_sent = self.amount_in_expected; if (st.header.doAcquireInputERC20Token) { TransferHelper.safeApprove(self.token_source, Addrs.BALANCER_VAULT, self.amount_to_be_sent); st.balances[self.token_source_ind] -= self.amount_to_be_sent; self.isNative = false; } else { if (self.token_source == Addrs.WETH9) { if (st.msgValueLeft >= self.amount_to_be_sent) { self.isNative = true; st.msgValueLeft -= self.amount_to_be_sent; } else { revert('CT6: msg.value insufficient'); } } else { TransferHelper.safeTransferFrom(self.token_source, msg.sender, address(this), self.amount_to_be_sent); TransferHelper.safeApprove(self.token_source, Addrs.BALANCER_VAULT, self.amount_to_be_sent); self.isNative = false; } } } else { self.amount_to_be_sent = (self.amount_in_expected * st.totals[self.token_source_ind]) / st.expected[self.token_source_ind]; TransferHelper.safeApprove(self.token_source, Addrs.BALANCER_VAULT, self.amount_to_be_sent); self.isNative = false; st.balances[self.token_source_ind] -= self.amount_to_be_sent; } } function doItFromInput(CallType_6_vars memory self, V5ExecState.V5ExecState memory st) internal { // console.log('pool_id:'); // console.logBytes32(self.balancer_pool_id); // console.log('self.amount_to_be_sent:', self.amount_to_be_sent); (IAsset assetOut, address payable recipient) = self.token_target_ind == st.header.targetArrInd ? (self.token_target == Addrs.WETH9 && st.header.getNativeETH ? ((self.flags & CT_6_TO_SENDER > 0) ? (IAsset(address(0x0)), payable(msg.sender)) : (IAsset(self.token_target), payable(address(this)))) : (IAsset(self.token_target), payable(msg.sender)) ) : (IAsset(self.token_target), payable(address(this))) ; uint256 output = IVault(Addrs.BALANCER_VAULT).swap{value: self.isNative ? self.amount_to_be_sent : 0}(IVault.SingleSwap({ poolId: self.balancer_pool_id, //bytes32 poolId; kind: IVault.SwapKind.GIVEN_IN, //SwapKind kind; // assetIn: IAsset(self.token_source == Addrs.WETH9 ? address(0x0) : self.token_source), //IAsset assetIn; assetIn: IAsset(self.isNative ? address(0x0) : self.token_source), //IAsset assetIn; // assetOut: IAsset(self.token_target == Addrs.WETH9 ? address(0x0) : self.token_target), //IAsset assetOut; assetOut: assetOut, //IAsset(self.token_target), //IAsset assetOut; amount: self.amount_to_be_sent,//uint256 amount; userData: new bytes(0) //bytes userData; }), IVault.FundManagement({ sender: address(this), //address sender; fromInternalBalance: false, // bool fromInternalBalance; recipient: recipient, // self.token_target == Addrs.WETH9 && st.header.getNativeETH ? self.flags & CT_6_TO_SENDER > 0 ? payable(msg.sender) : payable(address(this)), //address payable recipient; toInternalBalance: false //bool toInternalBalance; }), 0, block.timestamp + 1000 ); // if (self.token_source_ind != st.header.sourceArrInd || (self.token_source == Addrs.WETH9 && (msg.value != 0 || st.header.doPrefetchInputToken))) { // st.balances[self.token_source_ind] -= self.amount_to_be_sent; // } if (self.token_target_ind == st.header.targetArrInd) { // st.totalOutput += output; if (self.token_target == Addrs.WETH9 && st.header.getNativeETH && self.flags & CT_6_TO_SENDER == 0) { // !!!!! FLAG VAR for flexability st.ethAmountToUnwrap += output; } else { // skip } } else { st.balances[self.token_target_ind] += output; } st.totals[self.token_target_ind] += output; st.expected[self.token_target_ind] += self.amount_out_expected; self.amount_out = output; } // function afterFromInput(CallType_6_vars memory self, V5ExecState.V5ExecState memory st) internal { //// if (self.flags & CT_6_TO_SENDER > 0) { //// TransferHelper.safeTransfer(self.token_target, msg.sender, self.amount_out); ////// st.totalTo += uint128(self.amount_out); //// } // } } library V5CallType_7_lib { // using SafeMath for uint; using CalldataLoader for uint; // using BytesLoader for uint; struct CallType_7_vars { uint flags; uint token_source_ind; uint token_target_ind; address token_source; address token_target; uint amount_in_expected; uint amount_out_expected; address curve_pool; uint curve_pool_source_ind; uint curve_pool_target_ind; uint amount_to_be_sent; uint amount_out; bool isNative; } using V5CallType_7_lib for CallType_7_vars; uint internal constant CT_7_FROM_SENDER = 1; uint internal constant CT_7_TO_SENDER = 2; function load(CallType_7_vars memory self, uint ind, uint tokens_start_ind, uint tokens_num) internal pure returns (uint new_ind) { self.flags = ind.loadUint8(); ind++; //// console.log("self.flags:", self.flags); self.token_source_ind = ind.loadUint8();// = uint8(data[ind]); ind++; //// console.log("self.token_source_ind:", self.token_source_ind); require(self.token_source_ind < tokens_num, "1LSI"); self.token_source = self.token_source_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_source:", self.token_source); self.token_target_ind = ind.loadUint8(); //= uint8(data[ind]); ind++; //// console.log("self.token_target_ind:", self.token_target_ind); require(self.token_target_ind < tokens_num, "1LTI"); self.token_target = self.token_target_ind.loadTokenFromArrayV4(tokens_start_ind); //// console.log("self.token_target:", self.token_target); { uint amount_in_len = ind.loadUint8();// = uint(uint8(data[ind])); ind++; self.amount_in_expected = ind.loadVariableUint(amount_in_len); ind += amount_in_len; //// console.log("self.amount_in_expected:", self.amount_in_expected); } { uint amount_out_len = ind.loadUint8(); ind++; self.amount_out_expected = ind.loadVariableUint(amount_out_len); ind += amount_out_len; //// console.log("self.amount_out_expected:", self.amount_out_expected); } self.curve_pool = ind.loadAddress(); ind += 20; self.curve_pool_source_ind = ind.loadUint8(); ind++; self.curve_pool_target_ind = ind.loadUint8(); ind++; return ind; } function prepare(CallType_7_vars memory self, V5ExecState.V5ExecState memory st) internal { if (self.token_source_ind == st.header.sourceArrInd) { self.amount_to_be_sent = self.amount_in_expected; if (st.header.doAcquireInputERC20Token) { TransferHelper.safeApprove(self.token_source, self.curve_pool, self.amount_to_be_sent); self.isNative = false; st.balances[self.token_source_ind] -= self.amount_to_be_sent; } else { if (self.token_source == Addrs.WETH9) { if (st.msgValueLeft >= self.amount_to_be_sent) { self.isNative = true; st.msgValueLeft -= self.amount_to_be_sent; } else { revert('CT7: msg.value insufficient'); } } else { TransferHelper.safeTransferFrom(self.token_source, msg.sender, address(this), self.amount_to_be_sent); TransferHelper.safeApprove(self.token_source, self.curve_pool, self.amount_to_be_sent); self.isNative = false; } } } else { self.amount_to_be_sent = (self.amount_in_expected * st.totals[self.token_source_ind]) / st.expected[self.token_source_ind]; TransferHelper.safeApprove(self.token_source, self.curve_pool, self.amount_to_be_sent); self.isNative = false; st.balances[self.token_source_ind] -= self.amount_to_be_sent; } } function doItFromInput(CallType_7_vars memory self, V5ExecState.V5ExecState memory st) internal returns (bool res) { // console.log('self.token_target:', self.token_target); uint balanceBefore; uint balanceAfter; if (self.curve_pool == Addrs.CURVE_USDT_WBTC_WETH_POOL) { if (self.token_target == Addrs.WETH9 && self.token_target_ind == st.header.targetArrInd && st.header.getNativeETH) { balanceBefore = address(this).balance; CurvePool_USDT_WBTC_WETH(self.curve_pool).exchange(self.curve_pool_source_ind, self.curve_pool_target_ind, self.amount_to_be_sent, 0, true); balanceAfter = address(this).balance; } else { balanceBefore = IERC20(self.token_target).balanceOf(address(this)); CurvePool_USDT_WBTC_WETH(self.curve_pool).exchange{value: self.isNative ? self.amount_to_be_sent : 0}(self.curve_pool_source_ind, self.curve_pool_target_ind, self.amount_to_be_sent, 0, self.isNative); balanceAfter = IERC20(self.token_target).balanceOf(address(this)); } } else if (self.curve_pool == Addrs.CURVE_DAI_USDC_USDT_POOL) { balanceBefore = IERC20(self.token_target).balanceOf(address(this)); CurvePool_DAI_USDC_USDT(self.curve_pool).exchange(int128(uint128(self.curve_pool_source_ind)), int128(uint128(self.curve_pool_target_ind)), self.amount_to_be_sent, 0); balanceAfter = IERC20(self.token_target).balanceOf(address(this)); } else { revert('unsupported CurvePool'); } uint diff = balanceAfter - balanceBefore; // sent in the aftermath self.amount_out = diff; // console.log('diff:', diff); // if (self.token_source_ind != st.header.sourceArrInd || (self.token_source == Addrs.WETH9 && (msg.value != 0 || st.header.doPrefetchInputToken))) { // st.balances[self.token_source_ind] -= self.amount_to_be_sent; // } st.balances[self.token_target_ind] += diff; st.totals[self.token_target_ind] += diff; // console.log('self.token_target_ind:', self.token_target_ind); st.expected[self.token_target_ind] += self.amount_out_expected; } // function afterFromInput(CallType_7_vars memory self, V5ExecState.V5ExecState memory st) internal { // if (self.isNative) { // // } else { // } // if (self.flags & CT_7_TO_SENDER > 0) { // TransferHelper.safeTransfer(self.token_target, msg.sender, self.amount_out); //// st.totalTo += uint128(self.amount_out); // } // } } interface CurvePool_DAI_USDC_USDT { function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external; } interface CurvePool_USDT_WBTC_WETH { function coins(uint256 i) external returns(address); function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy, bool use_eth) external payable; } interface WETH9 { function deposit() external payable; function withdraw(uint256 amount) external; } library V5CallType_5_lib { // using SafeMath for uint; using CalldataLoader for uint; // using BytesLoader for uint; struct CallType_5_vars { uint flags; uint token_source_ind; uint token_target_ind; uint pool_fee; uint amount_in_expected; uint amount_out_expected; int specifiedAmount; bool isNative; bool fromSender; address token_source; address token_target; address univ3_pool; int dsa; int dta; } uint internal constant CT_5_FROM_SENDER = 1; uint internal constant CT_5_TO_SENDER = 2; function load(CallType_5_vars memory self, uint ind, uint tokens_start_ind, uint tokens_num) internal view returns(uint new_ind) { self.flags = ind.loadUint8(); ind++; // console.log("flags:", self.flags); self.token_source_ind = ind.loadUint8(); ind++; // console.log("self.token_source_ind:", self.token_source_ind); require(self.token_source_ind < tokens_num, "5SI"); self.token_source = self.token_source_ind.loadTokenFromArrayV4(tokens_start_ind); self.token_target_ind = ind.loadUint8(); ind++; require(self.token_target_ind < tokens_num, "5TI"); self.token_target = self.token_target_ind.loadTokenFromArrayV4(tokens_start_ind); self.pool_fee = ind.loadUint24(); // console.log("pool_fee:", self.pool_fee); ind += 3; { uint amount_in_len = ind.loadUint8(); ind++; self.amount_in_expected = ind.loadVariableUint(amount_in_len); ind += amount_in_len; } { uint amount_out_len = ind.loadUint8(); ind++; self.amount_out_expected = ind.loadVariableUint(amount_out_len); ind += amount_out_len; } // console.log("token_source:", self.token_source); // console.log("token_target:", self.token_target); // console.log("pool_fee:", self.pool_fee); // console.log("amount_in_expected:", self.amount_in_expected); // console.log("amount_out_expected:", self.amount_out_expected); return ind; } function prepare(CallType_5_vars memory self, V5ExecState.V5ExecState memory st) internal { self.univ3_pool = IUniswapV3Factory(Addrs.UNISWAP_V3_FACTORY).getPool(self.token_source, self.token_target, uint24(self.pool_fee)); // console.log("univ3_pool:", self.univ3_pool); require(self.univ3_pool != address(0), '5ZPA'); if (self.token_source_ind == st.header.sourceArrInd) { self.specifiedAmount = int256(self.amount_in_expected); if (st.header.doAcquireInputERC20Token) { self.isNative == false; self.fromSender = false; st.balances[self.token_source_ind] -= uint(self.specifiedAmount); } else { if (self.token_source == Addrs.WETH9) { if (st.msgValueLeft >= uint256(self.specifiedAmount)) { self.isNative = true; self.fromSender = false; st.msgValueLeft -= uint256(self.specifiedAmount); } else { revert('CT5: msg.value insufficient'); } } else { self.isNative = false; self.fromSender = true; } } } else { self.specifiedAmount = int256((self.amount_in_expected * st.totals[self.token_source_ind]) / st.expected[self.token_source_ind]); self.isNative = false; self.fromSender = false; st.balances[self.token_source_ind] -= uint256(self.specifiedAmount); } } function doItFromInput(CallType_5_vars memory self, V5ExecState.V5ExecState memory st, bytes calldata data) internal { // self.univ3_pool = IUniswapV3Factory(Addrs.UNISWAP_V3_FACTORY).getPool(self.token_source, self.token_target, uint24(self.pool_fee)); //// console.log("univ3_pool:", self.univ3_pool); // require(self.univ3_pool != address(0), '5ZPA'); bool zeroForOne = self.token_source < self.token_target; { // if (self.flags & V5CallType_5_lib.CT_5_FROM_SENDER != 0) { // st.totalFrom += uint128(self.amount_in_expected); //// console.log("amount from msg.sender:", self.amount_in_expected); // self.specifiedAmount = int256(self.amount_in_expected); // } else { // self.specifiedAmount = int256((self.amount_in_expected * st.totals[self.token_source_ind]) / st.expected[self.token_source_ind]); // } // console.log("specifiedAmount:"); // console.logInt(self.specifiedAmount); // console.log("total: ", st.totals[self.token_target_ind]); // console.log("expected: ", st.expected[self.token_target_ind]); // console.log("recipient: ", (self.flags & V5CallType_5_lib.CT_5_TO_SENDER) == 0 ? address(this) : st.msgsender); try IUniswapV3Pool(self.univ3_pool).swap( // (self.flags & V5CallType_5_lib.CT_5_TO_SENDER) == 0 ? address(this) : st.msgsender , (self.token_target_ind != st.header.targetArrInd || (self.token_target == Addrs.WETH9 && st.header.getNativeETH)) ? address(this) : msg.sender, zeroForOne, self.specifiedAmount, zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, // abi.encode(st, self, data) abi.encode(self.token_source, self.token_target, self.isNative, self.fromSender) ) returns (int256 da0, int256 da1) { if (zeroForOne) { (self.dsa, self.dta) = (da0, da1); } else { (self.dsa, self.dta) = (da1, da0); } } catch Error(string memory s) { // console.log("transfer failed"); //// console.log("expected balance: ", value_to_pay); // console.log("actual balance: ", uint256(st.balances[self.token_source_ind])); revert(s); } } } function afterFromInput(CallType_5_vars memory self, V5ExecState.V5ExecState memory st) internal { // console.log('dsa'); // console.logInt(self.dsa); // console.log('dta'); // console.logInt(self.dta); // if (self.token_source_ind != st.header.sourceArrInd || msg.value != 0 || st.header.doPrefetchInputToken) { // st.balances[self.token_source_ind] -= uint256(self.dsa); // } if (self.specifiedAmount < self.dsa) { uint diff = uint256(self.dsa - self.specifiedAmount); if (self.token_source_ind == st.header.sourceArrInd) { if (st.header.doAcquireInputERC20Token) { st.balances[self.token_source_ind] -= diff; } else { if (self.token_source == Addrs.WETH9) { if (st.msgValueLeft >= diff) { st.msgValueLeft -= diff; } else { revert('CT5: msg.value insufficient (after)'); } } else { // skip } } } else { st.balances[self.token_source_ind] -= diff; } } if (self.token_target_ind == st.header.targetArrInd) { if (self.token_target == Addrs.WETH9 && st.header.getNativeETH) { st.ethAmountToUnwrap += uint256(-self.dta); // st.balances[st.token_target_ind] += uint256(-self.dta); // in case of ETH target, balance logs only the native ETH, i.e. the output of Curve only } } else { st.balances[self.token_target_ind] += uint256(-self.dta); } st.totals[self.token_target_ind] += uint256(-self.dta); st.expected[self.token_target_ind] += self.amount_out_expected; } } library V5ExecHeader { using CalldataLoader for uint; struct Header { uint8 slippage; uint8 tokensNum; uint8 numOfCalls; uint8 sourceArrInd; uint8 targetArrInd; bool fromInput; uint32 callArrOffset; uint32 tokensOffset; bool getNativeETH; bool doAcquireInputERC20Token; } function load(bytes calldata cdata) view internal returns (Header memory h, uint ind) { assembly { ind := cdata.offset } { uint _network = ind.loadUint16(); ind += 2; // console.log("_network:", _network); require(_network == 1, "WRONGNETWORK"); uint version = ind.loadUint8(); // console.log("version:", version); ind++; require(version == 5, "WRONGVERSION"); } h.fromInput = ind.loadUint8() > 0; ind++; // console.log("fromInput:", h.fromInput); h.slippage = uint8(ind.loadUint8()); ind++; // console.log("slippage:", h.slippage); h.getNativeETH = bool(ind.loadUint8() != 0); //true; ind++; h.doAcquireInputERC20Token = bool(ind.loadUint8() != 0);//false; ind++; h.sourceArrInd = uint8(ind.loadUint8()); ind++; // console.log("sourceArrInd:", h.sourceArrInd); h.targetArrInd = uint8(ind.loadUint8()); ind++; // console.log("targetArrInd:", h.targetArrInd); h.tokensNum = uint8(ind.loadUint8()); ind++; { uint tmp; assembly { tmp := sub(ind, cdata.offset) } h.tokensOffset = uint32(tmp); } ind += h.tokensNum * 20; h.numOfCalls = uint8(ind.loadUint8());// = uint8(data[ind]); ind++; { uint tmp; assembly { tmp := sub(ind, cdata.offset) } h.callArrOffset = uint32(tmp); } // h.msgValueLeft = msg.value; } function newState(Header memory h) view internal returns(V5ExecState.V5ExecState memory st) { st = V5ExecState.V5ExecState({ totals: new uint256[](h.tokensNum), expected: new uint256[](h.tokensNum), balances: new uint256[](h.tokensNum), // totalFrom: 0, // totalTo: 0, // currentCallOffset: h.callArrOffset, // nextCallOffset: h.callArrOffset, callCounter: 0, msgsender: msg.sender, msgValueLeft: msg.value, ethAmountToUnwrap: 0, header: h }); } } library V5ExecState { struct V5ExecState { uint256[] totals; uint256[] expected; uint256[] balances; // uint256 totalFrom; // uint256 totalTo; // no need for FromInput // uint32 currentCallOffset; // uint32 nextCallOffset; uint callCounter; address msgsender; uint msgValueLeft; uint ethAmountToUnwrap; V5ExecHeader.Header header; } } library V5Utils { function pay( address token, address payer, address recipient, uint256 value ) internal { // console.log("going to pay ... "); if (token == Addrs.WETH9 && address(this).balance >= value) { // pay with WETH9 IWETH9(Addrs.WETH9).deposit{value: value}(); // wrap only what is needed to pay IWETH9(Addrs.WETH9).transfer(recipient, value); } else if (payer == address(this)) { // pay with tokens already in the contract (for the exact input multihop case) // console.log("from router"); // console.log("token:", token); // console.log("value to pay: ", value); // console.log("actual balance: ", IERC20(token).balanceOf(address(this))); // try TransferHelper.safeTransfer(token, recipient, value) { // } catch Error(string memory s) { // value_to_pay = value; // revert(s); // } TransferHelper.safeTransfer(token, recipient, value); } else { // pull payment // console.log("from msg.sender"); // console.log("token:", token); // console.log("payer:", payer); // console.log("value to pay: ", value); // (bool success_, bytes memory b_allowance) = token.staticcall(abi.encodeWithSelector(Selectors.ALLOWANCE_SELECTOR, payer, address(this))); // uint256 allowance = abi.decode(b_allowance, (uint256)); // console.log('token:', token); // console.log('payer:', payer); // console.log('address(this):', address(this)); // console.log("allowance: ", allowance); // console.log('going to trasferFrom'); TransferHelper.safeTransferFrom(token, payer, recipient, value); // console.log("trasfered: ", value); } } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8; interface IVault { function swap( SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline ) external payable returns (uint256); struct SingleSwap { bytes32 poolId; SwapKind kind; IAsset assetIn; IAsset assetOut; uint256 amount; bytes userData; } struct FundManagement { address sender; bool fromInternalBalance; address payable recipient; bool toInternalBalance; } enum SwapKind { GIVEN_IN, GIVEN_OUT } } interface IAsset { // solhint-disable-previous-line no-empty-blocks }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8; import "../../libraries/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; /// @title Interface for WETH9 interface IWETH9 is IERC20 { /// @notice Deposit ether to get wrapped ether function deposit() external payable; /// @notice Withdraw wrapped ether to get ether function withdraw(uint256) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); require(absTick <= uint256(uint24(MAX_TICK)), 'T'); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; assembly { if not(iszero(and(absTick, 0x2))) { ratio := shr(128, mul(ratio, 0xfff97272373d413259a46990580e213a)) } if not(iszero(and(absTick, 0x4))) { ratio := shr(128, mul(ratio, 0xfff2e50f5f656932ef12357cf3c7fdcc)) } if not(iszero(and(absTick, 0x8))) { ratio := shr(128, mul(ratio, 0xffe5caca7e10e4e61c3624eaa0941cd0)) } if not(iszero(and(absTick, 0x10))) { ratio := shr(128, mul(ratio, 0xffcb9843d60f6159c9db58835c926644)) } if not(iszero(and(absTick, 0x20))) { ratio := shr(128, mul(ratio, 0xff973b41fa98c081472e6896dfb254c0)) } if not(iszero(and(absTick, 0x40))) { ratio := shr(128, mul(ratio, 0xff2ea16466c96a3843ec78b326b52861)) } if not(iszero(and(absTick, 0x80))) { ratio := shr(128, mul(ratio, 0xfe5dee046a99a2a811c461f1969c3053)) } if not(iszero(and(absTick, 0x100))) { ratio := shr(128, mul(ratio, 0xfcbe86c7900a88aedcffc83b479aa3a4)) } if not(iszero(and(absTick, 0x200))) { ratio := shr(128, mul(ratio, 0xf987a7253ac413176f2b074cf7815e54)) } if not(iszero(and(absTick, 0x400))) { ratio := shr(128, mul(ratio, 0xf3392b0822b70005940c7a398e4b70f3)) } if not(iszero(and(absTick, 0x800))) { ratio := shr(128, mul(ratio, 0xe7159475a2c29b7443b29c7fa6e889d9)) } if not(iszero(and(absTick, 0x1000))) { ratio := shr(128, mul(ratio, 0xd097f3bdfd2022b8845ad8f792aa5825)) } if not(iszero(and(absTick, 0x2000))) { ratio := shr(128, mul(ratio, 0xa9f746462d870fdf8a65dc1f90e061e5)) } if not(iszero(and(absTick, 0x4000))) { ratio := shr(128, mul(ratio, 0x70d869a156d2a1b890bb3df62baf32f7)) } if not(iszero(and(absTick, 0x8000))) { ratio := shr(128, mul(ratio, 0x31be135f97d08fd981231505542fcfa6)) } if not(iszero(and(absTick, 0x10000))) { ratio := shr(128, mul(ratio, 0x9aa508b5b7a84e1c677de54f3e99bc9)) } if not(iszero(and(absTick, 0x20000))) { ratio := shr(128, mul(ratio, 0x5d6af8dedb81196699c329225ee604)) } if not(iszero(and(absTick, 0x40000))) { ratio := shr(128, mul(ratio, 0x2216e584f5fa1ea926041bedfe98)) } if not(iszero(and(absTick, 0x80000))) { ratio := shr(128, mul(ratio, 0x48a170391f7dc42444e8fa2)) } if gt(tick, 0) { ratio := div(not(0), ratio) } // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent // sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); switch mod(ratio, shl(32, 1)) case 0 { sqrtPriceX96 := and(sub(shr(160, 1), 1), add(shr(32, ratio), 0)) } default { sqrtPriceX96 := and(sub(shr(160, 1), 1), add(shr(32, ratio), 1)) } } } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001;// = log_2 * 255738958999603826347141; // 128.128 number assembly { log_sqrt10001 := mul(log_2, 255738958999603826347141) // 128.128 number } int24 tickLow;// = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi;// = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); assembly { tickLow := sar(128, sub(log_sqrt10001, 3402992956809132418596140100660247210)) tickHi := sar(128, add(log_sqrt10001, 291339464771989622907027621153398088495)) } tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67; function _sendLogPayloadImplementation(bytes memory payload) internal view { address consoleAddress = CONSOLE_ADDRESS; /// @solidity memory-safe-assembly assembly { pop( staticcall( gas(), consoleAddress, add(payload, 32), mload(payload), 0, 0 ) ) } } function _castToPure( function(bytes memory) internal view fnIn ) internal pure returns (function(bytes memory) pure fnOut) { assembly { fnOut := fnIn } } function _sendLogPayload(bytes memory payload) internal pure { _castToPure(_sendLogPayloadImplementation)(payload); } function log() internal pure { _sendLogPayload(abi.encodeWithSignature("log()")); } function logInt(int256 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); } function logUint(uint256 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); } function logString(string memory p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function logBool(bool p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function logAddress(address p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function logBytes(bytes memory p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); } function logBytes1(bytes1 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); } function logBytes2(bytes2 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); } function logBytes3(bytes3 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); } function logBytes4(bytes4 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); } function logBytes5(bytes5 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); } function logBytes6(bytes6 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); } function logBytes7(bytes7 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); } function logBytes8(bytes8 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); } function logBytes9(bytes9 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); } function logBytes10(bytes10 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); } function logBytes11(bytes11 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); } function logBytes12(bytes12 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); } function logBytes13(bytes13 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); } function logBytes14(bytes14 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); } function logBytes15(bytes15 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); } function logBytes16(bytes16 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); } function logBytes17(bytes17 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); } function logBytes18(bytes18 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); } function logBytes19(bytes19 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); } function logBytes20(bytes20 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); } function logBytes21(bytes21 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); } function logBytes22(bytes22 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); } function logBytes23(bytes23 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); } function logBytes24(bytes24 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); } function logBytes25(bytes25 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); } function logBytes26(bytes26 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); } function logBytes27(bytes27 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); } function logBytes28(bytes28 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); } function logBytes29(bytes29 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); } function logBytes30(bytes30 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); } function logBytes31(bytes31 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); } function logBytes32(bytes32 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); } function log(uint256 p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); } function log(string memory p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function log(bool p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function log(address p0) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function log(uint256 p0, uint256 p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256)", p0, p1)); } function log(uint256 p0, string memory p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1)); } function log(uint256 p0, bool p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1)); } function log(uint256 p0, address p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address)", p0, p1)); } function log(string memory p0, uint256 p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); } function log(string memory p0, string memory p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); } function log(string memory p0, bool p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); } function log(string memory p0, address p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); } function log(bool p0, uint256 p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1)); } function log(bool p0, string memory p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); } function log(bool p0, bool p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); } function log(bool p0, address p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); } function log(address p0, uint256 p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256)", p0, p1)); } function log(address p0, string memory p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); } function log(address p0, bool p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); } function log(address p0, address p1) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); } function log(uint256 p0, uint256 p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256)", p0, p1, p2)); } function log(uint256 p0, uint256 p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string)", p0, p1, p2)); } function log(uint256 p0, uint256 p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool)", p0, p1, p2)); } function log(uint256 p0, uint256 p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address)", p0, p1, p2)); } function log(uint256 p0, string memory p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256)", p0, p1, p2)); } function log(uint256 p0, string memory p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string)", p0, p1, p2)); } function log(uint256 p0, string memory p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool)", p0, p1, p2)); } function log(uint256 p0, string memory p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address)", p0, p1, p2)); } function log(uint256 p0, bool p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256)", p0, p1, p2)); } function log(uint256 p0, bool p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string)", p0, p1, p2)); } function log(uint256 p0, bool p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool)", p0, p1, p2)); } function log(uint256 p0, bool p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address)", p0, p1, p2)); } function log(uint256 p0, address p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256)", p0, p1, p2)); } function log(uint256 p0, address p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string)", p0, p1, p2)); } function log(uint256 p0, address p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool)", p0, p1, p2)); } function log(uint256 p0, address p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address)", p0, p1, p2)); } function log(string memory p0, uint256 p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256)", p0, p1, p2)); } function log(string memory p0, uint256 p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string)", p0, p1, p2)); } function log(string memory p0, uint256 p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool)", p0, p1, p2)); } function log(string memory p0, uint256 p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address)", p0, p1, p2)); } function log(string memory p0, string memory p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256)", p0, p1, p2)); } function log(string memory p0, string memory p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); } function log(string memory p0, string memory p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); } function log(string memory p0, string memory p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); } function log(string memory p0, bool p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256)", p0, p1, p2)); } function log(string memory p0, bool p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); } function log(string memory p0, bool p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); } function log(string memory p0, bool p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); } function log(string memory p0, address p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256)", p0, p1, p2)); } function log(string memory p0, address p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); } function log(string memory p0, address p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); } function log(string memory p0, address p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); } function log(bool p0, uint256 p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256)", p0, p1, p2)); } function log(bool p0, uint256 p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string)", p0, p1, p2)); } function log(bool p0, uint256 p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool)", p0, p1, p2)); } function log(bool p0, uint256 p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address)", p0, p1, p2)); } function log(bool p0, string memory p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256)", p0, p1, p2)); } function log(bool p0, string memory p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); } function log(bool p0, string memory p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); } function log(bool p0, string memory p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); } function log(bool p0, bool p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256)", p0, p1, p2)); } function log(bool p0, bool p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); } function log(bool p0, bool p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); } function log(bool p0, bool p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); } function log(bool p0, address p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256)", p0, p1, p2)); } function log(bool p0, address p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); } function log(bool p0, address p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); } function log(bool p0, address p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); } function log(address p0, uint256 p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256)", p0, p1, p2)); } function log(address p0, uint256 p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string)", p0, p1, p2)); } function log(address p0, uint256 p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool)", p0, p1, p2)); } function log(address p0, uint256 p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address)", p0, p1, p2)); } function log(address p0, string memory p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256)", p0, p1, p2)); } function log(address p0, string memory p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); } function log(address p0, string memory p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); } function log(address p0, string memory p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); } function log(address p0, bool p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256)", p0, p1, p2)); } function log(address p0, bool p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); } function log(address p0, bool p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); } function log(address p0, bool p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); } function log(address p0, address p1, uint256 p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256)", p0, p1, p2)); } function log(address p0, address p1, string memory p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); } function log(address p0, address p1, bool p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); } function log(address p0, address p1, address p2) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); } function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,string)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,bool)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,address)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,string)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,bool)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,address)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,string)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,bool)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,address)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,string)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,bool)", p0, p1, p2, p3)); } function log(uint256 p0, uint256 p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,address)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,string)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,bool)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,address)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,string)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,bool)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,address)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,string)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,bool)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,address)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,string)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,bool)", p0, p1, p2, p3)); } function log(uint256 p0, string memory p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,address)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,string)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,bool)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,address)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,string)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,bool)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,address)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,string)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,bool)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,address)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,string)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,bool)", p0, p1, p2, p3)); } function log(uint256 p0, bool p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,address)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,string)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,bool)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,address)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,string)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,bool)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,address)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,string)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,bool)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,address)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,uint256)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,string)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,bool)", p0, p1, p2, p3)); } function log(uint256 p0, address p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,address)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,uint256)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,string)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,address)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,uint256)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,string)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,address)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,uint256)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,uint256)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,string)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint256 p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,uint256)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint256)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint256)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint256)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,uint256)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint256)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint256)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint256)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,uint256)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint256)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint256)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint256)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,uint256)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,string)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,bool)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,address)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,uint256)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,string)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,bool)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,address)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,uint256)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,string)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,address)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,uint256)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,string)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,bool)", p0, p1, p2, p3)); } function log(bool p0, uint256 p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,uint256)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint256)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint256)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint256)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,uint256)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint256)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint256)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint256)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,uint256)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint256)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint256)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint256)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,uint256)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,string)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,bool)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,address)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,uint256)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,string)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,bool)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,address)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,uint256)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,string)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,bool)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,address)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,uint256)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,string)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,bool)", p0, p1, p2, p3)); } function log(address p0, uint256 p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,uint256)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint256)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint256)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint256)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,uint256)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint256)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint256)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint256)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); } function log(address p0, address p1, uint256 p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,uint256)", p0, p1, p2, p3)); } function log(address p0, address p1, uint256 p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,string)", p0, p1, p2, p3)); } function log(address p0, address p1, uint256 p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, uint256 p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,address)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint256)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint256)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, uint256 p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint256)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, string memory p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, bool p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, address p3) internal pure { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.19; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.0; import './openzeppelin-contracts/contracts/token/ERC20/IERC20.sol'; library TransferHelper { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF'); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); } /// @notice Approves the stipulated contract to spend the given allowance in the given token /// @dev Errors with 'SA' if transfer fails /// @param token The contract address of the token to be approved /// @param to The target of the approval /// @param value The amount of the given token the target will be allowed to spend function safeApprove( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA'); } /// @notice Transfers ETH to the recipient address /// @dev Fails with `STE` /// @param to The destination of the transfer /// @param value The value to be transferred function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'STE'); } }
pragma solidity >=0.5.0; interface IUniswapV2Callee { function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; }
pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Callback for IUniswapV3PoolActions#swap /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface interface IUniswapV3SwapCallback { /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. /// @dev In the implementation you must pay the pool tokens owed for the swap. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title The interface for the Uniswap V3 Factory /// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees interface IUniswapV3Factory { /// @notice Emitted when the owner of the factory is changed /// @param oldOwner The owner before the owner was changed /// @param newOwner The owner after the owner was changed event OwnerChanged(address indexed oldOwner, address indexed newOwner); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new fee amount is enabled for pool creation via the factory /// @param fee The enabled fee, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); /// @notice Returns the current owner of the factory /// @dev Can be changed by the current owner via setOwner /// @return The address of the factory owner function owner() external view returns (address); /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee /// @return The tick spacing function feeAmountTickSpacing(uint24 fee) external view returns (int24); /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The pool address function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); /// @notice Creates a pool for the given two tokens and fee /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param fee The desired fee for the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments /// are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, uint24 fee ) external returns (address pool); /// @notice Updates the owner of the factory /// @dev Must be called by the current owner /// @param _owner The new owner of the factory function setOwner(address _owner) external; /// @notice Enables a fee amount with the given tickSpacing /// @dev Fee amounts may never be removed once enabled /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount function enableFeeAmount(uint24 fee, int24 tickSpacing) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import './pool/IUniswapV3PoolImmutables.sol'; import './pool/IUniswapV3PoolState.sol'; import './pool/IUniswapV3PoolDerivedState.sol'; import './pool/IUniswapV3PoolActions.sol'; import './pool/IUniswapV3PoolOwnerActions.sol'; import './pool/IUniswapV3PoolEvents.sol'; /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolEvents { }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IUniswapV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IUniswapV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// observationIndex The index of the last oracle observation that was written, /// observationCardinality The current maximum number of observations stored in the pool, /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper, /// liquidityNet how much liquidity changes when the pool price crosses the tick, /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// secondsOutside the seconds spent on the other side of the tick from the current tick, /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks(int24 tick) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return _liquidity The amount of liquidity in the position, /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions(bytes32 key) external view returns ( uint128 _liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// Returns initialized whether the observation has been initialized and the values are safe to use function observations(uint256 index) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"SLIPPAGE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"current_caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"exec","outputs":[{"internalType":"uint256","name":"ind","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"network","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"value_to_pay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b03191633179055613d6b806100326000396000f3fe6080604052600436106100785760003560e01c806355f865011161004b57806355f86501146101105780636739afca146101235780638da5cb5b14610138578063fa461e331461015857005b806313af40351461007a5780631eed202f1461009a5780633a1253df146100c357806347544670146100d8575b005b34801561008657600080fd5b506100786100953660046136b1565b610178565b3480156100a657600080fd5b506100b060035481565b6040519081526020015b60405180910390f35b3480156100cf57600080fd5b506100b060c881565b3480156100e457600080fd5b506001546100f8906001600160a01b031681565b6040516001600160a01b0390911681526020016100ba565b6100b061011e36600461371e565b6101f9565b34801561012f57600080fd5b506100b0600181565b34801561014457600080fd5b506000546100f8906001600160a01b031681565b34801561016457600080fd5b50610078610173366004613760565b61031f565b6000546001600160a01b031633146101d75760405162461bcd60e51b815260206004820152600960248201527f6f776e65724f6e6c79000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546000906001600160a01b0316156102555760405162461bcd60e51b815260206004820152601160248201527f6973556e6c6f636b65643a2066616c736500000000000000000000000000000060448201526064016101ce565b600180546001600160a01b031916331790556000806102748585610528565b60a082015191935091508590156102985761029183838888610749565b9350610306565b60405162461bcd60e51b815260206004820152602160248201527f6578656346726f6d4f7574707574206973206e6f7420696d706c656d656e746560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016101ce565b5050600180546001600160a01b03191690555092915050565b6001546001600160a01b03166103775760405162461bcd60e51b815260206004820152600f60248201527f69734c6f636b65643a2066616c7365000000000000000000000000000000000060448201526064016101ce565b6002546001600160a01b031633146103d15760405162461bcd60e51b815260206004820152601960248201527f63616c6c6261636b5f746f5f636865636b206661696c7572650000000000000060448201526064016101ce565b60008413806103e05750600083135b61042c5760405162461bcd60e51b815260206004820152600c60248201527f7a65726f20616d6f756e7473000000000000000000000000000000000000000060448201526064016101ce565b600080808061043d858701876137c1565b9350935093509350600080846001600160a01b0316866001600160a01b031610610470578861046b8b613833565b61047a565b8961047a8a613833565b9150915082156104a25760015461049d9087906001600160a01b0316338561102f565b61051c565b83156105115773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104f757600080fd5b505af115801561050b573d6000803e3d6000fd5b50505050505b61051c86338461116c565b50505050505050505050565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081019190915282803560f01c61058a60028361386b565b9150806001146105dc5760405162461bcd60e51b815260206004820152600c60248201527f57524f4e474e4554574f524b000000000000000000000000000000000000000060448201526064016101ce565b813560f81c826105eb81613884565b9350508060051461063e5760405162461bcd60e51b815260206004820152600c60248201527f57524f4e4756455253494f4e000000000000000000000000000000000000000060448201526064016101ce565b5050600061064d823560f81c90565b1160a08301528061065d81613884565b803560f81c8452915081905061067281613884565b915050803560f81c15156101008301528061068c81613884565b915050803560f81c1515610120830152806106a681613884565b803560f81c606085015291508190506106be81613884565b803560f81c608085015291508190506106d681613884565b803560f81c602085015291508190506106ee81613884565b63ffffffff8682031660e085015260208401519092506107109150601461389d565b61071d9060ff168261386b565b803560f81c604084015290508061073381613884565b94850363ffffffff1660c0840152509093915050565b600080610755866112a0565b60e081015161012001518693509091508490156108fd5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03166107c1828460e0015160e0015163ffffffff166107a7919061386b565b60e08501516060015160ff16906014909102013560601c90565b6001600160a01b03160361088f5760a08201511561088a5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08360a001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561082c57600080fd5b505af1158015610840573d6000803e3d6000fd5b50505050508160a0015182604001518360e001516060015160ff168151811061086b5761086b6138c0565b6020026020010181815161087f919061386b565b905250600060a08301525b6108fd565b60405162461bcd60e51b815260206004820152603960248201527f646f41637175697265496e7075744552433230546f6b656e3a206f6e6c79205760448201527f4554483920746f6b656e732061726520737570706f727465640000000000000060648201526084016101ce565b505b8060e001516040015160ff1681606001511015610d1b57813560f81c8261092581613884565b935050806001036109dc5761099160405180610120016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b60008690506109c985828660e0015160e0015163ffffffff166109b4919061386b565b60e0870151602001518592919060ff16611443565b9450506109d6818461159d565b50610d01565b80600503610b0657610a75604051806101c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081525090565b6000869050610aad85828660e0015160e0015163ffffffff16610a98919061386b565b60e0870151602001518592919060ff16611c60565b9450610abb90508184611df7565b610160810151600280546001600160a01b0319166001600160a01b03909216919091179055610aec818488886120cf565b600280546001600160a01b03191690556109d681846122d7565b80600603610bd257610b8260405180610160016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000801916815260200160008152602001600081526020016000151581525090565b6000869050610bba85828660e0015160e0015163ffffffff16610ba5919061386b565b60e0870151602001518592919060ff16612580565b9450610bc8905081846126ee565b6109d6818461292b565b80600703610cb957610c62604051806101a0016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6000869050610c9a85828660e0015160e0015163ffffffff16610c85919061386b565b60e0870151602001518592919060ff16612c39565b9450610ca890508184612dd1565b610cb28184612f9a565b5050610d01565b60405162461bcd60e51b815260206004820152600260248201527f435400000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b60608201805190610d1182613884565b81525050506108ff565b60e08101515160c890610d319060ff16826138d6565b82602001518360e001516080015160ff1681518110610d5257610d526138c0565b6020026020010151610d6491906138e9565b610d6e9190613900565b81600001518260e001516080015160ff1681518110610d8f57610d8f6138c0565b602002602001015111610de45760405162461bcd60e51b815260206004820152601f60248201527f736c6970706167652069732061626f766520746865207468726573686f6c640060448201526064016101ce565b60e0808201510151849073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290610e3090610e1990849063ffffffff1661386b565b60e08501516080015160ff16601402013560601c90565b6001600160a01b031603610fb3578160e00151610100015115610f675760c082015115610edc5760c08201516040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481019190915273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b158015610ec357600080fd5b505af1158015610ed7573d6000803e3d6000fd5b505050505b336001600160a01b031682604001518360e001516080015160ff1681518110610f0757610f076138c0565b60200260200101518360c00151610f1e919061386b565b604051600081818185875af1925050503d8060008114610f5a576040519150601f19603f3d011682016040523d82523d6000602084013e610f5f565b606091505b505050611025565b610fae73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23384604001518560e001516080015160ff1681518110610fa157610fa16138c0565b602002602001015161116c565b611025565b81604001518260e001516080015160ff1681518110610fd457610fd46138c0565b602002602001015160001461102557611025611003828460e0015160e0015163ffffffff16610e19919061386b565b3384604001518560e001516080015160ff1681518110610fa157610fa16138c0565b5050949350505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916110ac9190613946565b6000604051808303816000865af19150503d80600081146110e9576040519150601f19603f3d011682016040523d82523d6000602084013e6110ee565b606091505b50915091508180156111185750805115806111185750808060200190518101906111189190613962565b6111645760405162461bcd60e51b815260206004820152600360248201527f535446000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916111e19190613946565b6000604051808303816000865af19150503d806000811461121e576040519150601f19603f3d011682016040523d82523d6000602084013e611223565b606091505b509150915081801561124d57508051158061124d57508080602001905181019061124d9190613962565b6112995760405162461bcd60e51b815260206004820152600260248201527f535400000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b5050505050565b604080516101008082018352606080835260208084018290528385018290526000828501819052608080860182905260a080870183905260c0808801849052885161014081018a52848152948501849052978401839052938301829052820181905291810182905293840181905260e0808501829052918401819052610120840152810191909152604051806101000160405280836020015160ff1667ffffffffffffffff8111156113545761135461397f565b60405190808252806020026020018201604052801561137d578160200160208202803683370190505b508152602001836020015160ff1667ffffffffffffffff8111156113a3576113a361397f565b6040519080825280602002602001820160405280156113cc578160200160208202803683370190505b508152602001836020015160ff1667ffffffffffffffff8111156113f2576113f261397f565b60405190808252806020026020018201604052801561141b578160200160208202803683370190505b508152600060208201819052336040830152346060830152608082015260a001929092525090565b6000833560f81c85528361145681613884565b945050833560f81c60208601528361146d81613884565b945050818560200151106114ac5760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c6040860152836114dc81613884565b9450508185604001511061151b5760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c8461153d81613884565b955061154b90508582613501565b60a087015261155a818661386b565b945050600061156a853560f81c90565b90508461157681613884565b955061158490508582613501565b60c0870152611593818661386b565b9695505050505050565b8060e001516060015160ff168260200151036115c25760a082015160e0830152611625565b80602001518260200151815181106115dc576115dc6138c0565b602002602001015181600001518360200151815181106115fe576115fe6138c0565b60200260200101518360a0015161161591906138e9565b61161f9190613900565b60e08301525b600080600060048560000151161161165157735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f611667565b73c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac5b905060008085608001516001600160a01b031686606001516001600160a01b03161061169c57856080015186606001516116a7565b856060015186608001515b6040517fe6a439050000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015280831660248301529294509092509084169063e6a4390590604401602060405180830381865afa158015611715573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117399190613995565b9350505050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a391906139d5565b5091509150600085608001516001600160a01b031686606001516001600160a01b0316106117ff576117fa826dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff168860e00151613521565b61182e565b61182e836dffffffffffffffffffffffffffff16836dffffffffffffffffffffffffffff168860e00151613521565b90508060000361184057505050505050565b8460e001516060015160ff168660200151036119e9578460e001516101200151156118b3576118788660600151858860e0015161116c565b8560e001518560400151876020015181518110611897576118976138c0565b602002602001018181516118ab91906138d6565b905250611a33565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031686606001516001600160a01b0316036119d0578560e001518560a00151106119885773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08760e001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561194657600080fd5b505af115801561195a573d6000803e3d6000fd5b50505050506119728660600151858860e0015161116c565b8560e001518560a0018181516118ab91906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354313a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b6119e4866060015133868960e0015161102f565b611a33565b6119fc8660600151858860e0015161116c565b8560e001518560400151876020015181518110611a1b57611a1b6138c0565b60200260200101818151611a2f91906138d6565b9052505b60008087608001516001600160a01b031688606001516001600160a01b031610611a5f57826000611a63565b6000835b91509150856001600160a01b031663022c0d9f83838a60e001516080015160ff168c60400151141580611ac7575060808c01516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015611ac757508a60e0015161010001515b611ad15733611ad3565b305b604080516000815260208101918290527fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16909152611b1d9392919060248101613a51565b600060405180830381600087803b158015611b3757600080fd5b505af1158015611b4b573d6000803e3d6000fd5b505050508660e001516080015160ff16886040015103611bbb5760808801516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015611b9b57508660e0015161010001515b15611bb657828760c001818151611bb2919061386b565b9052505b611bee565b828760400151896040015181518110611bd657611bd66138c0565b60200260200101818151611bea919061386b565b9052505b828760000151896040015181518110611c0957611c096138c0565b60200260200101818151611c1d919061386b565b90525060c0880151602088015160408a015181518110611c3f57611c3f6138c0565b60200260200101818151611c53919061386b565b9052505050505050505050565b6000833560f81c855283611c7381613884565b945050833560f81c602086015283611c8a81613884565b94505081856020015110611ce05760405162461bcd60e51b815260206004820152600360248201527f355349000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b602085015160140283013560601c610120860152833560f81c604086015283611d0881613884565b94505081856040015110611d5e5760405162461bcd60e51b815260206004820152600360248201527f355449000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b604085015160140283013560601c6001600160a01b0316610140860152833560e81c6060860152611d9060038561386b565b9350833560f81c84611da181613884565b9550611daf90508582613501565b6080870152611dbe818661386b565b9450506000611dce853560f81c90565b905084611dda81613884565b9550611de890508582613501565b60a0870152611593818661386b565b61012082015161014083015160608401516040517f1698ee820000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015292909116602483015262ffffff166044820152731f98431c8ad98523631ae4a59f267346ea31f98490631698ee8290606401602060405180830381865afa158015611e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb19190613995565b6001600160a01b03166101608301819052611f105760405162461bcd60e51b81526004016101ce9060208082526004908201527f355a504100000000000000000000000000000000000000000000000000000000604082015260600190565b8060e001516060015160ff1682602001510361204257608082015160c083015260e0810151610120015115611f8157600061010083015260c08201516040820151602084015181518110611f6657611f666138c0565b60200260200101818151611f7a91906138d6565b9052505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168261012001516001600160a01b03160361202f578160c001518160a0015110611fe757600160e0830152600061010083015260c082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354353a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b600060e083015260016101008301525050565b806020015182602001518151811061205c5761205c6138c0565b6020026020010151816000015183602001518151811061207e5761207e6138c0565b6020026020010151836080015161209591906138e9565b61209f9190613900565b60c08301819052600060e084018190526101008401526040820151602084015181518110611f6657611f666138c0565b60008461014001516001600160a01b03168561012001516001600160a01b03161090508461016001516001600160a01b031663128acb088560e001516080015160ff16876040015114158061215657506101408701516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561215657508560e0015161010001515b6121605733612162565b305b838860c00151856121915761218c600173fffd8963efd1fc6a506488495d951d5263988d26613a7f565b6121a1565b6121a16401000276a36001613a9f565b6101208b01516101408c015160e08d01516101008e0151604080516001600160a01b0395861660208201529490931692840192909252151560608301521515608082015260a0016040516020818303038152906040526040518663ffffffff1660e01b8152600401612217959493929190613abf565b60408051808303816000875af1925050508015612251575060408051601f3d908101601f1916820190925261224e91810190613b04565b60015b6122a25761225d613b28565b806308c379a0036122965750612271613b7f565b8061227c5750612298565b8060405162461bcd60e51b81526004016101ce9190613c09565b505b3d6000803e3d6000fd5b82156122bd576101a0870181905261018087018290526122ce565b6101a0870182905261018087018190525b50505050505050565b8161018001518260c0015112156124545760008260c001518361018001516122ff9190613c1c565b90508160e001516060015160ff1683602001510361241f578160e0015161012001511561235d57808260400151846020015181518110612341576123416138c0565b6020026020010181815161235591906138d6565b905250612452565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168361012001516001600160a01b03160361241a57808260a00151106123ac57808260a00181815161235591906138d6565b60405162461bcd60e51b815260206004820152602360248201527f4354353a206d73672e76616c756520696e73756666696369656e74202861667460448201527f657229000000000000000000000000000000000000000000000000000000000060648201526084016101ce565b612452565b80826040015184602001518151811061243a5761243a6138c0565b6020026020010181815161244e91906138d6565b9052505b505b8060e001516080015160ff168260400151036124cf576101408201516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21480156124a157508060e0015161010001515b156124ca57816101a001516124b590613833565b8160c0018181516124c6919061386b565b9052505b612510565b816101a001516124de90613833565b81604001518360400151815181106124f8576124f86138c0565b6020026020010181815161250c919061386b565b9052505b816101a0015161251f90613833565b8151604084015181518110612536576125366138c0565b6020026020010181815161254a919061386b565b90525060a0820151602082015160408401518151811061256c5761256c6138c0565b60200260200101818151611f7a919061386b565b6000833560f81c85528361259381613884565b945050833560f81c6020860152836125aa81613884565b945050818560200151106125e95760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c60408601528361261981613884565b945050818560400151106126585760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c8461267a81613884565b955061268890508582613501565b60a0870152612697818661386b565b94505060006126a7853560f81c90565b9050846126b381613884565b95506126c190508582613501565b60c08701526126d0818661386b565b945050833560e08601526126e560208561386b565b95945050505050565b8060e001516060015160ff1682602001510361287a5760a082015161010083015260e081015161012001511561278957612746826060015173ba12222222228d8ba445958a75a0704d566bf2c884610100015161356c565b8161010001518160400151836020015181518110612766576127666138c0565b6020026020010181815161277a91906138d6565b90525060006101408301525050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031682606001516001600160a01b031603612831578161010001518160a00151106127e957600161014083015261010082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354363a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b6128468260600151333085610100015161102f565b61286e826060015173ba12222222228d8ba445958a75a0704d566bf2c884610100015161356c565b60006101408301525050565b8060200151826020015181518110612894576128946138c0565b602002602001015181600001518360200151815181106128b6576128b66138c0565b60200260200101518360a001516128cd91906138e9565b6128d79190613900565b610100830181905260608301516129039173ba12222222228d8ba445958a75a0704d566bf2c89061356c565b60006101408301526101008201516040820151602084015181518110611f6657611f666138c0565b6000808260e001516080015160ff1684604001511461294f578360800151306129ac565b60808401516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561298557508260e0015161010001515b612994578360800151336129ac565b83516002166129a8578360800151306129ac565b6000335b91509150600073ba12222222228d8ba445958a75a0704d566bf2c86001600160a01b03166352bbbe298661014001516129e65760006129ed565b8661010001515b6040805160c0810190915260e089015181526020810160008152602001896101400151612a1e578960600151612a21565b60005b6001600160a01b039081168252881660208201526101008a0151604082015260600160006040519080825280601f01601f191660200182016040528015612a6f576020820181803683370190505b509052604080516080810182523081526000602082018190526001600160a01b038916928201929092526060810182905290612aad426103e861386b565b6040518663ffffffff1660e01b8152600401612acc9493929190613c3c565b60206040518083038185885af1158015612aea573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612b0f9190613d1c565b90508360e001516080015160ff16856040015103612b8f5760808501516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015612b5d57508360e0015161010001515b8015612b6b57508451600216155b15612b8a57808460c001818151612b82919061386b565b905250612bc2565b612bc2565b808460400151866040015181518110612baa57612baa6138c0565b60200260200101818151612bbe919061386b565b9052505b808460000151866040015181518110612bdd57612bdd6138c0565b60200260200101818151612bf1919061386b565b90525060c08501516020850151604087015181518110612c1357612c136138c0565b60200260200101818151612c27919061386b565b90525061012090940193909352505050565b6000833560f81c855283612c4c81613884565b945050833560f81c602086015283612c6381613884565b94505081856020015110612ca25760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c604086015283612cd281613884565b94505081856040015110612d115760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c84612d3381613884565b9550612d4190508582613501565b60a0870152612d50818661386b565b9450506000612d60853560f81c90565b905084612d6c81613884565b9550612d7a90508582613501565b60c0870152612d89818661386b565b803560601c60e08801529450612da2905060148561386b565b9350833560f81c61010086015283612db981613884565b945050833560f81c6101208601528361159381613884565b8060e001516060015160ff16826020015103612f225760a082015161014083015260e0810151610120015115612e4157612e1982606001518360e0015184610140015161356c565b60006101808301526101408201516040820151602084015181518110611f6657611f666138c0565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031682606001516001600160a01b031603612ee9578161014001518160a0015110612ea157600161018083015261014082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354373a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b612efe8260600151333085610140015161102f565b612f1682606001518360e0015184610140015161356c565b60006101808301525050565b8060200151826020015181518110612f3c57612f3c6138c0565b60200260200101518160000151836020015181518110612f5e57612f5e6138c0565b60200260200101518360a00151612f7591906138e9565b612f7f9190613900565b6101408301819052606083015160e0840151612e199261356c565b600080600073d51a44d3fae010294c616388b506acda1bfaae466001600160a01b03168560e001516001600160a01b0316036132845760808501516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561300e57508360e001516080015160ff168560400151145b801561302057508360e0015161010001515b156130d75760e08501516101008601516101208701516101408801516040517f394747c500000000000000000000000000000000000000000000000000000000815260048101939093526024830191909152604482015260006064820152600160848201524793506001600160a01b039091169063394747c59060a401600060405180830381600087803b1580156130b757600080fd5b505af11580156130cb573d6000803e3d6000fd5b50505050479050613444565b60808501516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015613121573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131459190613d1c565b91508460e001516001600160a01b031663394747c586610180015161316b576000613172565b8661014001515b6101008801516101208901516101408a01516101808b01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152600481019490945260248401929092526044830152600060648301521515608482015260a4016000604051808303818588803b1580156131f557600080fd5b505af1158015613209573d6000803e3d6000fd5b50505060808701516040516370a0823160e01b81523060048201526001600160a01b0390911692506370a0823191506024015b602060405180830381865afa158015613259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061327d9190613d1c565b9050613444565b73bebc44782c7db0a1a60cb6fe97d0b483032ff1c76001600160a01b03168560e001516001600160a01b0316036133fc5760808501516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156132ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133239190613d1c565b60e08601516101008701516101208801516101408901516040517f3df02124000000000000000000000000000000000000000000000000000000008152600f93840b60048201529190920b60248201526044810191909152600060648201529193506001600160a01b031690633df0212490608401600060405180830381600087803b1580156133b257600080fd5b505af11580156133c6573d6000803e3d6000fd5b50505060808601516040516370a0823160e01b81523060048201526001600160a01b0390911691506370a082319060240161323c565b60405162461bcd60e51b815260206004820152601560248201527f756e737570706f72746564204375727665506f6f6c000000000000000000000060448201526064016101ce565b600061345083836138d6565b90508086610160018181525050808560400151876040015181518110613478576134786138c0565b6020026020010181815161348c919061386b565b9052508451604087015181518392919081106134aa576134aa6138c0565b602002602001018181516134be919061386b565b90525060c086015160208601516040880151815181106134e0576134e06138c0565b602002602001018181516134f4919061386b565b9052509295945050505050565b60008060036135118460206138d6565b943594901b9390931c9392505050565b60008061352e83856138e9565b61353a906103e56138e9565b9050600061354a846103e56138e9565b613556876103e86138e9565b613560919061386b565b90506115938183613900565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916135e19190613946565b6000604051808303816000865af19150503d806000811461361e576040519150601f19603f3d011682016040523d82523d6000602084013e613623565b606091505b509150915081801561364d57508051158061364d57508080602001905181019061364d9190613962565b6112995760405162461bcd60e51b815260206004820152600260248201527f534100000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b6001600160a01b03811681146136ae57600080fd5b50565b6000602082840312156136c357600080fd5b81356136ce81613699565b9392505050565b60008083601f8401126136e757600080fd5b50813567ffffffffffffffff8111156136ff57600080fd5b60208301915083602082850101111561371757600080fd5b9250929050565b6000806020838503121561373157600080fd5b823567ffffffffffffffff81111561374857600080fd5b613754858286016136d5565b90969095509350505050565b6000806000806060858703121561377657600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561379b57600080fd5b6137a7878288016136d5565b95989497509550505050565b80151581146136ae57600080fd5b600080600080608085870312156137d757600080fd5b84356137e281613699565b935060208501356137f281613699565b92506040850135613802816137b3565b91506060850135613812816137b3565b939692955090935050565b634e487b7160e01b600052601160045260246000fd5b60007f800000000000000000000000000000000000000000000000000000000000000082036138645761386461381d565b5060000390565b8082018082111561387e5761387e61381d565b92915050565b6000600182016138965761389661381d565b5060010190565b60ff81811683821602908116908181146138b9576138b961381d565b5092915050565b634e487b7160e01b600052603260045260246000fd5b8181038181111561387e5761387e61381d565b808202811582820484141761387e5761387e61381d565b60008261391d57634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561393d578181015183820152602001613925565b50506000910152565b60008251613958818460208701613922565b9190910192915050565b60006020828403121561397457600080fd5b81516136ce816137b3565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156139a757600080fd5b81516136ce81613699565b80516dffffffffffffffffffffffffffff811681146139d057600080fd5b919050565b6000806000606084860312156139ea57600080fd5b6139f3846139b2565b9250613a01602085016139b2565b9150604084015163ffffffff81168114613a1a57600080fd5b809150509250925092565b60008151808452613a3d816020860160208601613922565b601f01601f19169290920160200192915050565b8481528360208201526001600160a01b03831660408201526080606082015260006115936080830184613a25565b6001600160a01b038281168282160390808211156138b9576138b961381d565b6001600160a01b038181168382160190808211156138b9576138b961381d565b60006001600160a01b038088168352861515602084015285604084015280851660608401525060a06080830152613af960a0830184613a25565b979650505050505050565b60008060408385031215613b1757600080fd5b505080516020909101519092909150565b600060033d1115613b415760046000803e5060005160e01c5b90565b601f8201601f1916810167ffffffffffffffff81118282101715613b7857634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d1015613b8d5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613bbd57505050505090565b8285019150815181811115613bd55750505050505090565b843d8701016020828501011115613bef5750505050505090565b613bfe60208286010187613b44565b509095945050505050565b6020815260006136ce6020830184613a25565b81810360008312801583831316838312821617156138b9576138b961381d565b60e08152845160e08201526000602086015160028110613c6c57634e487b7160e01b600052602160045260246000fd5b61010083015260408601516001600160a01b03166101208301526060860151613ca16101408401826001600160a01b03169052565b50608086015161016083015260a086015160c0610180840152613cc86101a0840182613a25565b915050613d0a60208301866001600160a01b03808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b60a082019390935260c0015292915050565b600060208284031215613d2e57600080fd5b505191905056fea264697066735822122009d5bcab1b7a34a01b154a1c713c4d72a303f822d21cf7923a9248e85545752a64736f6c63430008140033
Deployed Bytecode
0x6080604052600436106100785760003560e01c806355f865011161004b57806355f86501146101105780636739afca146101235780638da5cb5b14610138578063fa461e331461015857005b806313af40351461007a5780631eed202f1461009a5780633a1253df146100c357806347544670146100d8575b005b34801561008657600080fd5b506100786100953660046136b1565b610178565b3480156100a657600080fd5b506100b060035481565b6040519081526020015b60405180910390f35b3480156100cf57600080fd5b506100b060c881565b3480156100e457600080fd5b506001546100f8906001600160a01b031681565b6040516001600160a01b0390911681526020016100ba565b6100b061011e36600461371e565b6101f9565b34801561012f57600080fd5b506100b0600181565b34801561014457600080fd5b506000546100f8906001600160a01b031681565b34801561016457600080fd5b50610078610173366004613760565b61031f565b6000546001600160a01b031633146101d75760405162461bcd60e51b815260206004820152600960248201527f6f776e65724f6e6c79000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546000906001600160a01b0316156102555760405162461bcd60e51b815260206004820152601160248201527f6973556e6c6f636b65643a2066616c736500000000000000000000000000000060448201526064016101ce565b600180546001600160a01b031916331790556000806102748585610528565b60a082015191935091508590156102985761029183838888610749565b9350610306565b60405162461bcd60e51b815260206004820152602160248201527f6578656346726f6d4f7574707574206973206e6f7420696d706c656d656e746560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016101ce565b5050600180546001600160a01b03191690555092915050565b6001546001600160a01b03166103775760405162461bcd60e51b815260206004820152600f60248201527f69734c6f636b65643a2066616c7365000000000000000000000000000000000060448201526064016101ce565b6002546001600160a01b031633146103d15760405162461bcd60e51b815260206004820152601960248201527f63616c6c6261636b5f746f5f636865636b206661696c7572650000000000000060448201526064016101ce565b60008413806103e05750600083135b61042c5760405162461bcd60e51b815260206004820152600c60248201527f7a65726f20616d6f756e7473000000000000000000000000000000000000000060448201526064016101ce565b600080808061043d858701876137c1565b9350935093509350600080846001600160a01b0316866001600160a01b031610610470578861046b8b613833565b61047a565b8961047a8a613833565b9150915082156104a25760015461049d9087906001600160a01b0316338561102f565b61051c565b83156105115773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104f757600080fd5b505af115801561050b573d6000803e3d6000fd5b50505050505b61051c86338461116c565b50505050505050505050565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081019190915282803560f01c61058a60028361386b565b9150806001146105dc5760405162461bcd60e51b815260206004820152600c60248201527f57524f4e474e4554574f524b000000000000000000000000000000000000000060448201526064016101ce565b813560f81c826105eb81613884565b9350508060051461063e5760405162461bcd60e51b815260206004820152600c60248201527f57524f4e4756455253494f4e000000000000000000000000000000000000000060448201526064016101ce565b5050600061064d823560f81c90565b1160a08301528061065d81613884565b803560f81c8452915081905061067281613884565b915050803560f81c15156101008301528061068c81613884565b915050803560f81c1515610120830152806106a681613884565b803560f81c606085015291508190506106be81613884565b803560f81c608085015291508190506106d681613884565b803560f81c602085015291508190506106ee81613884565b63ffffffff8682031660e085015260208401519092506107109150601461389d565b61071d9060ff168261386b565b803560f81c604084015290508061073381613884565b94850363ffffffff1660c0840152509093915050565b600080610755866112a0565b60e081015161012001518693509091508490156108fd5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03166107c1828460e0015160e0015163ffffffff166107a7919061386b565b60e08501516060015160ff16906014909102013560601c90565b6001600160a01b03160361088f5760a08201511561088a5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08360a001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561082c57600080fd5b505af1158015610840573d6000803e3d6000fd5b50505050508160a0015182604001518360e001516060015160ff168151811061086b5761086b6138c0565b6020026020010181815161087f919061386b565b905250600060a08301525b6108fd565b60405162461bcd60e51b815260206004820152603960248201527f646f41637175697265496e7075744552433230546f6b656e3a206f6e6c79205760448201527f4554483920746f6b656e732061726520737570706f727465640000000000000060648201526084016101ce565b505b8060e001516040015160ff1681606001511015610d1b57813560f81c8261092581613884565b935050806001036109dc5761099160405180610120016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b60008690506109c985828660e0015160e0015163ffffffff166109b4919061386b565b60e0870151602001518592919060ff16611443565b9450506109d6818461159d565b50610d01565b80600503610b0657610a75604051806101c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081525090565b6000869050610aad85828660e0015160e0015163ffffffff16610a98919061386b565b60e0870151602001518592919060ff16611c60565b9450610abb90508184611df7565b610160810151600280546001600160a01b0319166001600160a01b03909216919091179055610aec818488886120cf565b600280546001600160a01b03191690556109d681846122d7565b80600603610bd257610b8260405180610160016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000801916815260200160008152602001600081526020016000151581525090565b6000869050610bba85828660e0015160e0015163ffffffff16610ba5919061386b565b60e0870151602001518592919060ff16612580565b9450610bc8905081846126ee565b6109d6818461292b565b80600703610cb957610c62604051806101a0016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6000869050610c9a85828660e0015160e0015163ffffffff16610c85919061386b565b60e0870151602001518592919060ff16612c39565b9450610ca890508184612dd1565b610cb28184612f9a565b5050610d01565b60405162461bcd60e51b815260206004820152600260248201527f435400000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b60608201805190610d1182613884565b81525050506108ff565b60e08101515160c890610d319060ff16826138d6565b82602001518360e001516080015160ff1681518110610d5257610d526138c0565b6020026020010151610d6491906138e9565b610d6e9190613900565b81600001518260e001516080015160ff1681518110610d8f57610d8f6138c0565b602002602001015111610de45760405162461bcd60e51b815260206004820152601f60248201527f736c6970706167652069732061626f766520746865207468726573686f6c640060448201526064016101ce565b60e0808201510151849073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290610e3090610e1990849063ffffffff1661386b565b60e08501516080015160ff16601402013560601c90565b6001600160a01b031603610fb3578160e00151610100015115610f675760c082015115610edc5760c08201516040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481019190915273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b158015610ec357600080fd5b505af1158015610ed7573d6000803e3d6000fd5b505050505b336001600160a01b031682604001518360e001516080015160ff1681518110610f0757610f076138c0565b60200260200101518360c00151610f1e919061386b565b604051600081818185875af1925050503d8060008114610f5a576040519150601f19603f3d011682016040523d82523d6000602084013e610f5f565b606091505b505050611025565b610fae73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23384604001518560e001516080015160ff1681518110610fa157610fa16138c0565b602002602001015161116c565b611025565b81604001518260e001516080015160ff1681518110610fd457610fd46138c0565b602002602001015160001461102557611025611003828460e0015160e0015163ffffffff16610e19919061386b565b3384604001518560e001516080015160ff1681518110610fa157610fa16138c0565b5050949350505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916110ac9190613946565b6000604051808303816000865af19150503d80600081146110e9576040519150601f19603f3d011682016040523d82523d6000602084013e6110ee565b606091505b50915091508180156111185750805115806111185750808060200190518101906111189190613962565b6111645760405162461bcd60e51b815260206004820152600360248201527f535446000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916111e19190613946565b6000604051808303816000865af19150503d806000811461121e576040519150601f19603f3d011682016040523d82523d6000602084013e611223565b606091505b509150915081801561124d57508051158061124d57508080602001905181019061124d9190613962565b6112995760405162461bcd60e51b815260206004820152600260248201527f535400000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b5050505050565b604080516101008082018352606080835260208084018290528385018290526000828501819052608080860182905260a080870183905260c0808801849052885161014081018a52848152948501849052978401839052938301829052820181905291810182905293840181905260e0808501829052918401819052610120840152810191909152604051806101000160405280836020015160ff1667ffffffffffffffff8111156113545761135461397f565b60405190808252806020026020018201604052801561137d578160200160208202803683370190505b508152602001836020015160ff1667ffffffffffffffff8111156113a3576113a361397f565b6040519080825280602002602001820160405280156113cc578160200160208202803683370190505b508152602001836020015160ff1667ffffffffffffffff8111156113f2576113f261397f565b60405190808252806020026020018201604052801561141b578160200160208202803683370190505b508152600060208201819052336040830152346060830152608082015260a001929092525090565b6000833560f81c85528361145681613884565b945050833560f81c60208601528361146d81613884565b945050818560200151106114ac5760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c6040860152836114dc81613884565b9450508185604001511061151b5760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c8461153d81613884565b955061154b90508582613501565b60a087015261155a818661386b565b945050600061156a853560f81c90565b90508461157681613884565b955061158490508582613501565b60c0870152611593818661386b565b9695505050505050565b8060e001516060015160ff168260200151036115c25760a082015160e0830152611625565b80602001518260200151815181106115dc576115dc6138c0565b602002602001015181600001518360200151815181106115fe576115fe6138c0565b60200260200101518360a0015161161591906138e9565b61161f9190613900565b60e08301525b600080600060048560000151161161165157735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f611667565b73c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac5b905060008085608001516001600160a01b031686606001516001600160a01b03161061169c57856080015186606001516116a7565b856060015186608001515b6040517fe6a439050000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015280831660248301529294509092509084169063e6a4390590604401602060405180830381865afa158015611715573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117399190613995565b9350505050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a391906139d5565b5091509150600085608001516001600160a01b031686606001516001600160a01b0316106117ff576117fa826dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff168860e00151613521565b61182e565b61182e836dffffffffffffffffffffffffffff16836dffffffffffffffffffffffffffff168860e00151613521565b90508060000361184057505050505050565b8460e001516060015160ff168660200151036119e9578460e001516101200151156118b3576118788660600151858860e0015161116c565b8560e001518560400151876020015181518110611897576118976138c0565b602002602001018181516118ab91906138d6565b905250611a33565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031686606001516001600160a01b0316036119d0578560e001518560a00151106119885773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08760e001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561194657600080fd5b505af115801561195a573d6000803e3d6000fd5b50505050506119728660600151858860e0015161116c565b8560e001518560a0018181516118ab91906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354313a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b6119e4866060015133868960e0015161102f565b611a33565b6119fc8660600151858860e0015161116c565b8560e001518560400151876020015181518110611a1b57611a1b6138c0565b60200260200101818151611a2f91906138d6565b9052505b60008087608001516001600160a01b031688606001516001600160a01b031610611a5f57826000611a63565b6000835b91509150856001600160a01b031663022c0d9f83838a60e001516080015160ff168c60400151141580611ac7575060808c01516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015611ac757508a60e0015161010001515b611ad15733611ad3565b305b604080516000815260208101918290527fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16909152611b1d9392919060248101613a51565b600060405180830381600087803b158015611b3757600080fd5b505af1158015611b4b573d6000803e3d6000fd5b505050508660e001516080015160ff16886040015103611bbb5760808801516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015611b9b57508660e0015161010001515b15611bb657828760c001818151611bb2919061386b565b9052505b611bee565b828760400151896040015181518110611bd657611bd66138c0565b60200260200101818151611bea919061386b565b9052505b828760000151896040015181518110611c0957611c096138c0565b60200260200101818151611c1d919061386b565b90525060c0880151602088015160408a015181518110611c3f57611c3f6138c0565b60200260200101818151611c53919061386b565b9052505050505050505050565b6000833560f81c855283611c7381613884565b945050833560f81c602086015283611c8a81613884565b94505081856020015110611ce05760405162461bcd60e51b815260206004820152600360248201527f355349000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b602085015160140283013560601c610120860152833560f81c604086015283611d0881613884565b94505081856040015110611d5e5760405162461bcd60e51b815260206004820152600360248201527f355449000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b604085015160140283013560601c6001600160a01b0316610140860152833560e81c6060860152611d9060038561386b565b9350833560f81c84611da181613884565b9550611daf90508582613501565b6080870152611dbe818661386b565b9450506000611dce853560f81c90565b905084611dda81613884565b9550611de890508582613501565b60a0870152611593818661386b565b61012082015161014083015160608401516040517f1698ee820000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015292909116602483015262ffffff166044820152731f98431c8ad98523631ae4a59f267346ea31f98490631698ee8290606401602060405180830381865afa158015611e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb19190613995565b6001600160a01b03166101608301819052611f105760405162461bcd60e51b81526004016101ce9060208082526004908201527f355a504100000000000000000000000000000000000000000000000000000000604082015260600190565b8060e001516060015160ff1682602001510361204257608082015160c083015260e0810151610120015115611f8157600061010083015260c08201516040820151602084015181518110611f6657611f666138c0565b60200260200101818151611f7a91906138d6565b9052505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168261012001516001600160a01b03160361202f578160c001518160a0015110611fe757600160e0830152600061010083015260c082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354353a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b600060e083015260016101008301525050565b806020015182602001518151811061205c5761205c6138c0565b6020026020010151816000015183602001518151811061207e5761207e6138c0565b6020026020010151836080015161209591906138e9565b61209f9190613900565b60c08301819052600060e084018190526101008401526040820151602084015181518110611f6657611f666138c0565b60008461014001516001600160a01b03168561012001516001600160a01b03161090508461016001516001600160a01b031663128acb088560e001516080015160ff16876040015114158061215657506101408701516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561215657508560e0015161010001515b6121605733612162565b305b838860c00151856121915761218c600173fffd8963efd1fc6a506488495d951d5263988d26613a7f565b6121a1565b6121a16401000276a36001613a9f565b6101208b01516101408c015160e08d01516101008e0151604080516001600160a01b0395861660208201529490931692840192909252151560608301521515608082015260a0016040516020818303038152906040526040518663ffffffff1660e01b8152600401612217959493929190613abf565b60408051808303816000875af1925050508015612251575060408051601f3d908101601f1916820190925261224e91810190613b04565b60015b6122a25761225d613b28565b806308c379a0036122965750612271613b7f565b8061227c5750612298565b8060405162461bcd60e51b81526004016101ce9190613c09565b505b3d6000803e3d6000fd5b82156122bd576101a0870181905261018087018290526122ce565b6101a0870182905261018087018190525b50505050505050565b8161018001518260c0015112156124545760008260c001518361018001516122ff9190613c1c565b90508160e001516060015160ff1683602001510361241f578160e0015161012001511561235d57808260400151846020015181518110612341576123416138c0565b6020026020010181815161235591906138d6565b905250612452565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168361012001516001600160a01b03160361241a57808260a00151106123ac57808260a00181815161235591906138d6565b60405162461bcd60e51b815260206004820152602360248201527f4354353a206d73672e76616c756520696e73756666696369656e74202861667460448201527f657229000000000000000000000000000000000000000000000000000000000060648201526084016101ce565b612452565b80826040015184602001518151811061243a5761243a6138c0565b6020026020010181815161244e91906138d6565b9052505b505b8060e001516080015160ff168260400151036124cf576101408201516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21480156124a157508060e0015161010001515b156124ca57816101a001516124b590613833565b8160c0018181516124c6919061386b565b9052505b612510565b816101a001516124de90613833565b81604001518360400151815181106124f8576124f86138c0565b6020026020010181815161250c919061386b565b9052505b816101a0015161251f90613833565b8151604084015181518110612536576125366138c0565b6020026020010181815161254a919061386b565b90525060a0820151602082015160408401518151811061256c5761256c6138c0565b60200260200101818151611f7a919061386b565b6000833560f81c85528361259381613884565b945050833560f81c6020860152836125aa81613884565b945050818560200151106125e95760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c60408601528361261981613884565b945050818560400151106126585760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c8461267a81613884565b955061268890508582613501565b60a0870152612697818661386b565b94505060006126a7853560f81c90565b9050846126b381613884565b95506126c190508582613501565b60c08701526126d0818661386b565b945050833560e08601526126e560208561386b565b95945050505050565b8060e001516060015160ff1682602001510361287a5760a082015161010083015260e081015161012001511561278957612746826060015173ba12222222228d8ba445958a75a0704d566bf2c884610100015161356c565b8161010001518160400151836020015181518110612766576127666138c0565b6020026020010181815161277a91906138d6565b90525060006101408301525050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031682606001516001600160a01b031603612831578161010001518160a00151106127e957600161014083015261010082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354363a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b6128468260600151333085610100015161102f565b61286e826060015173ba12222222228d8ba445958a75a0704d566bf2c884610100015161356c565b60006101408301525050565b8060200151826020015181518110612894576128946138c0565b602002602001015181600001518360200151815181106128b6576128b66138c0565b60200260200101518360a001516128cd91906138e9565b6128d79190613900565b610100830181905260608301516129039173ba12222222228d8ba445958a75a0704d566bf2c89061356c565b60006101408301526101008201516040820151602084015181518110611f6657611f666138c0565b6000808260e001516080015160ff1684604001511461294f578360800151306129ac565b60808401516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561298557508260e0015161010001515b612994578360800151336129ac565b83516002166129a8578360800151306129ac565b6000335b91509150600073ba12222222228d8ba445958a75a0704d566bf2c86001600160a01b03166352bbbe298661014001516129e65760006129ed565b8661010001515b6040805160c0810190915260e089015181526020810160008152602001896101400151612a1e578960600151612a21565b60005b6001600160a01b039081168252881660208201526101008a0151604082015260600160006040519080825280601f01601f191660200182016040528015612a6f576020820181803683370190505b509052604080516080810182523081526000602082018190526001600160a01b038916928201929092526060810182905290612aad426103e861386b565b6040518663ffffffff1660e01b8152600401612acc9493929190613c3c565b60206040518083038185885af1158015612aea573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612b0f9190613d1c565b90508360e001516080015160ff16856040015103612b8f5760808501516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015612b5d57508360e0015161010001515b8015612b6b57508451600216155b15612b8a57808460c001818151612b82919061386b565b905250612bc2565b612bc2565b808460400151866040015181518110612baa57612baa6138c0565b60200260200101818151612bbe919061386b565b9052505b808460000151866040015181518110612bdd57612bdd6138c0565b60200260200101818151612bf1919061386b565b90525060c08501516020850151604087015181518110612c1357612c136138c0565b60200260200101818151612c27919061386b565b90525061012090940193909352505050565b6000833560f81c855283612c4c81613884565b945050833560f81c602086015283612c6381613884565b94505081856020015110612ca25760405162461bcd60e51b81526004016101ce90602080825260049082015263314c534960e01b604082015260600190565b602085015160140283013560601c6001600160a01b03166060860152833560f81c604086015283612cd281613884565b94505081856040015110612d115760405162461bcd60e51b81526004016101ce90602080825260049082015263314c544960e01b604082015260600190565b604085015160140283013560601c6080860152833560f81c84612d3381613884565b9550612d4190508582613501565b60a0870152612d50818661386b565b9450506000612d60853560f81c90565b905084612d6c81613884565b9550612d7a90508582613501565b60c0870152612d89818661386b565b803560601c60e08801529450612da2905060148561386b565b9350833560f81c61010086015283612db981613884565b945050833560f81c6101208601528361159381613884565b8060e001516060015160ff16826020015103612f225760a082015161014083015260e0810151610120015115612e4157612e1982606001518360e0015184610140015161356c565b60006101808301526101408201516040820151602084015181518110611f6657611f666138c0565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031682606001516001600160a01b031603612ee9578161014001518160a0015110612ea157600161018083015261014082015160a082018051611f7a9083906138d6565b60405162461bcd60e51b815260206004820152601b60248201527f4354373a206d73672e76616c756520696e73756666696369656e74000000000060448201526064016101ce565b612efe8260600151333085610140015161102f565b612f1682606001518360e0015184610140015161356c565b60006101808301525050565b8060200151826020015181518110612f3c57612f3c6138c0565b60200260200101518160000151836020015181518110612f5e57612f5e6138c0565b60200260200101518360a00151612f7591906138e9565b612f7f9190613900565b6101408301819052606083015160e0840151612e199261356c565b600080600073d51a44d3fae010294c616388b506acda1bfaae466001600160a01b03168560e001516001600160a01b0316036132845760808501516001600160a01b031673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561300e57508360e001516080015160ff168560400151145b801561302057508360e0015161010001515b156130d75760e08501516101008601516101208701516101408801516040517f394747c500000000000000000000000000000000000000000000000000000000815260048101939093526024830191909152604482015260006064820152600160848201524793506001600160a01b039091169063394747c59060a401600060405180830381600087803b1580156130b757600080fd5b505af11580156130cb573d6000803e3d6000fd5b50505050479050613444565b60808501516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015613121573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131459190613d1c565b91508460e001516001600160a01b031663394747c586610180015161316b576000613172565b8661014001515b6101008801516101208901516101408a01516101808b01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152600481019490945260248401929092526044830152600060648301521515608482015260a4016000604051808303818588803b1580156131f557600080fd5b505af1158015613209573d6000803e3d6000fd5b50505060808701516040516370a0823160e01b81523060048201526001600160a01b0390911692506370a0823191506024015b602060405180830381865afa158015613259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061327d9190613d1c565b9050613444565b73bebc44782c7db0a1a60cb6fe97d0b483032ff1c76001600160a01b03168560e001516001600160a01b0316036133fc5760808501516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156132ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133239190613d1c565b60e08601516101008701516101208801516101408901516040517f3df02124000000000000000000000000000000000000000000000000000000008152600f93840b60048201529190920b60248201526044810191909152600060648201529193506001600160a01b031690633df0212490608401600060405180830381600087803b1580156133b257600080fd5b505af11580156133c6573d6000803e3d6000fd5b50505060808601516040516370a0823160e01b81523060048201526001600160a01b0390911691506370a082319060240161323c565b60405162461bcd60e51b815260206004820152601560248201527f756e737570706f72746564204375727665506f6f6c000000000000000000000060448201526064016101ce565b600061345083836138d6565b90508086610160018181525050808560400151876040015181518110613478576134786138c0565b6020026020010181815161348c919061386b565b9052508451604087015181518392919081106134aa576134aa6138c0565b602002602001018181516134be919061386b565b90525060c086015160208601516040880151815181106134e0576134e06138c0565b602002602001018181516134f4919061386b565b9052509295945050505050565b60008060036135118460206138d6565b943594901b9390931c9392505050565b60008061352e83856138e9565b61353a906103e56138e9565b9050600061354a846103e56138e9565b613556876103e86138e9565b613560919061386b565b90506115938183613900565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916135e19190613946565b6000604051808303816000865af19150503d806000811461361e576040519150601f19603f3d011682016040523d82523d6000602084013e613623565b606091505b509150915081801561364d57508051158061364d57508080602001905181019061364d9190613962565b6112995760405162461bcd60e51b815260206004820152600260248201527f534100000000000000000000000000000000000000000000000000000000000060448201526064016101ce565b6001600160a01b03811681146136ae57600080fd5b50565b6000602082840312156136c357600080fd5b81356136ce81613699565b9392505050565b60008083601f8401126136e757600080fd5b50813567ffffffffffffffff8111156136ff57600080fd5b60208301915083602082850101111561371757600080fd5b9250929050565b6000806020838503121561373157600080fd5b823567ffffffffffffffff81111561374857600080fd5b613754858286016136d5565b90969095509350505050565b6000806000806060858703121561377657600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561379b57600080fd5b6137a7878288016136d5565b95989497509550505050565b80151581146136ae57600080fd5b600080600080608085870312156137d757600080fd5b84356137e281613699565b935060208501356137f281613699565b92506040850135613802816137b3565b91506060850135613812816137b3565b939692955090935050565b634e487b7160e01b600052601160045260246000fd5b60007f800000000000000000000000000000000000000000000000000000000000000082036138645761386461381d565b5060000390565b8082018082111561387e5761387e61381d565b92915050565b6000600182016138965761389661381d565b5060010190565b60ff81811683821602908116908181146138b9576138b961381d565b5092915050565b634e487b7160e01b600052603260045260246000fd5b8181038181111561387e5761387e61381d565b808202811582820484141761387e5761387e61381d565b60008261391d57634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561393d578181015183820152602001613925565b50506000910152565b60008251613958818460208701613922565b9190910192915050565b60006020828403121561397457600080fd5b81516136ce816137b3565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156139a757600080fd5b81516136ce81613699565b80516dffffffffffffffffffffffffffff811681146139d057600080fd5b919050565b6000806000606084860312156139ea57600080fd5b6139f3846139b2565b9250613a01602085016139b2565b9150604084015163ffffffff81168114613a1a57600080fd5b809150509250925092565b60008151808452613a3d816020860160208601613922565b601f01601f19169290920160200192915050565b8481528360208201526001600160a01b03831660408201526080606082015260006115936080830184613a25565b6001600160a01b038281168282160390808211156138b9576138b961381d565b6001600160a01b038181168382160190808211156138b9576138b961381d565b60006001600160a01b038088168352861515602084015285604084015280851660608401525060a06080830152613af960a0830184613a25565b979650505050505050565b60008060408385031215613b1757600080fd5b505080516020909101519092909150565b600060033d1115613b415760046000803e5060005160e01c5b90565b601f8201601f1916810167ffffffffffffffff81118282101715613b7857634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d1015613b8d5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715613bbd57505050505090565b8285019150815181811115613bd55750505050505090565b843d8701016020828501011115613bef5750505050505090565b613bfe60208286010187613b44565b509095945050505050565b6020815260006136ce6020830184613a25565b81810360008312801583831316838312821617156138b9576138b961381d565b60e08152845160e08201526000602086015160028110613c6c57634e487b7160e01b600052602160045260246000fd5b61010083015260408601516001600160a01b03166101208301526060860151613ca16101408401826001600160a01b03169052565b50608086015161016083015260a086015160c0610180840152613cc86101a0840182613a25565b915050613d0a60208301866001600160a01b03808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b60a082019390935260c0015292915050565b600060208284031215613d2e57600080fd5b505191905056fea264697066735822122009d5bcab1b7a34a01b154a1c713c4d72a303f822d21cf7923a9248e85545752a64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.