Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Pool
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 999999 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./interfaces/IPool.sol"; /** * @title AirSwap: Withdrawable Token Pool * @notice https://www.airswap.io/ */ contract Pool is IPool, Ownable2Step { using SafeERC20 for IERC20; uint256 internal constant MAX_MAX = 100; uint256 internal constant MAX_SCALE = 77; // Larger the scale, lower the output for a claim uint256 public scale; // Max percentage for a claim with infinite value uint256 public max; // Mapping of address to boolean for admin accounts mapping(address => bool) public admins; // Mapping of tree to account to claim status mapping(bytes32 => mapping(address => bool)) public claimed; // Mapping of tree to root mapping(bytes32 => bytes32) public rootsByTree; /** * @notice Constructor * @param _scale uint256 scale to calculate withdrawal amount * @param _max uint256 max to calculate withdrawal amount */ constructor(uint256 _scale, uint256 _max) { if (_max > MAX_MAX) revert MaxTooHigh(_max); if (_scale > MAX_SCALE) revert ScaleTooHigh(_scale); max = _max; scale = _scale; } /** * @dev Revert if called by non admin account */ modifier multiAdmin() { if (!admins[msg.sender]) revert Unauthorized(); _; } /** * @notice Transfer out token balances for migrations * @param _tokens address[] token balances to transfer * @param _dest address destination * @dev Only owner */ function drainTo( address[] calldata _tokens, address _dest ) external override onlyOwner { for (uint256 i = 0; i < _tokens.length; i++) { uint256 _bal = IERC20(_tokens[i]).balanceOf(address(this)); IERC20(_tokens[i]).safeTransfer(_dest, _bal); } emit DrainTo(_tokens, _dest); } /** * @notice Set withdrawal scale * @param _scale uint256 scale to calculate withdrawal amount * @dev Only owner */ function setScale(uint256 _scale) external override onlyOwner { if (_scale > MAX_SCALE) revert ScaleTooHigh(_scale); scale = _scale; emit SetScale(scale); } /** * @notice Set withdrawal max * @param _max uint256 max to calculate withdrawal amount * @dev Only owner */ function setMax(uint256 _max) external override onlyOwner { if (_max > MAX_MAX) revert MaxTooHigh(_max); max = _max; emit SetMax(max); } /** * @notice Set an admin * @param _admin address to set as admin * @dev Only owner */ function setAdmin(address _admin) external override onlyOwner { if (_admin == address(0)) revert AddressInvalid(_admin); admins[_admin] = true; emit SetAdmin(_admin); } /** * @notice Unset an admin * @param _admin address to unset as admin * @dev Only owner */ function unsetAdmin(address _admin) external override onlyOwner { if (admins[_admin] != true) revert AdminNotSet(_admin); admins[_admin] = false; emit UnsetAdmin(_admin); } /** * @notice Enable claims for a merkle tree * @param _tree bytes32 a tree identifier * @param _root bytes32 a tree root */ function enable(bytes32 _tree, bytes32 _root) external override multiAdmin { rootsByTree[_tree] = _root; emit Enable(_tree, _root); } /** * @notice Set previous claims for migrations * @param _tree bytes32 * @param _root bytes32 * @param _accounts address[] * @dev Only owner */ function enableAndSetClaimed( bytes32 _tree, bytes32 _root, address[] memory _accounts ) external override multiAdmin { // Enable the tree if not yet enabled if (rootsByTree[_tree] == 0) { rootsByTree[_tree] = _root; emit Enable(_tree, _root); } // Iterate and set as claimed if not yet claimed for (uint256 i = 0; i < _accounts.length; i++) { if (claimed[_tree][_accounts[i]] == false) { claimed[_tree][_accounts[i]] = true; emit UseClaim(_accounts[i], _tree); } } } /** * @notice Withdraw tokens using claims * @param _claims Claim[] a set of claims * @param _token address of a token to withdraw * @param _minimum uint256 minimum expected amount * @param _recipient address to receive withdrawal */ function withdraw( Claim[] memory _claims, address _token, uint256 _minimum, address _recipient ) public override returns (uint256 _amount) { if (_claims.length <= 0) revert ClaimsNotProvided(); Claim memory _claim; bytes32 _root; uint256 _totalValue = 0; // Iterate through claims to determine total value for (uint256 i = 0; i < _claims.length; i++) { _claim = _claims[i]; _root = rootsByTree[_claim.tree]; if (_root == 0) revert TreeNotEnabled(_claim.tree); if (claimed[_claim.tree][msg.sender]) revert ClaimAlreadyUsed(); if (!verify(msg.sender, _root, _claim.value, _claim.proof)) revert ProofInvalid(_claim.tree, _root); _totalValue = _totalValue + _claim.value; claimed[_claim.tree][msg.sender] = true; emit UseClaim(msg.sender, _claim.tree); } // Determine withdrawable amount given total value _amount = calculate(_totalValue, _token); if (_amount < _minimum) revert AmountInsufficient(_amount); // Transfer withdrawable amount to recipient IERC20(_token).safeTransfer(_recipient, _amount); emit Withdraw(msg.sender, _recipient, _token, _totalValue, _amount); } /** * @notice Calculate amount for a value and token * @param _value uint256 claim value * @param _token address claim token * @return uint256 amount withdrawable */ function calculate( uint256 _value, address _token ) public view override returns (uint256) { uint256 _balance = IERC20(_token).balanceOf(address(this)); uint256 _divisor = (uint256(10) ** scale) + _value; return (max * _value * _balance) / _divisor / MAX_MAX; } /** * @notice Verify a merkle proof * @param _claimant address of the claimant * @param _root bytes32 merkle root * @param _value uint256 merkle value * @param _proof bytes32[] merkle proof * @return bool whether verified */ function verify( address _claimant, bytes32 _root, uint256 _value, bytes32[] memory _proof ) public pure override returns (bool) { bytes32 _leaf = keccak256(abi.encodePacked(_claimant, _value)); return MerkleProof.verify(_proof, _root, _leaf); } /** * @notice Get claim status for an account and set of trees * @param _account address to check * @param _trees bytes32[] an array of tree identifiers * @return statuses bool[] an array of claim statuses */ function getStatus( address _account, bytes32[] calldata _trees ) external view returns (bool[] memory) { bool[] memory statuses = new bool[](_trees.length); for (uint256 i = 0; i < _trees.length; i++) { statuses[i] = claimed[_trees[i]][_account]; } return statuses; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) 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() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides 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} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// 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 // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.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; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ 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"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IPool { struct Claim { bytes32 tree; uint256 value; bytes32[] proof; } event DrainTo(address[] tokens, address dest); event Enable(bytes32 tree, bytes32 root); event SetAdmin(address indexed admin); event SetMax(uint256 max); event SetScale(uint256 scale); event UnsetAdmin(address indexed admin); event UseClaim(address indexed account, bytes32 indexed tree); event Withdraw( address indexed account, address indexed recipient, address indexed token, uint256 value, uint256 amount ); error AddressInvalid(address); error AdminNotSet(address); error AmountInsufficient(uint256); error ClaimAlreadyUsed(); error ClaimsNotProvided(); error MaxTooHigh(uint256); error ProofInvalid(bytes32, bytes32); error TreeNotEnabled(bytes32); error ScaleTooHigh(uint256); error Unauthorized(); function drainTo(address[] calldata tokens, address dest) external; function setScale(uint256 _scale) external; function setMax(uint256 _max) external; function setAdmin(address _admin) external; function unsetAdmin(address _admin) external; function enable(bytes32 _tree, bytes32 _root) external; function enableAndSetClaimed( bytes32 _tree, bytes32 _root, address[] memory _accounts ) external; function withdraw( Claim[] memory claims, address token, uint256 minimum, address recipient ) external returns (uint256 amount); function calculate( uint256 score, address token ) external view returns (uint256 amount); function verify( address participant, bytes32 root, uint256 score, bytes32[] memory proof ) external pure returns (bool valid); function getStatus( address _account, bytes32[] calldata _trees ) external returns (bool[] memory statuses); }
{ "optimizer": { "enabled": true, "runs": 999999 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"uint256","name":"_scale","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"AddressInvalid","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"AdminNotSet","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"AmountInsufficient","type":"error"},{"inputs":[],"name":"ClaimAlreadyUsed","type":"error"},{"inputs":[],"name":"ClaimsNotProvided","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"MaxTooHigh","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"ProofInvalid","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ScaleTooHigh","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"TreeNotEnabled","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"address","name":"dest","type":"address"}],"name":"DrainTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"tree","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"Enable","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"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":true,"internalType":"address","name":"admin","type":"address"}],"name":"SetAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"}],"name":"SetMax","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"scale","type":"uint256"}],"name":"SetScale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"}],"name":"UnsetAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"bytes32","name":"tree","type":"bytes32"}],"name":"UseClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admins","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"calculate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_dest","type":"address"}],"name":"drainTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_tree","type":"bytes32"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"enable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_tree","type":"bytes32"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"address[]","name":"_accounts","type":"address[]"}],"name":"enableAndSetClaimed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bytes32[]","name":"_trees","type":"bytes32[]"}],"name":"getStatus","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"max","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"rootsByTree","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_scale","type":"uint256"}],"name":"setScale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"unsetAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_claimant","type":"address"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"tree","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"internalType":"struct IPool.Claim[]","name":"_claims","type":"tuple[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_minimum","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001fea38038062001fea83398101604081905262000034916200010b565b6200003f336200009d565b60648111156200006a5760405163b200946f60e01b8152600481018290526024015b60405180910390fd5b604d821115620000915760405163321a710f60e21b81526004810183905260240162000061565b60035560025562000130565b600180546001600160a01b0319169055620000b881620000bb565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156200011f57600080fd5b505080516020909101519092909150565b611eaa80620001406000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80636ac5db19116100d8578063b09013a21161008c578063e30c397811610066578063e30c397814610348578063f2fde38b14610366578063f51e181a1461037957600080fd5b8063b09013a2146102f4578063b86675e014610307578063dfcae6221461031a57600080fd5b8063715018a6116100bd578063715018a6146102a557806379ba5097146102ad5780638da5cb5b146102b557600080fd5b80636ac5db1914610289578063704b6c021461029257600080fd5b806341aa0b371161012f5780634d253b50116101145780634d253b50146102355780635a1187b7146102485780635a1d249d1461027657600080fd5b806341aa0b37146101ff578063429b62e51461021257600080fd5b8063249da60511610160578063249da605146101a45780633a1c1a6f146101cc5780633edc3519146101ec57600080fd5b80631fc48d281461017c5780631fe9eabc14610191575b600080fd5b61018f61018a3660046115d4565b610382565b005b61018f61019f3660046115f6565b61041a565b6101b76101b2366004611772565b6104a1565b60405190151581526020015b60405180910390f35b6101df6101da36600461181f565b61050e565b6040516101c39190611872565b61018f6101fa3660046115f6565b61060b565b61018f61020d3660046118b8565b610686565b6101b7610220366004611965565b60046020526000908152604090205460ff1681565b61018f610243366004611965565b61088c565b6102686102563660046115f6565b60066020526000908152604090205481565b6040519081526020016101c3565b610268610284366004611980565b610984565b61026860035481565b61018f6102a0366004611965565b610a72565b61018f610b56565b61018f610b6a565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c3565b61018f6103023660046119ac565b610c1f565b610268610315366004611a00565b610d80565b6101b7610328366004611980565b600560209081526000928352604080842090915290825290205460ff1681565b60015473ffffffffffffffffffffffffffffffffffffffff166102cf565b61018f610374366004611965565b611060565b61026860025481565b3360009081526004602052604090205460ff166103cb576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602090815260409182902083905581518481529081018390527fd4ec60c08440ea870fccde76e064d496b2ba9fe0cb488d7788ab666d53ef7e8a910160405180910390a15050565b610422611110565b6064811115610465576040517fb200946f000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b60038190556040518181527fc2c862cda8964d16d060904e01f55bf7e4ea5e59759ca1c20db551079e0d5eed906020015b60405180910390a150565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606086901b166020820152603481018390526000908190605401604051602081830303815290604052805190602001209050610502838683611191565b9150505b949350505050565b606060008267ffffffffffffffff81111561052b5761052b611638565b604051908082528060200260200182016040528015610554578160200160208202803683370190505b50905060005b83811015610602576005600086868481811061057857610578611b41565b90506020020135815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168282815181106105ea576105ea611b41565b9115156020928302919091019091015260010161055a565b50949350505050565b610613611110565b604d811115610651576040517fc869c43c0000000000000000000000000000000000000000000000000000000081526004810182905260240161045c565b60028190556040518181527fb7f1dd786998967316283c7e129a0bbeaf046b77f2f51afe39bb89a10f29a00e90602001610496565b3360009081526004602052604090205460ff166106cf576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526006602052604081205490036107305760008381526006602090815260409182902084905581518581529081018490527fd4ec60c08440ea870fccde76e064d496b2ba9fe0cb488d7788ab666d53ef7e8a910160405180910390a15b60005b81518110156108865760056000858152602001908152602001600020600083838151811061076357610763611b41565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160009081205460ff161515900361087e5760008481526005602052604081208351600192908590859081106107c7576107c7611b41565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508382828151811061083357610833611b41565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fb3cf16e0e9fea81a7e797f97fe0fecaae4731866107df01f9916b83a7ff062b260405160405180910390a35b600101610733565b50505050565b610894611110565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff161515600114610910576040517f4dc6d0ac00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161045c565b73ffffffffffffffffffffffffffffffffffffffff811660008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f529cb60a080fcfbcdedc90ee02044792419af59c6a6b701dafc80aa9be2747c79190a250565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156109f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a179190611b70565b9050600084600254600a610a2b9190611cd8565b610a359190611ce4565b90506064818387600354610a499190611cf7565b610a539190611cf7565b610a5d9190611d0e565b610a679190611d0e565b925050505b92915050565b610a7a611110565b73ffffffffffffffffffffffffffffffffffffffff8116610adf576040517f8641435100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161045c565b73ffffffffffffffffffffffffffffffffffffffff811660008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a19190a250565b610b5e611110565b610b6860006111a7565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610c13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e65720000000000000000000000000000000000000000000000606482015260840161045c565b610c1c816111a7565b50565b610c27611110565b60005b82811015610d3f576000848483818110610c4657610c46611b41565b9050602002016020810190610c5b9190611965565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ceb9190611b70565b9050610d368382878786818110610d0457610d04611b41565b9050602002016020810190610d199190611965565b73ffffffffffffffffffffffffffffffffffffffff1691906111d8565b50600101610c2a565b507f4b713dd63c7c270b811762a754d42e5d79ea1ba9d3a0899d73eab3e38b50cd6f838383604051610d7393929190611d49565b60405180910390a1505050565b600080855111610dbc576040517f872e34a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160608082018352600080835260208301819052928201529080805b8851811015610f9257888181518110610df657610df6611b41565b602002602001015193506006600085600001518152602001908152602001600020549250826000801b03610e5c5783516040517f5b0c2226000000000000000000000000000000000000000000000000000000008152600481019190915260240161045c565b8351600090815260056020908152604080832033845290915290205460ff1615610eb2576040517fead7077b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ec63384866020015187604001516104a1565b610f095783516040517f0397af8f00000000000000000000000000000000000000000000000000000000815260048101919091526024810184905260440161045c565b6020840151610f189083611ce4565b8451600090815260056020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055875190519395509290917fb3cf16e0e9fea81a7e797f97fe0fecaae4731866107df01f9916b83a7ff062b291a3600101610ddb565b50610f9d8188610984565b935085841015610fdc576040517fdc998f2b0000000000000000000000000000000000000000000000000000000081526004810185905260240161045c565b610ffd73ffffffffffffffffffffffffffffffffffffffff881686866111d8565b604080518281526020810186905273ffffffffffffffffffffffffffffffffffffffff808a16929088169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a4505050949350505050565b611068611110565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556110cb60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b60008261119e858461126a565b14949350505050565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610c1c816112ad565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611265908490611322565b505050565b600081815b84518110156112a55761129b8286838151811061128e5761128e611b41565b6020026020010151611431565b915060010161126f565b509392505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611384826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166114639092919063ffffffff16565b90508051600014806113a55750808060200190518101906113a59190611dc1565b611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161045c565b600081831061144d57600082815260208490526040902061145c565b60008381526020839052604090205b9392505050565b60606105068484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516114979190611e07565b60006040518083038185875af1925050503d80600081146114d4576040519150601f19603f3d011682016040523d82523d6000602084013e6114d9565b606091505b50915091506114ea878383876114f5565b979650505050505050565b6060831561158b5782516000036115845773ffffffffffffffffffffffffffffffffffffffff85163b611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045c565b5081610506565b61050683838151156115a05781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045c9190611e23565b600080604083850312156115e757600080fd5b50508035926020909101359150565b60006020828403121561160857600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461163357600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561168a5761168a611638565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116d7576116d7611638565b604052919050565b600067ffffffffffffffff8211156116f9576116f9611638565b5060051b60200190565b600082601f83011261171457600080fd5b81356020611729611724836116df565b611690565b8083825260208201915060208460051b87010193508684111561174b57600080fd5b602086015b848110156117675780358352918301918301611750565b509695505050505050565b6000806000806080858703121561178857600080fd5b6117918561160f565b93506020850135925060408501359150606085013567ffffffffffffffff8111156117bb57600080fd5b6117c787828801611703565b91505092959194509250565b60008083601f8401126117e557600080fd5b50813567ffffffffffffffff8111156117fd57600080fd5b6020830191508360208260051b850101111561181857600080fd5b9250929050565b60008060006040848603121561183457600080fd5b61183d8461160f565b9250602084013567ffffffffffffffff81111561185957600080fd5b611865868287016117d3565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b818110156118ac57835115158352928401929184019160010161188e565b50909695505050505050565b6000806000606084860312156118cd57600080fd5b833592506020808501359250604085013567ffffffffffffffff8111156118f357600080fd5b8501601f8101871361190457600080fd5b8035611912611724826116df565b81815260059190911b8201830190838101908983111561193157600080fd5b928401925b82841015611956576119478461160f565b82529284019290840190611936565b80955050505050509250925092565b60006020828403121561197757600080fd5b61145c8261160f565b6000806040838503121561199357600080fd5b823591506119a36020840161160f565b90509250929050565b6000806000604084860312156119c157600080fd5b833567ffffffffffffffff8111156119d857600080fd5b6119e4868287016117d3565b90945092506119f790506020850161160f565b90509250925092565b60008060008060808587031215611a1657600080fd5b67ffffffffffffffff8086351115611a2d57600080fd5b8535860187601f820112611a4057600080fd5b611a4d61172482356116df565b81358082526020808301929160051b8401018a811115611a6c57600080fd5b602084015b81811015611b0c578581351115611a8757600080fd5b8035850160607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0828f03011215611abd57600080fd5b611ac5611667565b6020820135815260408201356020820152606082013588811115611ae857600080fd5b611af78f602083860101611703565b60408301525085525060209384019301611a71565b505080975050505050611b216020860161160f565b925060408501359150611b366060860161160f565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611b8257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b80851115611c1157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611bf757611bf7611b89565b80851615611c0457918102915b93841c9390800290611bbd565b509250929050565b600082611c2857506001610a6c565b81611c3557506000610a6c565b8160018114611c4b5760028114611c5557611c71565b6001915050610a6c565b60ff841115611c6657611c66611b89565b50506001821b610a6c565b5060208310610133831016604e8410600b8410161715611c94575081810a610a6c565b611c9e8383611bb8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611cd057611cd0611b89565b029392505050565b600061145c8383611c19565b80820180821115610a6c57610a6c611b89565b8082028115828204841417610a6c57610a6c611b89565b600082611d44577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6040808252810183905260008460608301825b86811015611d975773ffffffffffffffffffffffffffffffffffffffff611d828461160f565b16825260209283019290910190600101611d5c565b50809250505073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b600060208284031215611dd357600080fd5b8151801515811461145c57600080fd5b60005b83811015611dfe578181015183820152602001611de6565b50506000910152565b60008251611e19818460208701611de3565b9190910192915050565b6020815260008251806020840152611e42816040850160208701611de3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220516932bd2a8467cfd28bbf385c9d22da9054ce50bd8d166616977b64bbc35bff64736f6c63430008170033000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000064
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101775760003560e01c80636ac5db19116100d8578063b09013a21161008c578063e30c397811610066578063e30c397814610348578063f2fde38b14610366578063f51e181a1461037957600080fd5b8063b09013a2146102f4578063b86675e014610307578063dfcae6221461031a57600080fd5b8063715018a6116100bd578063715018a6146102a557806379ba5097146102ad5780638da5cb5b146102b557600080fd5b80636ac5db1914610289578063704b6c021461029257600080fd5b806341aa0b371161012f5780634d253b50116101145780634d253b50146102355780635a1187b7146102485780635a1d249d1461027657600080fd5b806341aa0b37146101ff578063429b62e51461021257600080fd5b8063249da60511610160578063249da605146101a45780633a1c1a6f146101cc5780633edc3519146101ec57600080fd5b80631fc48d281461017c5780631fe9eabc14610191575b600080fd5b61018f61018a3660046115d4565b610382565b005b61018f61019f3660046115f6565b61041a565b6101b76101b2366004611772565b6104a1565b60405190151581526020015b60405180910390f35b6101df6101da36600461181f565b61050e565b6040516101c39190611872565b61018f6101fa3660046115f6565b61060b565b61018f61020d3660046118b8565b610686565b6101b7610220366004611965565b60046020526000908152604090205460ff1681565b61018f610243366004611965565b61088c565b6102686102563660046115f6565b60066020526000908152604090205481565b6040519081526020016101c3565b610268610284366004611980565b610984565b61026860035481565b61018f6102a0366004611965565b610a72565b61018f610b56565b61018f610b6a565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c3565b61018f6103023660046119ac565b610c1f565b610268610315366004611a00565b610d80565b6101b7610328366004611980565b600560209081526000928352604080842090915290825290205460ff1681565b60015473ffffffffffffffffffffffffffffffffffffffff166102cf565b61018f610374366004611965565b611060565b61026860025481565b3360009081526004602052604090205460ff166103cb576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602090815260409182902083905581518481529081018390527fd4ec60c08440ea870fccde76e064d496b2ba9fe0cb488d7788ab666d53ef7e8a910160405180910390a15050565b610422611110565b6064811115610465576040517fb200946f000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b60038190556040518181527fc2c862cda8964d16d060904e01f55bf7e4ea5e59759ca1c20db551079e0d5eed906020015b60405180910390a150565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606086901b166020820152603481018390526000908190605401604051602081830303815290604052805190602001209050610502838683611191565b9150505b949350505050565b606060008267ffffffffffffffff81111561052b5761052b611638565b604051908082528060200260200182016040528015610554578160200160208202803683370190505b50905060005b83811015610602576005600086868481811061057857610578611b41565b90506020020135815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168282815181106105ea576105ea611b41565b9115156020928302919091019091015260010161055a565b50949350505050565b610613611110565b604d811115610651576040517fc869c43c0000000000000000000000000000000000000000000000000000000081526004810182905260240161045c565b60028190556040518181527fb7f1dd786998967316283c7e129a0bbeaf046b77f2f51afe39bb89a10f29a00e90602001610496565b3360009081526004602052604090205460ff166106cf576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526006602052604081205490036107305760008381526006602090815260409182902084905581518581529081018490527fd4ec60c08440ea870fccde76e064d496b2ba9fe0cb488d7788ab666d53ef7e8a910160405180910390a15b60005b81518110156108865760056000858152602001908152602001600020600083838151811061076357610763611b41565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160009081205460ff161515900361087e5760008481526005602052604081208351600192908590859081106107c7576107c7611b41565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508382828151811061083357610833611b41565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fb3cf16e0e9fea81a7e797f97fe0fecaae4731866107df01f9916b83a7ff062b260405160405180910390a35b600101610733565b50505050565b610894611110565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff161515600114610910576040517f4dc6d0ac00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161045c565b73ffffffffffffffffffffffffffffffffffffffff811660008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f529cb60a080fcfbcdedc90ee02044792419af59c6a6b701dafc80aa9be2747c79190a250565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156109f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a179190611b70565b9050600084600254600a610a2b9190611cd8565b610a359190611ce4565b90506064818387600354610a499190611cf7565b610a539190611cf7565b610a5d9190611d0e565b610a679190611d0e565b925050505b92915050565b610a7a611110565b73ffffffffffffffffffffffffffffffffffffffff8116610adf576040517f8641435100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161045c565b73ffffffffffffffffffffffffffffffffffffffff811660008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a19190a250565b610b5e611110565b610b6860006111a7565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610c13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e65720000000000000000000000000000000000000000000000606482015260840161045c565b610c1c816111a7565b50565b610c27611110565b60005b82811015610d3f576000848483818110610c4657610c46611b41565b9050602002016020810190610c5b9190611965565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ceb9190611b70565b9050610d368382878786818110610d0457610d04611b41565b9050602002016020810190610d199190611965565b73ffffffffffffffffffffffffffffffffffffffff1691906111d8565b50600101610c2a565b507f4b713dd63c7c270b811762a754d42e5d79ea1ba9d3a0899d73eab3e38b50cd6f838383604051610d7393929190611d49565b60405180910390a1505050565b600080855111610dbc576040517f872e34a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160608082018352600080835260208301819052928201529080805b8851811015610f9257888181518110610df657610df6611b41565b602002602001015193506006600085600001518152602001908152602001600020549250826000801b03610e5c5783516040517f5b0c2226000000000000000000000000000000000000000000000000000000008152600481019190915260240161045c565b8351600090815260056020908152604080832033845290915290205460ff1615610eb2576040517fead7077b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ec63384866020015187604001516104a1565b610f095783516040517f0397af8f00000000000000000000000000000000000000000000000000000000815260048101919091526024810184905260440161045c565b6020840151610f189083611ce4565b8451600090815260056020908152604080832033808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055875190519395509290917fb3cf16e0e9fea81a7e797f97fe0fecaae4731866107df01f9916b83a7ff062b291a3600101610ddb565b50610f9d8188610984565b935085841015610fdc576040517fdc998f2b0000000000000000000000000000000000000000000000000000000081526004810185905260240161045c565b610ffd73ffffffffffffffffffffffffffffffffffffffff881686866111d8565b604080518281526020810186905273ffffffffffffffffffffffffffffffffffffffff808a16929088169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a4505050949350505050565b611068611110565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556110cb60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b60008261119e858461126a565b14949350505050565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610c1c816112ad565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611265908490611322565b505050565b600081815b84518110156112a55761129b8286838151811061128e5761128e611b41565b6020026020010151611431565b915060010161126f565b509392505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611384826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166114639092919063ffffffff16565b90508051600014806113a55750808060200190518101906113a59190611dc1565b611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161045c565b600081831061144d57600082815260208490526040902061145c565b60008381526020839052604090205b9392505050565b60606105068484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516114979190611e07565b60006040518083038185875af1925050503d80600081146114d4576040519150601f19603f3d011682016040523d82523d6000602084013e6114d9565b606091505b50915091506114ea878383876114f5565b979650505050505050565b6060831561158b5782516000036115845773ffffffffffffffffffffffffffffffffffffffff85163b611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045c565b5081610506565b61050683838151156115a05781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045c9190611e23565b600080604083850312156115e757600080fd5b50508035926020909101359150565b60006020828403121561160857600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461163357600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561168a5761168a611638565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116d7576116d7611638565b604052919050565b600067ffffffffffffffff8211156116f9576116f9611638565b5060051b60200190565b600082601f83011261171457600080fd5b81356020611729611724836116df565b611690565b8083825260208201915060208460051b87010193508684111561174b57600080fd5b602086015b848110156117675780358352918301918301611750565b509695505050505050565b6000806000806080858703121561178857600080fd5b6117918561160f565b93506020850135925060408501359150606085013567ffffffffffffffff8111156117bb57600080fd5b6117c787828801611703565b91505092959194509250565b60008083601f8401126117e557600080fd5b50813567ffffffffffffffff8111156117fd57600080fd5b6020830191508360208260051b850101111561181857600080fd5b9250929050565b60008060006040848603121561183457600080fd5b61183d8461160f565b9250602084013567ffffffffffffffff81111561185957600080fd5b611865868287016117d3565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b818110156118ac57835115158352928401929184019160010161188e565b50909695505050505050565b6000806000606084860312156118cd57600080fd5b833592506020808501359250604085013567ffffffffffffffff8111156118f357600080fd5b8501601f8101871361190457600080fd5b8035611912611724826116df565b81815260059190911b8201830190838101908983111561193157600080fd5b928401925b82841015611956576119478461160f565b82529284019290840190611936565b80955050505050509250925092565b60006020828403121561197757600080fd5b61145c8261160f565b6000806040838503121561199357600080fd5b823591506119a36020840161160f565b90509250929050565b6000806000604084860312156119c157600080fd5b833567ffffffffffffffff8111156119d857600080fd5b6119e4868287016117d3565b90945092506119f790506020850161160f565b90509250925092565b60008060008060808587031215611a1657600080fd5b67ffffffffffffffff8086351115611a2d57600080fd5b8535860187601f820112611a4057600080fd5b611a4d61172482356116df565b81358082526020808301929160051b8401018a811115611a6c57600080fd5b602084015b81811015611b0c578581351115611a8757600080fd5b8035850160607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0828f03011215611abd57600080fd5b611ac5611667565b6020820135815260408201356020820152606082013588811115611ae857600080fd5b611af78f602083860101611703565b60408301525085525060209384019301611a71565b505080975050505050611b216020860161160f565b925060408501359150611b366060860161160f565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611b8257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b80851115611c1157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611bf757611bf7611b89565b80851615611c0457918102915b93841c9390800290611bbd565b509250929050565b600082611c2857506001610a6c565b81611c3557506000610a6c565b8160018114611c4b5760028114611c5557611c71565b6001915050610a6c565b60ff841115611c6657611c66611b89565b50506001821b610a6c565b5060208310610133831016604e8410600b8410161715611c94575081810a610a6c565b611c9e8383611bb8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611cd057611cd0611b89565b029392505050565b600061145c8383611c19565b80820180821115610a6c57610a6c611b89565b8082028115828204841417610a6c57610a6c611b89565b600082611d44577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6040808252810183905260008460608301825b86811015611d975773ffffffffffffffffffffffffffffffffffffffff611d828461160f565b16825260209283019290910190600101611d5c565b50809250505073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b600060208284031215611dd357600080fd5b8151801515811461145c57600080fd5b60005b83811015611dfe578181015183820152602001611de6565b50506000910152565b60008251611e19818460208701611de3565b9190910192915050565b6020815260008251806020840152611e42816040850160208701611de3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220516932bd2a8467cfd28bbf385c9d22da9054ce50bd8d166616977b64bbc35bff64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000064
-----Decoded View---------------
Arg [0] : _scale (uint256): 10
Arg [1] : _max (uint256): 100
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000064
Loading...
Loading
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.