Transactions
Token Transfers
Internal Transactions
Coin Balance History
Code
Read Contract
Write Contract
- Contract name:
- Router02
- Optimization enabled
- false
- Compiler version
- v0.6.12+commit.27d51765
- EVM Version
- default
- Verified at
- 2022-04-14T10:42:07.732053Z
Constructor Arguments
0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f9
Arg [0] (address) : 0x2ef06a90b0e7ae3ae508e83ea6628a3987945460
Arg [1] (address) : 0xae83571000af4499798d1e3b0fa0070eb3a3e3f9
Contract source code
// Sources flattened with hardhat v2.7.0 https://hardhat.org // File contracts/interfaces/IFactory.sol pragma solidity ^0.6.0; interface IFactory { 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; } // File contracts/libraries/TransferHelper.sol pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferADA(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ADA_TRANSFER_FAILED'); } } // File contracts/interfaces/IRouter01.sol pragma solidity ^0.6.0; interface IRouter01 { function factory() external pure returns (address); function WADA() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityADA( address token, uint amountTokenDesired, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountADA, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityADA( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) external returns (uint amountToken, uint amountADA); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityADAWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountADA); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactADAForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactADA(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForADA (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapADAForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } // File contracts/interfaces/IRouter02.sol pragma solidity ^0.6.0; interface IRouter02 is IRouter01 { function removeLiquidityADASupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) external returns (uint amountADA); function removeLiquidityADAWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountADA); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactADAForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForADASupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } // File contracts/interfaces/IPair.sol pragma solidity ^0.6.0; interface IPair { 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; } // File contracts/libraries/SafeMath.sol pragma solidity ^0.6.0; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'ds-math-add-overflow'); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, 'ds-math-sub-underflow'); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); } } // File contracts/libraries/Library.sol pragma solidity ^0.6.0; library Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'0103d86123641edae209ed992b2bf060ae2baab6a28f5b1eb7dad61335915104' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IPair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } } // File contracts/interfaces/IERC20.sol pragma solidity >=0.6.0; interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view 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); } // File contracts/interfaces/IWADA.sol pragma solidity ^0.6.0; interface IWADA { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } // File contracts/Router02.sol pragma solidity ^0.6.0; contract Router02 is IRouter02 { using SafeMath for uint; address public immutable override factory; address public immutable override WADA; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'DEXRouter: EXPIRED'); _; } constructor(address _factory, address _WADA) public { factory = _factory; WADA = _WADA; } receive() external payable { assert(msg.sender == WADA); // only accept ADA via fallback from the WADA contract } // **** ADD LIQUIDITY **** function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { // create the pair if it doesn't exist yet if (IFactory(factory).getPair(tokenA, tokenB) == address(0)) { IFactory(factory).createPair(tokenA, tokenB); } (uint reserveA, uint reserveB) = Library.getReserves(factory, tokenA, tokenB); if (reserveA == 0 && reserveB == 0) { /* If both the reserves are 0, i.e. there is no binding ratio, then we can deposit the desired amounts */ (amountA, amountB) = (amountADesired, amountBDesired); } else { uint amountBOptimal = Library.quote(amountADesired, reserveA, reserveB); if (amountBOptimal <= amountBDesired) { require(amountBOptimal >= amountBMin, 'DEXRouter: INSUFFICIENT_B_AMOUNT'); (amountA, amountB) = (amountADesired, amountBOptimal); } else { uint amountAOptimal = Library.quote(amountBDesired, reserveB, reserveA); assert(amountAOptimal <= amountADesired); require(amountAOptimal >= amountAMin, 'DEXRouter: INSUFFICIENT_A_AMOUNT'); (amountA, amountB) = (amountAOptimal, amountBDesired); } } } function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); address pair = Library.pairFor(factory, tokenA, tokenB); TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); liquidity = IPair(pair).mint(to); } function addLiquidityADA( address token, uint amountTokenDesired, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountADA, uint liquidity) { (amountToken, amountADA) = _addLiquidity( token, WADA, amountTokenDesired, msg.value, amountTokenMin, amountADAMin ); address pair = Library.pairFor(factory, token, WADA); TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); IWADA(WADA).deposit{value: amountADA}(); assert(IWADA(WADA).transfer(pair, amountADA)); liquidity = IPair(pair).mint(to); // refund dust ada, if any if (msg.value > amountADA) TransferHelper.safeTransferADA(msg.sender, msg.value - amountADA); } // **** REMOVE LIQUIDITY **** function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { address pair = Library.pairFor(factory, tokenA, tokenB); IPair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair (uint amount0, uint amount1) = IPair(pair).burn(to); (address token0,) = Library.sortTokens(tokenA, tokenB); (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); require(amountA >= amountAMin, 'DEXRouter: INSUFFICIENT_A_AMOUNT'); require(amountB >= amountBMin, 'DEXRouter: INSUFFICIENT_B_AMOUNT'); } function removeLiquidityADA( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountToken, uint amountADA) { (amountToken, amountADA) = removeLiquidity( token, WADA, liquidity, amountTokenMin, amountADAMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, amountToken); IWADA(WADA).withdraw(amountADA); TransferHelper.safeTransferADA(to, amountADA); } function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountA, uint amountB) { address pair = Library.pairFor(factory, tokenA, tokenB); uint value = approveMax ? uint(-1) : liquidity; IPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); } function removeLiquidityADAWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountToken, uint amountADA) { address pair = Library.pairFor(factory, token, WADA); uint value = approveMax ? uint(-1) : liquidity; IPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountToken, amountADA) = removeLiquidityADA(token, liquidity, amountTokenMin, amountADAMin, to, deadline); } // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) **** function removeLiquidityADASupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountADA) { (, amountADA) = removeLiquidity( token, WADA, liquidity, amountTokenMin, amountADAMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this))); IWADA(WADA).withdraw(amountADA); TransferHelper.safeTransferADA(to, amountADA); } function removeLiquidityADAWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountADAMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountADA) { address pair = Library.pairFor(factory, token, WADA); uint value = approveMax ? uint(-1) : liquidity; IPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); amountADA = removeLiquidityADASupportingFeeOnTransferTokens( token, liquidity, amountTokenMin, amountADAMin, to, deadline ); } // **** SWAP **** // requires the initial amount to have already been sent to the first pair function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = Library.sortTokens(input, output); uint amountOut = amounts[i + 1]; (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); address to = i < path.length - 2 ? Library.pairFor(factory, output, path[i + 2]) : _to; IPair(Library.pairFor(factory, input, output)).swap( amount0Out, amount1Out, to, new bytes(0) ); } } function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) returns (uint[] memory amounts) { amounts = Library.getAmountsOut(factory, amountIn, path); require(amounts[amounts.length - 1] >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) returns (uint[] memory amounts) { amounts = Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= amountInMax, 'DEXRouter: EXCESSIVE_INPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapExactADAForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WADA, 'DEXRouter: INVALID_PATH'); amounts = Library.getAmountsOut(factory, msg.value, path); require(amounts[amounts.length - 1] >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT'); IWADA(WADA).deposit{value: amounts[0]}(); assert(IWADA(WADA).transfer(Library.pairFor(factory, path[0], path[1]), amounts[0])); _swap(amounts, path, to); } function swapTokensForExactADA(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external virtual override ensure(deadline) returns (uint[] memory amounts) { require(path[path.length - 1] == WADA, 'DEXRouter: INVALID_PATH'); amounts = Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= amountInMax, 'DEXRouter: EXCESSIVE_INPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWADA(WADA).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferADA(to, amounts[amounts.length - 1]); } function swapExactTokensForADA(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external virtual override ensure(deadline) returns (uint[] memory amounts) { require(path[path.length - 1] == WADA, 'DEXRouter: INVALID_PATH'); amounts = Library.getAmountsOut(factory, amountIn, path); require(amounts[amounts.length - 1] >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWADA(WADA).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferADA(to, amounts[amounts.length - 1]); } function swapADAForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WADA, 'DEXRouter: INVALID_PATH'); amounts = Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= msg.value, 'DEXRouter: EXCESSIVE_INPUT_AMOUNT'); IWADA(WADA).deposit{value: amounts[0]}(); assert(IWADA(WADA).transfer(Library.pairFor(factory, path[0], path[1]), amounts[0])); _swap(amounts, path, to); // refund dust ada, if any if (msg.value > amounts[0]) TransferHelper.safeTransferADA(msg.sender, msg.value - amounts[0]); } // **** SWAP (supporting fee-on-transfer tokens) **** // requires the initial amount to have already been sent to the first pair function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = Library.sortTokens(input, output); IPair pair = IPair(Library.pairFor(factory, input, output)); uint amountInput; uint amountOutput; { // scope to avoid stack too deep errors (uint reserve0, uint reserve1,) = pair.getReserves(); (uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0); amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput); amountOutput = Library.getAmountOut(amountInput, reserveInput, reserveOutput); } (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0)); address to = i < path.length - 2 ? Library.pairFor(factory, output, path[i + 2]) : _to; pair.swap(amount0Out, amount1Out, to, new bytes(0)); } } function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) { TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amountIn ); uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); require( IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT' ); } function swapExactADAForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override payable ensure(deadline) { require(path[0] == WADA, 'DEXRouter: INVALID_PATH'); uint amountIn = msg.value; IWADA(WADA).deposit{value: amountIn}(); assert(IWADA(WADA).transfer(Library.pairFor(factory, path[0], path[1]), amountIn)); uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); require( IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT' ); } function swapExactTokensForADASupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) { require(path[path.length - 1] == WADA, 'DEXRouter: INVALID_PATH'); TransferHelper.safeTransferFrom( path[0], msg.sender, Library.pairFor(factory, path[0], path[1]), amountIn ); _swapSupportingFeeOnTransferTokens(path, address(this)); uint amountOut = IERC20(WADA).balanceOf(address(this)); require(amountOut >= amountOutMin, 'DEXRouter: INSUFFICIENT_OUTPUT_AMOUNT'); IWADA(WADA).withdraw(amountOut); TransferHelper.safeTransferADA(to, amountOut); } // **** LIBRARY FUNCTIONS **** function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return Library.quote(amountA, reserveA, reserveB); } function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) public pure virtual override returns (uint amountOut) { return Library.getAmountOut(amountIn, reserveIn, reserveOut); } function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) public pure virtual override returns (uint amountIn) { return Library.getAmountIn(amountOut, reserveIn, reserveOut); } function getAmountsOut(uint amountIn, address[] memory path) public view virtual override returns (uint[] memory amounts) { return Library.getAmountsOut(factory, amountIn, path); } function getAmountsIn(uint amountOut, address[] memory path) public view virtual override returns (uint[] memory amounts) { return Library.getAmountsIn(factory, amountOut, path); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_WADA","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"WADA","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"},{"type":"uint256","name":"liquidity","internalType":"uint256"}],"name":"addLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"amountADesired","internalType":"uint256"},{"type":"uint256","name":"amountBDesired","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountADA","internalType":"uint256"},{"type":"uint256","name":"liquidity","internalType":"uint256"}],"name":"addLiquidityADA","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amountTokenDesired","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountADAMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getAmountIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"quote","inputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"reserveA","internalType":"uint256"},{"type":"uint256","name":"reserveB","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountADA","internalType":"uint256"}],"name":"removeLiquidityADA","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountADAMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountADA","internalType":"uint256"}],"name":"removeLiquidityADASupportingFeeOnTransferTokens","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountADAMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountADA","internalType":"uint256"}],"name":"removeLiquidityADAWithPermit","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountADAMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountADA","internalType":"uint256"}],"name":"removeLiquidityADAWithPermitSupportingFeeOnTransferTokens","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountADAMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidityWithPermit","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapADAForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactADAForTokens","inputs":[{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"swapExactADAForTokensSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForADA","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swapExactTokensForADASupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactADA","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
Deployed ByteCode
0x60806040526004361061014f5760003560e01c8063ad615dec116100b6578063d879be9b1161006f578063d879be9b14610f4d578063dd3808c41461104f578063e0f6de2214611168578063e5bb3fcd1461126a578063e8e337001461132e578063fef739e814611414576101ab565b8063ad615dec14610aeb578063baa2abde14610b4e578063bd92cadd14610c22578063c45a015514610ccf578063c652c01014610d10578063d06ca61f14610e29576101ab565b80634d763801116101085780634d763801146106da5780635c11d7951461078857806381f5da1f1461084c57806385f8c2591461092e5780638803dbee146109915780638adee51814610aaa576101ab565b8063054d50d4146101b05780631f00ca74146102135780632195995c1461033757806329d119fe146104395780632ec317881461051457806338ed1739146105c1576101ab565b366101ab577f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101a957fe5b005b600080fd5b3480156101bc57600080fd5b506101fd600480360360608110156101d357600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506114c8565b6040518082815260200191505060405180910390f35b34801561021f57600080fd5b506102e06004803603604081101561023657600080fd5b81019080803590602001909291908035906020019064010000000081111561025d57600080fd5b82018360208201111561026f57600080fd5b8035906020019184602083028401116401000000008311171561029157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506114de565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610323578082015181840152602081019050610308565b505050509050019250505060405180910390f35b34801561034357600080fd5b5061041c600480360361016081101561035b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803515159060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050611513565b604051808381526020018281526020019250505060405180910390f35b34801561044557600080fd5b506104fe600480360361014081101561045d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803515159060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050611669565b6040518082815260200191505060405180910390f35b34801561052057600080fd5b506105ab600480360360c081101561053757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117d4565b6040518082815260200191505060405180910390f35b3480156105cd57600080fd5b50610683600480360360a08110156105e457600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561061557600080fd5b82018360208201111561062757600080fd5b8035906020019184602083028401116401000000008311171561064957600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119ce565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c65780820151818401526020810190506106ab565b505050509050019250505060405180910390f35b610764600480360360c08110156106f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c41565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561079457600080fd5b5061084a600480360360a08110156107ab57600080fd5b810190808035906020019092919080359060200190929190803590602001906401000000008111156107dc57600080fd5b8201836020820111156107ee57600080fd5b8035906020019184602083028401116401000000008311171561081057600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f6a565b005b34801561085857600080fd5b50610911600480360361014081101561087057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803515159060200190929190803560ff16906020019092919080359060200190929190803590602001909291905050506122f5565b604051808381526020018281526020019250505060405180910390f35b34801561093a57600080fd5b5061097b6004803603606081101561095157600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050612469565b6040518082815260200191505060405180910390f35b34801561099d57600080fd5b50610a53600480360360a08110156109b457600080fd5b810190808035906020019092919080359060200190929190803590602001906401000000008111156109e557600080fd5b8201836020820111156109f757600080fd5b80359060200191846020830284011164010000000083111715610a1957600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061247f565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a96578082015181840152602081019050610a7b565b505050509050019250505060405180910390f35b348015610ab657600080fd5b50610abf6126ef565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610af757600080fd5b50610b3860048036036060811015610b0e57600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050612713565b6040518082815260200191505060405180910390f35b348015610b5a57600080fd5b50610c05600480360360e0811015610b7157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612729565b604051808381526020018281526020019250505060405180910390f35b610ccd60048036036080811015610c3857600080fd5b810190808035906020019092919080359060200190640100000000811115610c5f57600080fd5b820183602082011115610c7157600080fd5b80359060200191846020830284011164010000000083111715610c9357600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612aa2565b005b348015610cdb57600080fd5b50610ce461303a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610d1c57600080fd5b50610dd2600480360360a0811015610d3357600080fd5b81019080803590602001909291908035906020019092919080359060200190640100000000811115610d6457600080fd5b820183602082011115610d7657600080fd5b80359060200191846020830284011164010000000083111715610d9857600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061305e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610e15578082015181840152602081019050610dfa565b505050509050019250505060405180910390f35b348015610e3557600080fd5b50610ef660048036036040811015610e4c57600080fd5b810190808035906020019092919080359060200190640100000000811115610e7357600080fd5b820183602082011115610e8557600080fd5b80359060200191846020830284011164010000000083111715610ea757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050613480565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610f39578082015181840152602081019050610f1e565b505050509050019250505060405180910390f35b610ff860048036036080811015610f6357600080fd5b810190808035906020019092919080359060200190640100000000811115610f8a57600080fd5b820183602082011115610f9c57600080fd5b80359060200191846020830284011164010000000083111715610fbe57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506134b5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561103b578082015181840152602081019050611020565b505050509050019250505060405180910390f35b34801561105b57600080fd5b50611111600480360360a081101561107257600080fd5b810190808035906020019092919080359060200190929190803590602001906401000000008111156110a357600080fd5b8201836020820111156110b557600080fd5b803590602001918460208302840111640100000000831117156110d757600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061397d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015611154578082015181840152602081019050611139565b505050509050019250505060405180910390f35b6112136004803603608081101561117e57600080fd5b8101908080359060200190929190803590602001906401000000008111156111a557600080fd5b8201836020820111156111b757600080fd5b803590602001918460208302840111640100000000831117156111d957600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613da2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561125657808201518184015260208101905061123b565b505050509050019250505060405180910390f35b34801561127657600080fd5b5061132c600480360360a081101561128d57600080fd5b810190808035906020019092919080359060200190929190803590602001906401000000008111156112be57600080fd5b8201836020820111156112d057600080fd5b803590602001918460208302840111640100000000831117156112f257600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614230565b005b34801561133a57600080fd5b506113f0600480360361010081101561135257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614650565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561142057600080fd5b506114ab600480360360c081101561143757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506147df565b604051808381526020018281526020019250505060405180910390f35b60006114d584848461493c565b90509392505050565b606061150b7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608484614a89565b905092915050565b60008060006115437f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608f8f614c09565b9050600087611552578c611574565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b90508173ffffffffffffffffffffffffffffffffffffffff1663d505accf3330848d8c8c8c6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff168152602001838152602001828152602001975050505050505050600060405180830381600087803b15801561162857600080fd5b505af115801561163c573d6000803e3d6000fd5b5050505061164f8f8f8f8f8f8f8f612729565b809450819550505050509b509b9950505050505050505050565b6000806116b77f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608d7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f9614c09565b90506000866116c6578b6116e8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b90508173ffffffffffffffffffffffffffffffffffffffff1663d505accf3330848c8b8b8b6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff168152602001838152602001828152602001975050505050505050600060405180830381600087803b15801561179c57600080fd5b505af11580156117b0573d6000803e3d6000fd5b505050506117c28d8d8d8d8d8d6117d4565b925050509a9950505050505050505050565b6000814281101561184d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b61187c887f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f98989893089612729565b90508092505061192e88858a73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118ee57600080fd5b505afa158015611902573d6000803e3d6000fd5b505050506040513d602081101561191857600080fd5b8101908080519060200190929190505050614d22565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156119a157600080fd5b505af11580156119b5573d6000803e3d6000fd5b505050506119c38483614f05565b509695505050505050565b60608142811015611a47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b611ab37f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546089888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050615064565b91508682600184510381518110611ac657fe5b60200260200101511015611b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b611bea86866000818110611b3557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1633611bd07f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608a8a6000818110611b8457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b6001818110611bae57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b85600081518110611bdd57fe5b60200260200101516151dc565b611c3682878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050866153c1565b509695505050505050565b60008060008342811015611cbd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b611ceb8a7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f98b348c8c615656565b80945081955050506000611d407f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608c7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f9614c09565b9050611d4e8b3383886151dc565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b158015611db657600080fd5b505af1158015611dca573d6000803e3d6000fd5b50505050507f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e6057600080fd5b505af1158015611e74573d6000803e3d6000fd5b505050506040513d6020811015611e8a57600080fd5b8101908080519060200190929190505050611ea157fe5b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f0a57600080fd5b505af1158015611f1e573d6000803e3d6000fd5b505050506040513d6020811015611f3457600080fd5b8101908080519060200190929190505050925083341115611f5c57611f5b33853403614f05565b5b505096509650969350505050565b8042811015611fe1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b61209285856000818110611ff157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361208c7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608989600081811061204057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061206a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8a6151dc565b60008585600188889050038181106120a657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561212957600080fd5b505afa15801561213d573d6000803e3d6000fd5b505050506040513d602081101561215357600080fd5b810190808051906020019092919050505090506121b1868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050856159ec565b8661229482888860018b8b9050038181106121c857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561224b57600080fd5b505afa15801561225f573d6000803e3d6000fd5b505050506040513d602081101561227557600080fd5b8101908080519060200190929190505050615e3790919063ffffffff16565b10156122eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b5050505050505050565b60008060006123457f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608e7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f9614c09565b9050600087612354578c612376565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b90508173ffffffffffffffffffffffffffffffffffffffff1663d505accf3330848d8c8c8c6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff168152602001838152602001828152602001975050505050505050600060405180830381600087803b15801561242a57600080fd5b505af115801561243e573d6000803e3d6000fd5b505050506124508e8e8e8e8e8e6147df565b809450819550505050509a509a98505050505050505050565b6000612476848484615eba565b90509392505050565b606081428110156124f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b6125647f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546089888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050614a89565b9150868260008151811061257457fe5b602002602001015111156125d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061652a6021913960400191505060405180910390fd5b612698868660008181106125e357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361267e7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608a8a600081811061263257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b600181811061265c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8560008151811061268b57fe5b60200260200101516151dc565b6126e482878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050866153c1565b509695505050505050565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f981565b6000612720848484616014565b90509392505050565b60008082428110156127a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b60006127d07f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608c8c614c09565b90508073ffffffffffffffffffffffffffffffffffffffff166323b872dd33838c6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561286157600080fd5b505af1158015612875573d6000803e3d6000fd5b505050506040513d602081101561288b57600080fd5b8101908080519060200190929190505050506000808273ffffffffffffffffffffffffffffffffffffffff166389afcb44896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1681526020019150506040805180830381600087803b15801561290857600080fd5b505af115801561291c573d6000803e3d6000fd5b505050506040513d604081101561293257600080fd5b81019080805190602001909291908051906020019092919050505091509150600061295d8e8e616132565b5090508073ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff161461299a57818361299d565b82825b80975081985050508a871015612a1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f444558526f757465723a20494e53554646494349454e545f415f414d4f554e5481525060200191505060405180910390fd5b89861015612a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f444558526f757465723a20494e53554646494349454e545f425f414d4f554e5481525060200191505060405180910390fd5b505050505097509795505050505050565b8042811015612b19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1685856000818110612b5d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612c03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b60003490507f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015612c7057600080fd5b505af1158015612c84573d6000803e3d6000fd5b50505050507f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612d427f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546089896000818110612cf657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a6001818110612d2057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612d9657600080fd5b505af1158015612daa573d6000803e3d6000fd5b505050506040513d6020811015612dc057600080fd5b8101908080519060200190929190505050612dd757fe5b6000868660018989905003818110612deb57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612e6e57600080fd5b505afa158015612e82573d6000803e3d6000fd5b505050506040513d6020811015612e9857600080fd5b81019080805190602001909291905050509050612ef6878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050866159ec565b87612fd982898960018c8c905003818110612f0d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612f9057600080fd5b505afa158015612fa4573d6000803e3d6000fd5b505050506040513d6020811015612fba57600080fd5b8101908080519060200190929190505050615e3790919063ffffffff16565b1015613030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b5050505050505050565b7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546081565b606081428110156130d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1686866001898990500381811061312057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146131c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b6132327f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546089888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050614a89565b9150868260008151811061324257fe5b602002602001015111156132a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061652a6021913960400191505060405180910390fd5b613366868660008181106132b157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361334c7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608a8a600081811061330057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b600181811061332a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8560008151811061335957fe5b60200260200101516151dc565b6133b282878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050306153c1565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836001855103815181106133fe57fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561343c57600080fd5b505af1158015613450573d6000803e3d6000fd5b50505050613475848360018551038151811061346857fe5b6020026020010151614f05565b509695505050505050565b60606134ad7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608484615064565b905092915050565b6060814281101561352e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff168686600081811061357257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613618576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b6136847f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546088888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050614a89565b9150348260008151811061369457fe5b602002602001015111156136f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061652a6021913960400191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061373c57fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561376f57600080fd5b505af1158015613783573d6000803e3d6000fd5b50505050507f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6138417f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460898960008181106137f557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061381f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8460008151811061384e57fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156138a957600080fd5b505af11580156138bd573d6000803e3d6000fd5b505050506040513d60208110156138d357600080fd5b81019080805190602001909291905050506138ea57fe5b61393682878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050866153c1565b8160008151811061394357fe5b602002602001015134111561397357613972338360008151811061396357fe5b60200260200101513403614f05565b5b5095945050505050565b606081428110156139f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16868660018989905003818110613a3f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613ae5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b613b517f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546089888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050615064565b91508682600184510381518110613b6457fe5b60200260200101511015613bc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b613c8886866000818110613bd357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1633613c6e7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608a8a6000818110613c2257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b6001818110613c4c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b85600081518110613c7b57fe5b60200260200101516151dc565b613cd482878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050306153c1565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d83600185510381518110613d2057fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015613d5e57600080fd5b505af1158015613d72573d6000803e3d6000fd5b50505050613d978483600185510381518110613d8a57fe5b6020026020010151614f05565b509695505050505050565b60608142811015613e1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1686866000818110613e5f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613f05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b613f717f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546034888880806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050615064565b91508682600184510381518110613f8457fe5b60200260200101511015613fe3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061402c57fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561405f57600080fd5b505af1158015614073573d6000803e3d6000fd5b50505050507f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6141317f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460898960008181106140e557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061410f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8460008151811061413e57fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561419957600080fd5b505af11580156141ad573d6000803e3d6000fd5b505050506040513d60208110156141c357600080fd5b81019080805190602001909291905050506141da57fe5b61422682878780806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050866153c1565b5095945050505050565b80428110156142a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff168585600188889050038181106142f057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614396576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f444558526f757465723a20494e56414c49445f5041544800000000000000000081525060200191505060405180910390fd5b614447858560008181106143a657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16336144417f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460898960008181106143f557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061441f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16614c09565b8a6151dc565b614492858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050306159ec565b60007f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561451b57600080fd5b505afa15801561452f573d6000803e3d6000fd5b505050506040513d602081101561454557600080fd5b81019080805190602001909291905050509050868110156145b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061654b6025913960400191505060405180910390fd5b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561462457600080fd5b505af1158015614638573d6000803e3d6000fd5b505050506146468482614f05565b5050505050505050565b600080600083428110156146cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b6146da8c8c8c8c8c8c615656565b8094508195505050600061470f7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608e8e614c09565b905061471d8d3383886151dc565b6147298c3383876151dc565b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561479257600080fd5b505af11580156147a6573d6000803e3d6000fd5b505050506040513d60208110156147bc57600080fd5b810190808051906020019092919050505092505050985098509895505050505050565b6000808242811015614859576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f444558526f757465723a2045585049524544000000000000000000000000000081525060200191505060405180910390fd5b614888897f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f98a8a8a308a612729565b809350819450505061489b898685614d22565b7f000000000000000000000000ae83571000af4499798d1e3b0fa0070eb3a3e3f973ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561490e57600080fd5b505af1158015614922573d6000803e3d6000fd5b505050506149308583614f05565b50965096945050505050565b6000808411614996576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806165086022913960400191505060405180910390fd5b6000831180156149a65750600082115b614a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c6962726172793a20494e53554646494349454e545f4c49515549444954590081525060200191505060405180910390fd5b6000614a2f6103e5866162c690919063ffffffff16565b90506000614a4684836162c690919063ffffffff16565b90506000614a7183614a636103e8896162c690919063ffffffff16565b61635b90919063ffffffff16565b9050808281614a7c57fe5b0493505050509392505050565b6060600282511015614b03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4c6962726172793a20494e56414c49445f50415448000000000000000000000081525060200191505060405180910390fd5b815167ffffffffffffffff81118015614b1b57600080fd5b50604051908082528060200260200182016040528015614b4a5781602001602082028036833780820191505090505b5090508281600183510381518110614b5e57fe5b6020026020010181815250506000600183510390505b6000811115614c0157600080614bb487866001860381518110614b9357fe5b6020026020010151878681518110614ba757fe5b60200260200101516163de565b91509150614bd6848481518110614bc757fe5b60200260200101518383615eba565b846001850381518110614be557fe5b6020026020010181815250505050808060019003915050614b74565b509392505050565b6000806000614c188585616132565b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807f0103d86123641edae209ed992b2bf060ae2baab6a28f5b1eb7dad61335915104815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310614de55780518252602082019150602081019050602083039250614dc2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114614e47576040519150601f19603f3d011682016040523d82523d6000602084013e614e4c565b606091505b5091509150818015614e8c5750600081511480614e8b5750808060200190516020811015614e7957600080fd5b81019080805190602001909291905050505b5b614efe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657248656c7065723a205452414e534645525f4641494c45440081525060200191505060405180910390fd5b5050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff81118015614f3757600080fd5b506040519080825280601f01601f191660200182016040528015614f6a5781602001600182028036833780820191505090505b506040518082805190602001908083835b60208310614f9e5780518252602082019150602081019050602083039250614f7b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615000576040519150601f19603f3d011682016040523d82523d6000602084013e615005565b606091505b505090508061505f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806165706023913960400191505060405180910390fd5b505050565b60606002825110156150de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4c6962726172793a20494e56414c49445f50415448000000000000000000000081525060200191505060405180910390fd5b815167ffffffffffffffff811180156150f657600080fd5b506040519080825280602002602001820160405280156151255781602001602082028036833780820191505090505b509050828160008151811061513657fe5b60200260200101818152505060005b60018351038110156151d4576000806151888786858151811061516457fe5b602002602001015187600187018151811061517b57fe5b60200260200101516163de565b915091506151aa84848151811061519b57fe5b6020026020010151838361493c565b8460018501815181106151b957fe5b60200260200101818152505050508080600101915050615145565b509392505050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106152bd578051825260208201915060208101905060208303925061529a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461531f576040519150601f19603f3d011682016040523d82523d6000602084013e615324565b606091505b50915091508180156153645750600081511480615363575080806020019051602081101561535157600080fd5b81019080805190602001909291905050505b5b6153b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806165b66024913960400191505060405180910390fd5b505050505050565b60005b6001835103811015615650576000808483815181106153df57fe5b60200260200101518560018501815181106153f657fe5b602002602001015191509150600061540e8383616132565b509050600087600186018151811061542257fe5b602002602001015190506000808373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461546a5782600061546e565b6000835b91509150600060028a5103881061548557886154c7565b6154c67f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460878c60028c01815181106154b957fe5b6020026020010151614c09565b5b90506154f47f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608888614c09565b73ffffffffffffffffffffffffffffffffffffffff1663022c0d9f848484600067ffffffffffffffff8111801561552a57600080fd5b506040519080825280601f01601f19166020018201604052801561555d5781602001600182028036833780820191505090505b506040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156155d55780820151818401526020810190506155ba565b50505050905090810190601f1680156156025780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561562457600080fd5b505af1158015615638573d6000803e3d6000fd5b505050505050505050505080806001019150506153c4565b50505050565b600080600073ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546073ffffffffffffffffffffffffffffffffffffffff1663e6a439058a8a6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561571657600080fd5b505afa15801561572a573d6000803e3d6000fd5b505050506040513d602081101561574057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161415615851577f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a398794546073ffffffffffffffffffffffffffffffffffffffff1663c9c6539689896040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561581457600080fd5b505af1158015615828573d6000803e3d6000fd5b505050506040513d602081101561583e57600080fd5b8101908080519060200190929190505050505b60008061587f7f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608b8b6163de565b915091506000821480156158935750600081145b156158a757878780945081955050506159df565b60006158b4898484616014565b90508781116159425785811015615933576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f444558526f757465723a20494e53554646494349454e545f425f414d4f554e5481525060200191505060405180910390fd5b888180955081965050506159dd565b600061594f898486616014565b90508981111561595b57fe5b878110156159d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f444558526f757465723a20494e53554646494349454e545f415f414d4f554e5481525060200191505060405180910390fd5b80898096508197505050505b505b5050965096945050505050565b60005b6001835103811015615e3257600080848381518110615a0a57fe5b6020026020010151856001850181518110615a2157fe5b6020026020010151915091506000615a398383616132565b5090506000615a697f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a39879454608585614c09565b90506000806000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015615ab757600080fd5b505afa158015615acb573d6000803e3d6000fd5b505050506040513d6060811015615ae157600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506000808773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614615b68578284615b6b565b83835b91509150615c23828b73ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015615bda57600080fd5b505afa158015615bee573d6000803e3d6000fd5b505050506040513d6020811015615c0457600080fd5b8101908080519060200190929190505050615e3790919063ffffffff16565b9550615c3086838361493c565b9450505050506000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614615c7457826000615c78565b6000835b91509150600060028c51038a10615c8f578a615cd1565b615cd07f0000000000000000000000002ef06a90b0e7ae3ae508e83ea6628a3987945460898e60028e0181518110615cc357fe5b6020026020010151614c09565b5b90508573ffffffffffffffffffffffffffffffffffffffff1663022c0d9f848484600067ffffffffffffffff81118015615d0a57600080fd5b506040519080825280601f01601f191660200182016040528015615d3d5781602001600182028036833780820191505090505b506040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015615db5578082015181840152602081019050615d9a565b50505050905090810190601f168015615de25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015615e0457600080fd5b505af1158015615e18573d6000803e3d6000fd5b5050505050505050505050505080806001019150506159ef565b505050565b6000828284039150811115615eb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b6000808411615f14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806165936023913960400191505060405180910390fd5b600083118015615f245750600082115b615f96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c6962726172793a20494e53554646494349454e545f4c49515549444954590081525060200191505060405180910390fd5b6000615fbf6103e8615fb187876162c690919063ffffffff16565b6162c690919063ffffffff16565b90506000615fea6103e5615fdc8887615e3790919063ffffffff16565b6162c690919063ffffffff16565b90506160096001828481615ffa57fe5b0461635b90919063ffffffff16565b925050509392505050565b600080841161608b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4c6962726172793a20494e53554646494349454e545f414d4f554e540000000081525060200191505060405180910390fd5b60008311801561609b5750600082115b61610d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c6962726172793a20494e53554646494349454e545f4c49515549444954590081525060200191505060405180910390fd5b8261612183866162c690919063ffffffff16565b8161612857fe5b0490509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156161d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4c6962726172793a204944454e544943414c5f4144445245535345530000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610616211578284616214565b83835b8092508193505050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156162bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4c6962726172793a205a45524f5f41444452455353000000000000000000000081525060200191505060405180910390fd5b9250929050565b6000808214806162e357508282838502925082816162e057fe5b04145b616355576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b60008282840191508110156163d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b60008060006163ed8585616132565b5090506000806163fe888888614c09565b73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561644357600080fd5b505afa158015616457573d6000803e3d6000fd5b505050506040513d606081101561646d57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508273ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146164f15780826164f4565b81815b809550819650505050505093509391505056fe4c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54444558526f757465723a204558434553534956455f494e5055545f414d4f554e54444558526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a204144415f5452414e534645525f4641494c45444c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a264697066735822122037ce35e896ce4188cb6d36d6237eaf34f1492c9f03e48b67599689540b41339764736f6c634300060c0033