Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Sponsored
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
KSZapValidator
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 999999 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {KSRescue} from 'ks-growth-utils-sc/contracts/KSRescue.sol'; import {IKSZapValidator} from 'contracts/interfaces/zap/validators/IKSZapValidator.sol'; import {IBasePositionManager} from 'contracts/interfaces/ks_elastic/IBasePositionManager.sol'; import {IUniswapv3NFT} from 'contracts/interfaces/uniswapv3/IUniswapv3NFT.sol'; import {IERC20} from 'openzeppelin/contracts/token/ERC20/IERC20.sol'; /// @title Contains main logics of a validator when zapping into KyberSwap Elastic/Classic pools /// and Uniswap v2/v3 + clones contract KSZapValidator is IKSZapValidator, KSRescue { /// @notice Prepare and return validation data before zap, calling internal functions to do the work /// @param _dexType type of dex/pool supported by this validator /// @param _zapInfo related info of zap to generate data function prepareValidationData( uint8 _dexType, bytes calldata _zapInfo ) external view override returns (bytes memory) { if (_dexType == uint8(DexType.Elastic)) { return _getElasticValidationData(_zapInfo); } if (_dexType == uint8(DexType.Classic)) { return _getClassicValidationData(_zapInfo); } if (_dexType == uint8(DexType.Uniswapv3)) { return _getUniswapV3ValidationData(_zapInfo); } return new bytes(0); } /// @notice Validate result after zapping into pool, given initial data and data to validate /// @param _dexType type of dex/pool supported by this validator /// @param _extraData contains data to compares, for example: min liquidity /// @param _initialData contains initial data before zapping /// @param _zapResults contains zap results from executor function validateData( uint8 _dexType, bytes calldata _extraData, bytes calldata _initialData, bytes calldata _zapResults ) external view override returns (bool) { if (_dexType == uint8(DexType.Elastic)) { return _validateElasticResult(_extraData, _initialData); } if (_dexType == uint8(DexType.Classic)) { return _validateClassicResult(_extraData, _initialData); } if (_dexType == uint8(DexType.Uniswapv3)) { return _validateUniswapV3Result(_extraData, _initialData); } return true; } // ======================= Prepare data for validation ======================= /// @notice Generate initial data for validation for KyberSwap Classic and Uniswap v2 /// in order to validate, we need to get the initial LP balance of the recipient /// @param zapInfo contains info of zap with KyberSwap Classic/Uniswap v2 /// should be (pool_address, recipient_address) function _getClassicValidationData(bytes calldata zapInfo) internal view returns (bytes memory) { ClassicValidationData memory data; data.initialData = abi.decode(zapInfo, (ClassicZapData)); data.initialLiquidity = uint128(IERC20(data.initialData.pool).balanceOf(data.initialData.recipient)); return abi.encode(data); } /// @notice Generate initial data for validation for KyberSwap Elastic /// 2 cases: minting a new position or increase liquidity /// - minting a new position: /// + posID in zapInfo should be 0, then replaced with the expected posID /// + isNewPosition is true /// + initialLiquidity is 0 /// - increase liquidity: /// + isNewPosition is false /// + initialLiquidity is the current position liquidity, fetched from Position Manager function _getElasticValidationData(bytes calldata zapInfo) internal view returns (bytes memory) { ElasticValidationData memory data; data.initialData = abi.decode(zapInfo, (ElasticZapData)); if (data.initialData.posID == 0) { // minting new position, posID should be nextTokenId data.initialData.posID = IBasePositionManager(data.initialData.posManager).nextTokenId(); data.isNewPosition = true; data.initialLiquidity = 0; } else { data.isNewPosition = false; (IBasePositionManager.Position memory pos,) = IBasePositionManager(data.initialData.posManager).positions((data.initialData.posID)); data.initialLiquidity = pos.liquidity; } return abi.encode(data); } /// @notice Generate initial data for validation for Uniswap v3 /// 2 cases: minting a new position or increase liquidity /// - minting a new position: /// + posID in zapInfo should be 0, then replaced with the curren totalSupply /// + isNewPosition is true /// + initialLiquidity is 0 /// - increase liquidity: /// + isNewPosition is false /// + initialLiquidity is the current position liquidity, fetched from Position Manager function _getUniswapV3ValidationData(bytes calldata zapInfo) internal view returns (bytes memory) { ElasticValidationData memory data; data.initialData = abi.decode(zapInfo, (ElasticZapData)); if (data.initialData.posID == 0) { // minting new position, temporary store the total supply here data.initialData.posID = IUniswapv3NFT(data.initialData.posManager).totalSupply(); data.isNewPosition = true; data.initialLiquidity = 0; } else { data.isNewPosition = false; (,,,,,,, data.initialLiquidity,,,,) = IUniswapv3NFT(data.initialData.posManager).positions(data.initialData.posID); } return abi.encode(data); } // ======================= Validate data after zap ======================= /// @notice Validate result for zapping into KyberSwap Classic/Uniswap v2 /// - _extraData is the minLiquidity (for validation) /// - to validate, fetch the current LP balance of the recipient /// then compares with the initialLiquidity, make sure the increment is expected (>= minLiquidity) /// @param _extraData just the minLiquidity value, uint128 /// @param _initialData contains initial data before zap, including initialLiquidity function _validateClassicResult( bytes calldata _extraData, bytes calldata _initialData ) internal view returns (bool) { ClassicValidationData memory data = abi.decode(_initialData, (ClassicValidationData)); // getting new lp balance, make sure it should be increased uint256 lpBalanceAfter = IERC20(data.initialData.pool).balanceOf(data.initialData.recipient); if (lpBalanceAfter < data.initialLiquidity) return false; // validate increment in liquidity with min expectation uint256 minLiquidity = uint256(abi.decode(_extraData, (uint128))); require(minLiquidity > 0, 'zero min_liquidity'); return (lpBalanceAfter - data.initialLiquidity) >= minLiquidity; } /// @notice Validate result for zapping into KyberSwap Elastic /// 2 cases: /// - new position: /// + _extraData contains (recipient, posTickLower, posTickLower, minLiquidity) where: /// (+) recipient is the owner of the posID /// (+) posTickLower, posTickUpper are matched with position's tickLower/tickUpper /// (+) pool is matched with position's pool /// (+) minLiquidity <= pos.liquidity /// - increase liquidity: /// + _extraData contains minLiquidity, where: /// (+) minLiquidity <= (pos.liquidity - initialLiquidity) function _validateElasticResult( bytes calldata _extraData, bytes calldata _initialData ) internal view returns (bool) { ElasticValidationData memory data = abi.decode(_initialData, (ElasticValidationData)); IBasePositionManager posManager = IBasePositionManager(data.initialData.posManager); if (data.isNewPosition) { // minting a new position, need to validate many data ElasticExtraData memory extraData = abi.decode(_extraData, (ElasticExtraData)); // require owner of the pos id is the recipient if (posManager.ownerOf(data.initialData.posID) != extraData.recipient) return false; // getting pos info from Position Manager (IBasePositionManager.Position memory pos,) = posManager.positions((data.initialData.posID)); // tick ranges should match if (extraData.posTickLower != pos.tickLower || extraData.posTickUpper != pos.tickUpper) { return false; } // poolId should correspond to the pool address if (posManager.addressToPoolId(data.initialData.pool) != pos.poolId) return false; // new liquidity should match expectation require(extraData.minLiquidity > 0, 'zero min_liquidity'); return pos.liquidity >= extraData.minLiquidity; } else { // not a new position, only need to verify liquidty increment // getting new position liquidity, make sure it is increased (IBasePositionManager.Position memory pos,) = posManager.positions((data.initialData.posID)); if (pos.liquidity < data.initialLiquidity) return false; // validate increment in liquidity with min expectation uint128 minLiquidity = abi.decode(_extraData, (uint128)); require(minLiquidity > 0, 'zero min_liquidity'); return pos.liquidity - data.initialLiquidity >= minLiquidity; } } /// @notice Validate result for zapping into Uniswap V3 /// 2 cases: /// - new position: /// + posID is the totalSupply, need to fetch the corresponding posID /// + _extraData contains (recipient, posTickLower, posTickLower, minLiquidity) where: /// (+) recipient is the owner of the posID /// (+) posTickLower, posTickUpper are matched with position's tickLower/tickUpper /// (+) pool is matched with position's pool /// (+) minLiquidity <= pos.liquidity /// - increase liquidity: /// + _extraData contains minLiquidity, where: /// (+) minLiquidity <= (pos.liquidity - initialLiquidity) function _validateUniswapV3Result( bytes calldata _extraData, bytes calldata _initialData ) internal view returns (bool) { ElasticValidationData memory data = abi.decode(_initialData, (ElasticValidationData)); IUniswapv3NFT posManager = IUniswapv3NFT(data.initialData.posManager); if (data.isNewPosition) { // minting a new position, need to validate many data // Calculate the posID and replace, it should be the last index data.initialData.posID = posManager.tokenByIndex(data.initialData.posID); ElasticExtraData memory extraData = abi.decode(_extraData, (ElasticExtraData)); // require owner of the pos id is the recipient if (posManager.ownerOf(data.initialData.posID) != extraData.recipient) return false; // getting pos info from Position Manager (,,,,, int24 tickLower, int24 tickUpper, uint128 liquidity,,,,) = posManager.positions(data.initialData.posID); // tick ranges should match if (extraData.posTickLower != tickLower || extraData.posTickUpper != tickUpper) { return false; } // TODO: poolId should correspond to the pool address // if (posManager.addressToPoolId(data.initialData.pool) != pos.poolId) return false; // new liquidity should match expectation require(extraData.minLiquidity > 0, 'zero min_liquidity'); return liquidity >= extraData.minLiquidity; } else { // not a new position, only need to verify liquidty increment // getting new position liquidity, make sure it is increased (,,,,,,, uint128 newLiquidity,,,,) = posManager.positions(data.initialData.posID); if (newLiquidity < data.initialLiquidity) return false; // validate increment in liquidity with min expectation uint128 minLiquidity = abi.decode(_extraData, (uint128)); require(minLiquidity > 0, 'zero min_liquidity'); return newLiquidity - data.initialLiquidity >= minLiquidity; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {KyberSwapRole} from '@src/KyberSwapRole.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; abstract contract KSRescue is KyberSwapRole { using SafeERC20 for IERC20; address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); function rescueFunds(address token, uint256 amount, address recipient) external onlyOwner { require(recipient != address(0), 'KSRescue: invalid recipient'); if (amount == 0) amount = _getAvailableAmount(token); if (amount > 0) { if (_isETH(token)) { (bool success,) = recipient.call{value: amount}(''); require(success, 'KSRescue: ETH_TRANSFER_FAILED'); } else { IERC20(token).safeTransfer(recipient, amount); } } } function _getAvailableAmount(address token) internal view virtual returns (uint256 amount) { if (_isETH(token)) { amount = address(this).balance; } else { amount = IERC20(token).balanceOf(address(this)); } if (amount > 0) --amount; } function _isETH(address token) internal pure returns (bool) { return (token == ETH_ADDRESS); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {IZapValidator} from 'contracts/interfaces/zap/validators/IZapValidator.sol'; interface IKSZapValidator is IZapValidator { /// @notice Only need pool address and recipient to get data struct ClassicZapData { address pool; address recipient; } /// @notice Return KS Classic Zap Data, and initial liquidity of the recipient struct ClassicValidationData { ClassicZapData initialData; uint128 initialLiquidity; } /// @notice Contains pool, posManage address /// posID = 0 -> minting a new position, otherwise increasing to existing one struct ElasticZapData { address pool; address posManager; uint256 posID; } /// @notice Return data for validation purpose /// In case minting a new position: /// - In case Elastic: it calculates the expected posID and update the value /// - In case Uniswap v3: it calculates the current total supply struct ElasticValidationData { ElasticZapData initialData; bool isNewPosition; uint128 initialLiquidity; } /// @notice Extra data to be used for validation after zapping struct ElasticExtraData { address recipient; int24 posTickLower; int24 posTickUpper; uint128 minLiquidity; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; interface IBasePositionManager { struct Position { // the nonce for permits uint96 nonce; // the address that is approved for spending this token address operator; // the ID of the pool with which this token is connected uint80 poolId; // the tick range of the position int24 tickLower; int24 tickUpper; // the liquidity of the position uint128 liquidity; // the current rToken that the position owed uint256 rTokenOwed; // fee growth per unit of liquidity as of the last update to liquidity uint256 feeGrowthInsideLast; } struct PoolInfo { address token0; uint16 fee; address token1; } struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; int24[2] ticksPrevious; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } struct IncreaseLiquidityParams { uint256 tokenId; int24[2] ticksPrevious; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct RemoveLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct BurnRTokenParams { uint256 tokenId; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } function nextTokenId() external view returns (uint256); function ownerOf(uint256 tokenId) external view returns (address); function positions(uint256 tokenId) external view returns (Position memory pos, PoolInfo memory info); function addressToPoolId(address pool) external view returns (uint80); function WETH() external view returns (address); function tokenByIndex(uint256 index) external view returns (uint256); function totalSupply() external view returns (uint256); function mint(MintParams calldata params) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); function addLiquidity(IncreaseLiquidityParams calldata params) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1, uint256 additionalRTokenOwed); function removeLiquidity(RemoveLiquidityParams calldata params) external returns (uint256 amount0, uint256 amount1, uint256 additionalRTokenOwed); function syncFeeGrowth(uint256 tokenId) external returns (uint256 additionalRTokenOwed); function burnRTokens(BurnRTokenParams calldata params) external returns (uint256 rTokenQty, uint256 amount0, uint256 amount1); function transferAllTokens(address token, uint256 minAmount, address recipient) external payable; function unwrapWeth(uint256 minAmount, address recipient) external payable; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; interface IUniswapv3NFT { function positions(uint256 tokenId) external view returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } function mint(MintParams calldata params) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } function increaseLiquidity(IncreaseLiquidityParams calldata params) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1); struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } function decreaseLiquidity(DecreaseLiquidityParams calldata params) external payable returns (uint256 amount0, uint256 amount1); struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } function WETH9() external view returns (address); function ownerOf(uint256 tokenId) external view returns (address); function tokenByIndex(uint256 index) external view returns (uint256); function totalSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Pausable} from '@openzeppelin/contracts/security/Pausable.sol'; abstract contract KyberSwapRole is Ownable, Pausable { mapping(address => bool) public operators; mapping(address => bool) public guardians; /** * @dev Emitted when the an user was grant or revoke operator role. */ event UpdateOperator(address user, bool grantOrRevoke); /** * @dev Emitted when the an user was grant or revoke guardian role. */ event UpdateGuardian(address user, bool grantOrRevoke); /** * @dev Modifier to make a function callable only when caller is operator. * * Requirements: * * - Caller must have operator role. */ modifier onlyOperator() { require(operators[msg.sender], 'KyberSwapRole: not operator'); _; } /** * @dev Modifier to make a function callable only when caller is guardian. * * Requirements: * * - Caller must have guardian role. */ modifier onlyGuardian() { require(guardians[msg.sender], 'KyberSwapRole: not guardian'); _; } /** * @dev Update Operator role for user. * Can only be called by the current owner. */ function updateOperator(address user, bool grantOrRevoke) external onlyOwner { operators[user] = grantOrRevoke; emit UpdateOperator(user, grantOrRevoke); } /** * @dev Update Guardian role for user. * Can only be called by the current owner. */ function updateGuardian(address user, bool grantOrRevoke) external onlyOwner { guardians[user] = grantOrRevoke; emit UpdateGuardian(user, grantOrRevoke); } /** * @dev Enable logic for contract. * Can only be called by the current owner. */ function enableLogic() external onlyOwner { _unpause(); } /** * @dev Disable logic for contract. * Can only be called by the guardians. */ function disableLogic() external onlyGuardian { _pause(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {IZapDexEnum} from 'contracts/interfaces/zap/common/IZapDexEnum.sol'; interface IZapValidator is IZapDexEnum { function prepareValidationData( uint8 _dexType, bytes calldata _zapInfo ) external view returns (bytes memory validationData); function validateData( uint8 _dexType, bytes calldata _extraData, bytes calldata _initialData, bytes calldata _zapResults ) external view returns (bool isValid); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.0; interface IZapDexEnum { enum DexType { Elastic, Classic, Uniswapv3 } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin/=lib/openzeppelin-contracts/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "ks-growth-utils-sc/=lib/ks-growth-utils-sc/", "@openzeppelin/=lib/ks-growth-utils-sc/lib/openzeppelin-contracts/", "@src/=lib/ks-growth-utils-sc/contracts/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 999999 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"grantOrRevoke","type":"bool"}],"name":"UpdateGuardian","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"grantOrRevoke","type":"bool"}],"name":"UpdateOperator","type":"event"},{"inputs":[],"name":"disableLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardians","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_dexType","type":"uint8"},{"internalType":"bytes","name":"_zapInfo","type":"bytes"}],"name":"prepareValidationData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"grantOrRevoke","type":"bool"}],"name":"updateGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"grantOrRevoke","type":"bool"}],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_dexType","type":"uint8"},{"internalType":"bytes","name":"_extraData","type":"bytes"},{"internalType":"bytes","name":"_initialData","type":"bytes"},{"internalType":"bytes","name":"_zapResults","type":"bytes"}],"name":"validateData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361002c565b6000805460ff60a01b1916905561007c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612af9806200008c6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063c6256bef11610066578063c6256bef146101d5578063e83aa3a8146101f5578063f2fde38b14610208578063f9338d181461021b57600080fd5b80638da5cb5b146101925780639dd39239146101ba578063af0a3557146101c257600080fd5b80636d44a3b2116100bd5780636d44a3b214610162578063715018a61461017757806388f4950f1461017f57600080fd5b80630633b14a146100e457806313e7c9d81461011c5780635c975abb1461013f575b600080fd5b6101076100f2366004612188565b60026020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61010761012a366004612188565b60016020526000908152604090205460ff1681565b60005474010000000000000000000000000000000000000000900460ff16610107565b6101756101703660046121b3565b610223565b005b610175610338565b61017561018d3660046121b3565b6103c5565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610113565b6101756104cd565b6101076101d0366004612246565b61054e565b6101e86101e33660046122f1565b6105aa565b60405161011391906123ba565b6101756102033660046123cd565b610609565b610175610216366004612188565b610846565b610175610976565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527f2ee52be9d342458b3d25e07faada7ff9bc06723b4aa24edb6321ac1316b8a9dd91015b60405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b6103c360006109ff565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527f25d7ce8d7e0b3990938766275ee2d54fbe81347d287bfbf0429838409a889fdc910161032c565b3360009081526002602052604090205460ff16610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4b7962657253776170526f6c653a206e6f7420677561726469616e000000000060448201526064016102a0565b6103c3610a74565b600060ff881661056b5761056487878787610b8a565b905061059f565b60ff88166001141561058357610564878787876110de565b60ff88166002141561059b5761056487878787611284565b5060015b979650505050505050565b606060ff84166105c5576105be838361177d565b9050610602565b60ff8416600114156105db576105be83836119b6565b60ff8416600214156105f1576105be8383611af3565b506040805160008152602081019091525b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff8116610707576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4b535265736375653a20696e76616c696420726563697069656e74000000000060448201526064016102a0565b816107185761071583611ccc565b91505b81156108415773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff841614156108205760008173ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d80600081146107aa576040519150601f19603f3d011682016040523d82523d6000602084013e6107af565b606091505b505090508061081a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4b535265736375653a204554485f5452414e534645525f4641494c454400000060448201526064016102a0565b50505050565b61084173ffffffffffffffffffffffffffffffffffffffff84168284611dbe565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff811661096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102a0565b610973816109ff565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b6103c3611e4b565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005474010000000000000000000000000000000000000000900460ff1615610af9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016102a0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b603390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b600080610b9983850185612560565b8051602090810151908201519192509015610f16576000610bbc878901896125c2565b8051845160409081015190517f6352211e00000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9182169291851691636352211e91610c219160040190815260200190565b60206040518083038186803b158015610c3957600080fd5b505afa158015610c4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c71919061266e565b73ffffffffffffffffffffffffffffffffffffffff1614610c9857600093505050506110d6565b825160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8516916399fbab8891610cf69160040190815260200190565b6101606040518083038186803b158015610d0f57600080fd5b505afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190612733565b509050806060015160020b826020015160020b141580610d755750806080015160020b826040015160020b14155b15610d875760009450505050506110d6565b60408181015185515191517f4bfe339800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015269ffffffffffffffffffff90911691851690634bfe33989060240160206040518083038186803b158015610e0557600080fd5b505afa158015610e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3d91906127f2565b69ffffffffffffffffffff1614610e5b5760009450505050506110d6565b600082606001516fffffffffffffffffffffffffffffffff1611610edb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b81606001516fffffffffffffffffffffffffffffffff168160a001516fffffffffffffffffffffffffffffffff1610159450505050506110d6565b815160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8416916399fbab8891610f749160040190815260200190565b6101606040518083038186803b158015610f8d57600080fd5b505afa158015610fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc59190612733565b50905082604001516fffffffffffffffffffffffffffffffff168160a001516fffffffffffffffffffffffffffffffff16101561100857600093505050506110d6565b6000611016888a018a61280d565b90506000816fffffffffffffffffffffffffffffffff1611611094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b806fffffffffffffffffffffffffffffffff1684604001518360a001516110bb9190612859565b6fffffffffffffffffffffffffffffffff1610159450505050505b949350505050565b6000806110ed838501856128cc565b805180516020909101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529293506000929116906370a082319060240160206040518083038186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c919061290c565b905081602001516fffffffffffffffffffffffffffffffff168110156111c7576000925050506110d6565b60006111d58789018961280d565b6fffffffffffffffffffffffffffffffff16905060008111611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b8083602001516fffffffffffffffffffffffffffffffff16836112769190612925565b101598975050505050505050565b60008061129383850185612560565b80516020908101519082015191925090156115d657815160409081015190517f4f6ccce7000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff821690634f6ccce79060240160206040518083038186803b15801561131657600080fd5b505afa15801561132a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134e919061290c565b8251604001526000611362878901896125c2565b8051845160409081015190517f6352211e00000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9182169291851691636352211e916113c79160040190815260200190565b60206040518083038186803b1580156113df57600080fd5b505afa1580156113f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611417919061266e565b73ffffffffffffffffffffffffffffffffffffffff161461143e57600093505050506110d6565b60008060008473ffffffffffffffffffffffffffffffffffffffff166399fbab888760000151604001516040518263ffffffff1660e01b815260040161148691815260200190565b6101806040518083038186803b15801561149f57600080fd5b505afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d7919061293c565b5050505097509750975050505050508260020b846020015160020b14158061150957508160020b846040015160020b14155b1561151d57600096505050505050506110d6565b600084606001516fffffffffffffffffffffffffffffffff161161159d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b83606001516fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff16101596505050505050506110d6565b815160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8416916399fbab88916116349160040190815260200190565b6101806040518083038186803b15801561164d57600080fd5b505afa158015611661573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611685919061293c565b5050505097505050505050505082604001516fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156116ce57600093505050506110d6565b60006116dc888a018a61280d565b90506000816fffffffffffffffffffffffffffffffff161161175a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b806fffffffffffffffffffffffffffffffff168460400151836110bb9190612859565b6040805160c081018252600060608281018281526080840183905260a08401839052835260208301829052928201526117b883850185612a1d565b808252604001516118665780600001516020015173ffffffffffffffffffffffffffffffffffffffff166375794a3c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561181157600080fd5b505afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611849919061290c565b815160409081019190915260016020830152600090820152611938565b6000602082810182905282519081015160409182015191517f99fbab88000000000000000000000000000000000000000000000000000000008152600481019290925273ffffffffffffffffffffffffffffffffffffffff16906399fbab88906024016101606040518083038186803b1580156118e257600080fd5b505afa1580156118f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191a9190612733565b5060a001516fffffffffffffffffffffffffffffffff166040830152505b604080518251805173ffffffffffffffffffffffffffffffffffffffff908116602080850191909152828101519091168385015290830151606083015283015115156080820152908201516fffffffffffffffffffffffffffffffff1660a082015260c0015b60405160208183030381529060405291505092915050565b60606119e1604080516080810182526000918101828152606082018390528152602081019190915290565b6119ed83850185612a39565b80825280516020909101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529116906370a082319060240160206040518083038186803b158015611a5f57600080fd5b505afa158015611a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a97919061290c565b6fffffffffffffffffffffffffffffffff9081166020838101918252604080518551805173ffffffffffffffffffffffffffffffffffffffff90811683860152930151909216908201529051909116606082015260800161199e565b6040805160c081018252600060608281018281526080840183905260a0840183905283526020830182905292820152611b2e83850185612a1d565b80825260400151611b875780600001516020015173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561181157600080fd5b600060208281019190915281519081015160409182015191517f99fbab88000000000000000000000000000000000000000000000000000000008152600481019290925273ffffffffffffffffffffffffffffffffffffffff16906399fbab88906024016101806040518083038186803b158015611c0457600080fd5b505afa158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c919061293c565b5050506fffffffffffffffffffffffffffffffff90911660408a015250505050505050508060405160200161199e91908151805173ffffffffffffffffffffffffffffffffffffffff9081168352602080830151909116818401526040918201518284015283015115156060830152909101516fffffffffffffffffffffffffffffffff16608082015260a00190565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff83161415611d07575047611da7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b158015611d6c57600080fd5b505afa158015611d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da4919061290c565b90505b8015611db957611db681612a55565b90505b919050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610841908490611f1e565b60005474010000000000000000000000000000000000000000900460ff16611ecf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016102a0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610b60565b6000611f80826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661202a9092919063ffffffff16565b8051909150156108415780806020019051810190611f9e9190612a8a565b610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102a0565b60606110d6848460008585843b61209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102a0565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516120c69190612aa7565b60006040518083038185875af1925050503d8060008114612103576040519150601f19603f3d011682016040523d82523d6000602084013e612108565b606091505b509150915061059f82828660608315612122575081610602565b8251156121325782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a091906123ba565b73ffffffffffffffffffffffffffffffffffffffff8116811461097357600080fd5b60006020828403121561219a57600080fd5b813561060281612166565b801515811461097357600080fd5b600080604083850312156121c657600080fd5b82356121d181612166565b915060208301356121e1816121a5565b809150509250929050565b803560ff81168114611db957600080fd5b60008083601f84011261220f57600080fd5b50813567ffffffffffffffff81111561222757600080fd5b60208301915083602082850101111561223f57600080fd5b9250929050565b60008060008060008060006080888a03121561226157600080fd5b61226a886121ec565b9650602088013567ffffffffffffffff8082111561228757600080fd5b6122938b838c016121fd565b909850965060408a01359150808211156122ac57600080fd5b6122b88b838c016121fd565b909650945060608a01359150808211156122d157600080fd5b506122de8a828b016121fd565b989b979a50959850939692959293505050565b60008060006040848603121561230657600080fd5b61230f846121ec565b9250602084013567ffffffffffffffff81111561232b57600080fd5b612337868287016121fd565b9497909650939450505050565b60005b8381101561235f578181015183820152602001612347565b8381111561081a5750506000910152565b60008151808452612388816020860160208601612344565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106026020830184612370565b6000806000606084860312156123e257600080fd5b83356123ed81612166565b925060208401359150604084013561240481612166565b809150509250925092565b6040516060810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b604051610100810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006060828403121561250657600080fd5b61250e61240f565b9050813561251b81612166565b8152602082013561252b81612166565b806020830152506040820135604082015292915050565b6fffffffffffffffffffffffffffffffff8116811461097357600080fd5b600060a0828403121561257257600080fd5b61257a61240f565b61258484846124f4565b81526060830135612594816121a5565b602082015260808301356125a781612542565b60408201529392505050565b8060020b811461097357600080fd5b6000608082840312156125d457600080fd5b6040516080810181811067ffffffffffffffff8211171561261e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823561262c81612166565b8152602083013561263c816125b3565b6020820152604083013561264f816125b3565b6040820152606083013561266281612542565b60608201529392505050565b60006020828403121561268057600080fd5b815161060281612166565b80516bffffffffffffffffffffffff81168114611db957600080fd5b805169ffffffffffffffffffff81168114611db957600080fd5b8051611db9816125b3565b8051611db981612542565b6000606082840312156126e957600080fd5b6126f161240f565b905081516126fe81612166565b8152602082015161ffff8116811461271557600080fd5b6020820152604082015161272881612166565b604082015292915050565b60008082840361016081121561274857600080fd5b6101008082121561275857600080fd5b61276061245f565b915061276b8561268b565b8252602085015161277b81612166565b602083015261278c604086016126a7565b604083015261279d606086016126c1565b60608301526127ae608086016126c1565b60808301526127bf60a086016126cc565b60a083015260c085015160c083015260e085015160e08301528193506127e7868287016126d7565b925050509250929050565b60006020828403121561280457600080fd5b610602826126a7565b60006020828403121561281f57600080fd5b813561060281612542565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006fffffffffffffffffffffffffffffffff838116908316818110156128825761288261282a565b039392505050565b60006040828403121561289c57600080fd5b6128a46124aa565b905081356128b181612166565b815260208201356128c181612166565b602082015292915050565b6000606082840312156128de57600080fd5b6128e66124aa565b6128f0848461288a565b8152604083013561290081612542565b60208201529392505050565b60006020828403121561291e57600080fd5b5051919050565b6000828210156129375761293761282a565b500390565b6000806000806000806000806000806000806101808d8f03121561295f57600080fd5b6129688d61268b565b9b5060208d015161297881612166565b60408e0151909b5061298981612166565b60608e0151909a5061299a81612166565b60808e015190995062ffffff811681146129b357600080fd5b97506129c160a08e016126c1565b96506129cf60c08e016126c1565b95506129dd60e08e016126cc565b94506101008d015193506101208d015192506129fc6101408e016126cc565b9150612a0b6101608e016126cc565b90509295989b509295989b509295989b565b600060608284031215612a2f57600080fd5b61060283836124f4565b600060408284031215612a4b57600080fd5b610602838361288a565b600081612a6457612a6461282a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600060208284031215612a9c57600080fd5b8151610602816121a5565b60008251612ab9818460208701612344565b919091019291505056fea2646970667358221220227848d21c455dec8cff7d68278a50e4d340b59e8f6b1c9f6dd14b7379bb9de664736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063c6256bef11610066578063c6256bef146101d5578063e83aa3a8146101f5578063f2fde38b14610208578063f9338d181461021b57600080fd5b80638da5cb5b146101925780639dd39239146101ba578063af0a3557146101c257600080fd5b80636d44a3b2116100bd5780636d44a3b214610162578063715018a61461017757806388f4950f1461017f57600080fd5b80630633b14a146100e457806313e7c9d81461011c5780635c975abb1461013f575b600080fd5b6101076100f2366004612188565b60026020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61010761012a366004612188565b60016020526000908152604090205460ff1681565b60005474010000000000000000000000000000000000000000900460ff16610107565b6101756101703660046121b3565b610223565b005b610175610338565b61017561018d3660046121b3565b6103c5565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610113565b6101756104cd565b6101076101d0366004612246565b61054e565b6101e86101e33660046122f1565b6105aa565b60405161011391906123ba565b6101756102033660046123cd565b610609565b610175610216366004612188565b610846565b610175610976565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527f2ee52be9d342458b3d25e07faada7ff9bc06723b4aa24edb6321ac1316b8a9dd91015b60405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b6103c360006109ff565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527f25d7ce8d7e0b3990938766275ee2d54fbe81347d287bfbf0429838409a889fdc910161032c565b3360009081526002602052604090205460ff16610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4b7962657253776170526f6c653a206e6f7420677561726469616e000000000060448201526064016102a0565b6103c3610a74565b600060ff881661056b5761056487878787610b8a565b905061059f565b60ff88166001141561058357610564878787876110de565b60ff88166002141561059b5761056487878787611284565b5060015b979650505050505050565b606060ff84166105c5576105be838361177d565b9050610602565b60ff8416600114156105db576105be83836119b6565b60ff8416600214156105f1576105be8383611af3565b506040805160008152602081019091525b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff8116610707576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4b535265736375653a20696e76616c696420726563697069656e74000000000060448201526064016102a0565b816107185761071583611ccc565b91505b81156108415773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff841614156108205760008173ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d80600081146107aa576040519150601f19603f3d011682016040523d82523d6000602084013e6107af565b606091505b505090508061081a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4b535265736375653a204554485f5452414e534645525f4641494c454400000060448201526064016102a0565b50505050565b61084173ffffffffffffffffffffffffffffffffffffffff84168284611dbe565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b73ffffffffffffffffffffffffffffffffffffffff811661096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102a0565b610973816109ff565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a0565b6103c3611e4b565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005474010000000000000000000000000000000000000000900460ff1615610af9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016102a0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b603390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b600080610b9983850185612560565b8051602090810151908201519192509015610f16576000610bbc878901896125c2565b8051845160409081015190517f6352211e00000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9182169291851691636352211e91610c219160040190815260200190565b60206040518083038186803b158015610c3957600080fd5b505afa158015610c4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c71919061266e565b73ffffffffffffffffffffffffffffffffffffffff1614610c9857600093505050506110d6565b825160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8516916399fbab8891610cf69160040190815260200190565b6101606040518083038186803b158015610d0f57600080fd5b505afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190612733565b509050806060015160020b826020015160020b141580610d755750806080015160020b826040015160020b14155b15610d875760009450505050506110d6565b60408181015185515191517f4bfe339800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015269ffffffffffffffffffff90911691851690634bfe33989060240160206040518083038186803b158015610e0557600080fd5b505afa158015610e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3d91906127f2565b69ffffffffffffffffffff1614610e5b5760009450505050506110d6565b600082606001516fffffffffffffffffffffffffffffffff1611610edb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b81606001516fffffffffffffffffffffffffffffffff168160a001516fffffffffffffffffffffffffffffffff1610159450505050506110d6565b815160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8416916399fbab8891610f749160040190815260200190565b6101606040518083038186803b158015610f8d57600080fd5b505afa158015610fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc59190612733565b50905082604001516fffffffffffffffffffffffffffffffff168160a001516fffffffffffffffffffffffffffffffff16101561100857600093505050506110d6565b6000611016888a018a61280d565b90506000816fffffffffffffffffffffffffffffffff1611611094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b806fffffffffffffffffffffffffffffffff1684604001518360a001516110bb9190612859565b6fffffffffffffffffffffffffffffffff1610159450505050505b949350505050565b6000806110ed838501856128cc565b805180516020909101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529293506000929116906370a082319060240160206040518083038186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c919061290c565b905081602001516fffffffffffffffffffffffffffffffff168110156111c7576000925050506110d6565b60006111d58789018961280d565b6fffffffffffffffffffffffffffffffff16905060008111611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b8083602001516fffffffffffffffffffffffffffffffff16836112769190612925565b101598975050505050505050565b60008061129383850185612560565b80516020908101519082015191925090156115d657815160409081015190517f4f6ccce7000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff821690634f6ccce79060240160206040518083038186803b15801561131657600080fd5b505afa15801561132a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134e919061290c565b8251604001526000611362878901896125c2565b8051845160409081015190517f6352211e00000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9182169291851691636352211e916113c79160040190815260200190565b60206040518083038186803b1580156113df57600080fd5b505afa1580156113f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611417919061266e565b73ffffffffffffffffffffffffffffffffffffffff161461143e57600093505050506110d6565b60008060008473ffffffffffffffffffffffffffffffffffffffff166399fbab888760000151604001516040518263ffffffff1660e01b815260040161148691815260200190565b6101806040518083038186803b15801561149f57600080fd5b505afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d7919061293c565b5050505097509750975050505050508260020b846020015160020b14158061150957508160020b846040015160020b14155b1561151d57600096505050505050506110d6565b600084606001516fffffffffffffffffffffffffffffffff161161159d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b83606001516fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff16101596505050505050506110d6565b815160409081015190517f99fbab8800000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff8416916399fbab88916116349160040190815260200190565b6101806040518083038186803b15801561164d57600080fd5b505afa158015611661573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611685919061293c565b5050505097505050505050505082604001516fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156116ce57600093505050506110d6565b60006116dc888a018a61280d565b90506000816fffffffffffffffffffffffffffffffff161161175a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7a65726f206d696e5f6c6971756964697479000000000000000000000000000060448201526064016102a0565b806fffffffffffffffffffffffffffffffff168460400151836110bb9190612859565b6040805160c081018252600060608281018281526080840183905260a08401839052835260208301829052928201526117b883850185612a1d565b808252604001516118665780600001516020015173ffffffffffffffffffffffffffffffffffffffff166375794a3c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561181157600080fd5b505afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611849919061290c565b815160409081019190915260016020830152600090820152611938565b6000602082810182905282519081015160409182015191517f99fbab88000000000000000000000000000000000000000000000000000000008152600481019290925273ffffffffffffffffffffffffffffffffffffffff16906399fbab88906024016101606040518083038186803b1580156118e257600080fd5b505afa1580156118f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191a9190612733565b5060a001516fffffffffffffffffffffffffffffffff166040830152505b604080518251805173ffffffffffffffffffffffffffffffffffffffff908116602080850191909152828101519091168385015290830151606083015283015115156080820152908201516fffffffffffffffffffffffffffffffff1660a082015260c0015b60405160208183030381529060405291505092915050565b60606119e1604080516080810182526000918101828152606082018390528152602081019190915290565b6119ed83850185612a39565b80825280516020909101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529116906370a082319060240160206040518083038186803b158015611a5f57600080fd5b505afa158015611a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a97919061290c565b6fffffffffffffffffffffffffffffffff9081166020838101918252604080518551805173ffffffffffffffffffffffffffffffffffffffff90811683860152930151909216908201529051909116606082015260800161199e565b6040805160c081018252600060608281018281526080840183905260a0840183905283526020830182905292820152611b2e83850185612a1d565b80825260400151611b875780600001516020015173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561181157600080fd5b600060208281019190915281519081015160409182015191517f99fbab88000000000000000000000000000000000000000000000000000000008152600481019290925273ffffffffffffffffffffffffffffffffffffffff16906399fbab88906024016101806040518083038186803b158015611c0457600080fd5b505afa158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c919061293c565b5050506fffffffffffffffffffffffffffffffff90911660408a015250505050505050508060405160200161199e91908151805173ffffffffffffffffffffffffffffffffffffffff9081168352602080830151909116818401526040918201518284015283015115156060830152909101516fffffffffffffffffffffffffffffffff16608082015260a00190565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff83161415611d07575047611da7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b158015611d6c57600080fd5b505afa158015611d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da4919061290c565b90505b8015611db957611db681612a55565b90505b919050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610841908490611f1e565b60005474010000000000000000000000000000000000000000900460ff16611ecf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016102a0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610b60565b6000611f80826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661202a9092919063ffffffff16565b8051909150156108415780806020019051810190611f9e9190612a8a565b610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102a0565b60606110d6848460008585843b61209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102a0565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516120c69190612aa7565b60006040518083038185875af1925050503d8060008114612103576040519150601f19603f3d011682016040523d82523d6000602084013e612108565b606091505b509150915061059f82828660608315612122575081610602565b8251156121325782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a091906123ba565b73ffffffffffffffffffffffffffffffffffffffff8116811461097357600080fd5b60006020828403121561219a57600080fd5b813561060281612166565b801515811461097357600080fd5b600080604083850312156121c657600080fd5b82356121d181612166565b915060208301356121e1816121a5565b809150509250929050565b803560ff81168114611db957600080fd5b60008083601f84011261220f57600080fd5b50813567ffffffffffffffff81111561222757600080fd5b60208301915083602082850101111561223f57600080fd5b9250929050565b60008060008060008060006080888a03121561226157600080fd5b61226a886121ec565b9650602088013567ffffffffffffffff8082111561228757600080fd5b6122938b838c016121fd565b909850965060408a01359150808211156122ac57600080fd5b6122b88b838c016121fd565b909650945060608a01359150808211156122d157600080fd5b506122de8a828b016121fd565b989b979a50959850939692959293505050565b60008060006040848603121561230657600080fd5b61230f846121ec565b9250602084013567ffffffffffffffff81111561232b57600080fd5b612337868287016121fd565b9497909650939450505050565b60005b8381101561235f578181015183820152602001612347565b8381111561081a5750506000910152565b60008151808452612388816020860160208601612344565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106026020830184612370565b6000806000606084860312156123e257600080fd5b83356123ed81612166565b925060208401359150604084013561240481612166565b809150509250925092565b6040516060810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b604051610100810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612459577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006060828403121561250657600080fd5b61250e61240f565b9050813561251b81612166565b8152602082013561252b81612166565b806020830152506040820135604082015292915050565b6fffffffffffffffffffffffffffffffff8116811461097357600080fd5b600060a0828403121561257257600080fd5b61257a61240f565b61258484846124f4565b81526060830135612594816121a5565b602082015260808301356125a781612542565b60408201529392505050565b8060020b811461097357600080fd5b6000608082840312156125d457600080fd5b6040516080810181811067ffffffffffffffff8211171561261e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823561262c81612166565b8152602083013561263c816125b3565b6020820152604083013561264f816125b3565b6040820152606083013561266281612542565b60608201529392505050565b60006020828403121561268057600080fd5b815161060281612166565b80516bffffffffffffffffffffffff81168114611db957600080fd5b805169ffffffffffffffffffff81168114611db957600080fd5b8051611db9816125b3565b8051611db981612542565b6000606082840312156126e957600080fd5b6126f161240f565b905081516126fe81612166565b8152602082015161ffff8116811461271557600080fd5b6020820152604082015161272881612166565b604082015292915050565b60008082840361016081121561274857600080fd5b6101008082121561275857600080fd5b61276061245f565b915061276b8561268b565b8252602085015161277b81612166565b602083015261278c604086016126a7565b604083015261279d606086016126c1565b60608301526127ae608086016126c1565b60808301526127bf60a086016126cc565b60a083015260c085015160c083015260e085015160e08301528193506127e7868287016126d7565b925050509250929050565b60006020828403121561280457600080fd5b610602826126a7565b60006020828403121561281f57600080fd5b813561060281612542565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006fffffffffffffffffffffffffffffffff838116908316818110156128825761288261282a565b039392505050565b60006040828403121561289c57600080fd5b6128a46124aa565b905081356128b181612166565b815260208201356128c181612166565b602082015292915050565b6000606082840312156128de57600080fd5b6128e66124aa565b6128f0848461288a565b8152604083013561290081612542565b60208201529392505050565b60006020828403121561291e57600080fd5b5051919050565b6000828210156129375761293761282a565b500390565b6000806000806000806000806000806000806101808d8f03121561295f57600080fd5b6129688d61268b565b9b5060208d015161297881612166565b60408e0151909b5061298981612166565b60608e0151909a5061299a81612166565b60808e015190995062ffffff811681146129b357600080fd5b97506129c160a08e016126c1565b96506129cf60c08e016126c1565b95506129dd60e08e016126cc565b94506101008d015193506101208d015192506129fc6101408e016126cc565b9150612a0b6101608e016126cc565b90509295989b509295989b509295989b565b600060608284031215612a2f57600080fd5b61060283836124f4565b600060408284031215612a4b57600080fd5b610602838361288a565b600081612a6457612a6461282a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600060208284031215612a9c57600080fd5b8151610602816121a5565b60008251612ab9818460208701612344565b919091019291505056fea2646970667358221220227848d21c455dec8cff7d68278a50e4d340b59e8f6b1c9f6dd14b7379bb9de664736f6c63430008090033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.