Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- LayerswapV8ERC20
- Optimization enabled
- true
- Compiler version
- v0.8.23+commit.f704f362
- Optimization runs
- 200
- EVM Version
- paris
- Verified at
- 2024-10-15T10:52:55.794412Z
contracts/HashedTimeLockERC20.sol
/* _ __ _____ | | __ _ _ _ ___ _ __ _____ ____ _ _ __ \ \ / ( _ ) | | / _` | | | |/ _ \ '__/ __\ \ /\ / / _` | '_ \ \ \ / // _ \ | |__| (_| | |_| | __/ | \__ \\ V V / (_| | |_) | \ V /| (_) | |_____\__,_|\__, |\___|_| |___/ \_/\_/ \__,_| .__/ \_/ \___/ |___/ |_| */ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; /** * @title Hashed Timelock contracts (HTLCs) on Ethereum ERC20 tokens. * * This contract provides a way to lock and keep HTLCs for ERC20 tokens. * * Protocol: * * 1) lock(srcReceiver, hashlock, timelock, tokenContract, amount) - a * sender calls this to lock a new HTLC on a given token (tokenContract) * for a given amount. A 32 byte contract id is returned * 2) redeem(contractId, secret) - once the srcReceiver knows the secret of * the hashlock hash they can claim the tokens with this function * 3) refund() - after timelock has expired and if the srcReceiver did not * redeem the tokens the sender / creator of the HTLC can get their tokens * back with this function. */ struct EIP712Domain { string name; string version; uint256 chainId; address verifyingContract; bytes32 salt; } contract LayerswapV8ERC20 { using ECDSA for bytes32; using Address for address; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant SALT = keccak256(abi.encodePacked('Layerswap V8')); constructor() { DOMAIN_SEPARATOR = hashDomain( EIP712Domain({ name: 'LayerswapV8ERC20', version: '1', chainId: block.chainid, verifyingContract: address(this), salt: SALT }) ); } struct HTLC { string dstAddress; string dstChain; string dstAsset; string srcAsset; address payable sender; address payable srcReceiver; bytes32 hashlock; uint256 timelock; uint256 amount; uint256 secret; address tokenContract; bool redeemed; bool refunded; } struct addLockMsg { bytes32 Id; bytes32 hashlock; uint256 timelock; } using SafeERC20 for IERC20; mapping(bytes32 => HTLC) contracts; bytes32[] contractIds; uint256 blockHashAsUint = uint256(blockhash(block.number - 1)); uint256 contractNonce = 0; event TokenCommitted( bytes32 indexed Id, string[] hopChains, string[] hopAssets, string[] hopAddresses, string dstChain, string dstAddress, string dstAsset, address indexed sender, address indexed srcReceiver, string srcAsset, uint amount, uint timelock, address tokenContract ); event TokenLocked( bytes32 indexed Id, bytes32 hashlock, string dstChain, string dstAddress, string dstAsset, address indexed sender, address indexed srcReceiver, string srcAsset, uint amount, uint timelock, address tokenContract ); event TokenRedeemed(bytes32 indexed Id, address redeemAddress); event TokenRefunded(bytes32 indexed Id); event LowLevelErrorOccurred(bytes lowLevelData); modifier _exists(bytes32 Id) { require(hasHTLC(Id),"HTLC Not Exists"); _; } function commit( string[] memory hopChains, string[] memory hopAssets, string[] memory hopAddresses, string memory dstChain, string memory dstAsset, string memory dstAddress, string memory srcAsset, address srcReceiver, uint timelock, uint amount, address tokenContract ) external returns (bytes32 Id) { require(amount > 0,"Funds Not Sent"); require(timelock > block.timestamp,"Not Future Timelock"); IERC20 token = IERC20(tokenContract); require(token.balanceOf(msg.sender) >= amount,"Insufficient Balance"); require(token.allowance(msg.sender, address(this)) >= amount,"No Allowance"); token.safeTransferFrom(msg.sender, address(this), amount); contractNonce += 1; Id = bytes32(blockHashAsUint ^ contractNonce); //Remove this check; the ID is guaranteed to be unique. require(!hasHTLC(Id),"HTLC Already Exists"); contractIds.push(Id); contracts[Id] = HTLC( dstAddress, dstChain, dstAsset, srcAsset, payable(msg.sender), payable(srcReceiver), bytes32(0), timelock, amount, uint256(0), tokenContract, false, false ); emit TokenCommitted( Id, hopChains, hopAssets, hopAddresses, dstChain, dstAddress, dstAsset, msg.sender, srcReceiver, srcAsset, amount, timelock, tokenContract ); } function addLock(bytes32 Id, bytes32 hashlock, uint256 timelock) external _exists(Id) returns (bytes32) { HTLC storage htlc = contracts[Id]; require(!htlc.refunded,"Already Refunded"); require(timelock > block.timestamp,"Not Future Timelock"); if (msg.sender == htlc.sender || msg.sender == address(this)) { if (htlc.hashlock == 0) { htlc.hashlock = hashlock; htlc.timelock = timelock; } else { require(false,"Hashlock Already Set"); } emit TokenLocked( Id, hashlock, htlc.dstChain, htlc.dstAddress, htlc.dstAsset, htlc.sender, htlc.srcReceiver, htlc.srcAsset, htlc.amount, timelock, htlc.tokenContract ); return Id; } else { require(false,"No Allowance"); } } function addLockSig(addLockMsg memory message, uint8 v, bytes32 r, bytes32 s) external returns (bytes32) { if (verifyMessage(message, v, r, s)) { return this.addLock(message.Id, message.hashlock, message.timelock); } else { require(false,"Invalid Signiture"); } } /** * @dev Sender / Payer sets up a new hash time lock contract depositing the * funds and providing the reciever and terms. * @param srcReceiver srcReceiver of the funds. * @param hashlock A sha-256 hash hashlock. * @param timelock UNIX epoch seconds time that the lock expires at. * unlocks can be made after this time. * @return Id Id of the new HTLC. This is needed for subsequent * calls. */ function lock( bytes32 Id, bytes32 hashlock, uint256 timelock, address srcReceiver, string memory srcAsset, string memory dstChain, string memory dstAddress, string memory dstAsset, uint256 amount, address tokenContract ) external returns (bytes32) { require(amount > 0, "Funds Not Sent"); require(timelock > block.timestamp,"Not Future Timelock"); require(!hasHTLC(Id),"HTLC Already Exists"); IERC20 token = IERC20(tokenContract); require(token.balanceOf(msg.sender) >= amount,"Insufficient Balance"); require(token.allowance(msg.sender, address(this)) >= amount,"No Allowance"); token.safeTransferFrom(msg.sender, address(this), amount); contracts[Id] = HTLC( dstAddress, dstChain, dstAsset, srcAsset, payable(msg.sender), payable(srcReceiver), hashlock, timelock, amount, 0x0, tokenContract, false, false ); contractIds.push(Id); emit TokenLocked( Id, hashlock, dstChain, dstAddress, dstAsset, msg.sender, srcReceiver, srcAsset, amount, timelock, tokenContract ); return Id; } /** * @dev Called by the srcReceiver once they know the secret of the hashlock. * This will transfer the locked funds to their address. * * @param Id Id of the HTLC. * @param secret sha256(secret) should equal the contract hashlock. * @return bool true on success */ function redeem(bytes32 Id, uint256 secret) external _exists(Id) returns (bool) { HTLC storage htlc = contracts[Id]; require(htlc.hashlock == sha256(abi.encodePacked(secret)),"Hashlock Not Match"); require(!htlc.refunded,"Already Refunded"); require(!htlc.redeemed,"Already Redeemed"); htlc.secret = secret; htlc.redeemed = true; IERC20(htlc.tokenContract).safeTransfer(htlc.srcReceiver, htlc.amount); emit TokenRedeemed(Id, msg.sender); return true; } /** * @dev Called by the sender if there was no redeem AND the time lock has * expired. This will refund the contract amount. * @param Id Id of HTLC to refund from. * @return bool true on success */ function refund(bytes32 Id) external _exists(Id) returns (bool) { HTLC storage htlc = contracts[Id]; require(!htlc.refunded,"Already Refunded"); require(!htlc.redeemed,"Already Redeemed"); require(htlc.timelock <= block.timestamp,"Not Passed Timelock"); htlc.refunded = true; IERC20(htlc.tokenContract).safeTransfer(htlc.sender, htlc.amount); emit TokenRefunded(Id); return true; } /** * @dev Get contract details. * @param Id HTLC contract id */ function getDetails(bytes32 Id) external view returns (HTLC memory) { return contracts[Id]; } /** * @dev Check if there is a contract with a given id. * @param Id Id into contracts mapping. */ function hasHTLC(bytes32 Id) internal view returns (bool exists) { exists = (contracts[Id].sender != address(0)); } function getContracts(address senderAddr) public view returns (bytes32[] memory) { uint count = 0; for (uint i = 0; i < contractIds.length; i++) { HTLC memory htlc = contracts[contractIds[i]]; if (htlc.sender == senderAddr) { count++; } } bytes32[] memory result = new bytes32[](count); uint j = 0; for (uint i = 0; i < contractIds.length; i++) { if (contracts[contractIds[i]].sender == senderAddr) { result[j] = contractIds[i]; j++; } } return result; } function hashDomain(EIP712Domain memory domain) private pure returns (bytes32) { return keccak256( abi.encode( keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)'), keccak256(bytes(domain.name)), keccak256(bytes(domain.version)), domain.chainId, domain.verifyingContract, domain.salt ) ); } // Hashes an EIP712 message struct function hashMessage(addLockMsg memory message) private pure returns (bytes32) { return keccak256( abi.encode( keccak256('addLockMsg(bytes32 Id,bytes32 hashlock,uint256 timelock)'), message.Id, message.hashlock, message.timelock ) ); } // Verifies an EIP712 message signature function verifyMessage(addLockMsg memory message, uint8 v, bytes32 r, bytes32 s) private view returns (bool) { bytes32 digest = keccak256(abi.encodePacked('\x19\x01', DOMAIN_SEPARATOR, hashMessage(message))); address recoveredAddress = ecrecover(digest, v, r, s); return (recoveredAddress == contracts[message.Id].sender); } }
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @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. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../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 An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, 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); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @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.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @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); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @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(token).code.length > 0; } }
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) 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 FailedInnerCall(); } } }
@openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS, s); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
Compiler Settings
{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AddressEmptyCode","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"error","name":"AddressInsufficientBalance","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"FailedInnerCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"LowLevelErrorOccurred","inputs":[{"type":"bytes","name":"lowLevelData","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"TokenCommitted","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32","indexed":true},{"type":"string[]","name":"hopChains","internalType":"string[]","indexed":false},{"type":"string[]","name":"hopAssets","internalType":"string[]","indexed":false},{"type":"string[]","name":"hopAddresses","internalType":"string[]","indexed":false},{"type":"string","name":"dstChain","internalType":"string","indexed":false},{"type":"string","name":"dstAddress","internalType":"string","indexed":false},{"type":"string","name":"dstAsset","internalType":"string","indexed":false},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"srcReceiver","internalType":"address","indexed":true},{"type":"string","name":"srcAsset","internalType":"string","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"timelock","internalType":"uint256","indexed":false},{"type":"address","name":"tokenContract","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenLocked","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"hashlock","internalType":"bytes32","indexed":false},{"type":"string","name":"dstChain","internalType":"string","indexed":false},{"type":"string","name":"dstAddress","internalType":"string","indexed":false},{"type":"string","name":"dstAsset","internalType":"string","indexed":false},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"address","name":"srcReceiver","internalType":"address","indexed":true},{"type":"string","name":"srcAsset","internalType":"string","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"timelock","internalType":"uint256","indexed":false},{"type":"address","name":"tokenContract","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenRedeemed","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32","indexed":true},{"type":"address","name":"redeemAddress","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenRefunded","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"addLock","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"},{"type":"bytes32","name":"hashlock","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"addLockSig","inputs":[{"type":"tuple","name":"message","internalType":"struct LayerswapV8ERC20.addLockMsg","components":[{"type":"bytes32","name":"Id","internalType":"bytes32"},{"type":"bytes32","name":"hashlock","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"}]},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"}],"name":"commit","inputs":[{"type":"string[]","name":"hopChains","internalType":"string[]"},{"type":"string[]","name":"hopAssets","internalType":"string[]"},{"type":"string[]","name":"hopAddresses","internalType":"string[]"},{"type":"string","name":"dstChain","internalType":"string"},{"type":"string","name":"dstAsset","internalType":"string"},{"type":"string","name":"dstAddress","internalType":"string"},{"type":"string","name":"srcAsset","internalType":"string"},{"type":"address","name":"srcReceiver","internalType":"address"},{"type":"uint256","name":"timelock","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getContracts","inputs":[{"type":"address","name":"senderAddr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct LayerswapV8ERC20.HTLC","components":[{"type":"string","name":"dstAddress","internalType":"string"},{"type":"string","name":"dstChain","internalType":"string"},{"type":"string","name":"dstAsset","internalType":"string"},{"type":"string","name":"srcAsset","internalType":"string"},{"type":"address","name":"sender","internalType":"address payable"},{"type":"address","name":"srcReceiver","internalType":"address payable"},{"type":"bytes32","name":"hashlock","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"secret","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"},{"type":"bool","name":"redeemed","internalType":"bool"},{"type":"bool","name":"refunded","internalType":"bool"}]}],"name":"getDetails","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"lock","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"},{"type":"bytes32","name":"hashlock","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"},{"type":"address","name":"srcReceiver","internalType":"address"},{"type":"string","name":"srcAsset","internalType":"string"},{"type":"string","name":"dstChain","internalType":"string"},{"type":"string","name":"dstAddress","internalType":"string"},{"type":"string","name":"dstAsset","internalType":"string"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"redeem","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"},{"type":"uint256","name":"secret","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"refund","inputs":[{"type":"bytes32","name":"Id","internalType":"bytes32"}]}]
Contract Creation Code
0x608060409080825234620001885760001943014381116200017257406003556000908160045560208101906b098c2f2cae4e6eec2e040ac760a31b8252600c81526200004b816200018d565b51902082516001600160401b039390919060a08301858111848210176200015e578082526200007a816200018d565b601081526f04c6179657273776170563845524332360841b60c08501528352805192620000a7846200018d565b600184526020840190603160f81b825284602082015246838201523060608201528360808201525160208151910120935190209181519260208401947fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647286528385015260608401524660808401523060a084015260c083015260c0825260e0820194828610908611176200014a5784905251902090556124d09081620001c08239f35b634e487b7160e01b84526041600452602484fd5b634e487b7160e01b85526041600452602485fd5b634e487b7160e01b600052601160045260246000fd5b600080fd5b604081019081106001600160401b03821117620001a957604052565b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b60003560e01c8063213fe2b714611869578063527c58ba14610fb2578063673da15414610e475780637249fbb614610d2d57806375ad188114610cdd578063984bc70014610a7f578063b3c016cf146101035763beeaa6151461007457600080fd5b346100e857366003190160c081126100e8576060136100e857604051606081018181106001600160401b038211176100ed576040526004358152602435602082015260443560408201526064359060ff821682036100e8576020916100e09160a435916084359161216f565b604051908152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b346100e8576101603660031901126100e8576004356001600160401b0381116100e857610134903690600401611bf2565b6024356001600160401b0381116100e857610153903690600401611bf2565b906044356001600160401b0381116100e857610173903690600401611bf2565b906064356001600160401b0381116100e857610193903690600401611b4c565b6084356001600160401b0381116100e8576101b2903690600401611b4c565b60a4356001600160401b0381116100e8576101d1903690600401611b4c565b9060c4356001600160401b0381116100e8576101f1903690600401611b4c565b60e435939092906001600160a01b03851685036100e857610144356001600160a01b03811690036100e85761022a610124351515611d87565b610238426101043511611dc4565b6040516370a0823160e01b8152336004820152602081602481610144356001600160a01b03165afa8015610a3f57600090610a4b575b61027e9150610124351115611e48565b604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b0361014435165afa8015610a3f57600090610a0b575b6102ca9150610124351115611e8b565b6102e5610124353033610144356001600160a01b0316612307565b6004546001810181116109f55780600180920160045501600354189661032c61032689600052600160205260018060a01b0360046040600020015416151590565b15611e06565b61033588611ec6565b604051986103428a611abe565b838a528260208b01528460408b01528560608b01523360808b015260018060a01b03871660a08b0152600060c08b01526101043560e08b0152610124356101008b015260006101208b015260018060a01b0361014435166101408b015260006101608b015260006101808b015288600052600160205260406000208a518051906001600160401b0382116100ed5781906103dc8454611ca8565b601f81116109a5575b50602090601f83116001146109395760009261092e575b50508160011b916000199060031b1c19161781555b60208b01518051906001600160401b0382116100ed5781906104366001850154611ca8565b601f81116108db575b50602090601f83116001146108695760009261085e575b50508160011b916000199060031b1c19161760018201555b60408b01518051906001600160401b0382116100ed5781906104936002850154611ca8565b601f811161080b575b50602090601f83116001146107995760009261078e575b50508160011b916000199060031b1c19161760028201555b60608b01519a8b516001600160401b0381116100ed576104ee6003840154611ca8565b601f8111610747575b506020601f82116001146106ce5781908d9e60009e9c9d9e926106c3575b50508160011b916000199060031b1c19161760038301555b60808101516004830180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005860180549093169084161790915560c0830151600685015560e0830151600785015561010083015160088501556101208301516009850155610140830151600a90940180546101608501516001600160a81b03199091169590931694909417911515901b60ff60a01b161782556101800151815460ff60a81b191690151560a81b60ff60a81b16179055604051986101408a526101408a016105fc91612112565b89810360208b015261060d91612112565b88810360408a015261061e91612112565b878103606089015261062f91611bb6565b868103608088015261064091611bb6565b85810360a087015261065191611bb6565b84810360c086015261066291611bb6565b6101243560e085015261010435610100850152610144356001600160a01b039081166101208601529092169233927f625ba51e51c5f2c394db4494f428998d9a34cd2f81e1ff9f134570a67f92ac46919081900390a4604051908152602090f35b015190508e80610515565b6003840160005260206000209d60005b601f198416811061072a57509d82918e9f9d9e9c9d600194601f19811610610711575b505050811b01600383015561052d565b015160001960f88460031b161c191690558e8080610701565b909e8f60016020928584930151815501930191019e90919e6106de565b600384016000526020600020601f830160051c810160208410610787575b601f830160051c8201811061077b5750506104f7565b60008155600101610765565b5080610765565b015190508d806104b3565b9250600284016000526020600020906000935b601f19841685106107f0576001945083601f198116106107d7575b505050811b0160028201556104cb565b015160001960f88460031b161c191690558d80806107c7565b818101518355602094850194600190930192909101906107ac565b909150600284016000526020600020601f840160051c810160208510610857575b90849392915b601f830160051c8201811061084857505061049c565b60008155859450600101610832565b508061082c565b015190508d80610456565b9250600184016000526020600020906000935b601f19841685106108c0576001945083601f198116106108a7575b505050811b01600182015561046e565b015160001960f88460031b161c191690558d8080610897565b8181015183556020948501946001909301929091019061087c565b909150600184016000526020600020601f840160051c810160208510610927575b90849392915b601f830160051c8201811061091857505061043f565b60008155859450600101610902565b50806108fc565b015190508d806103fc565b9250836000526020600020906000935b601f198416851061098a576001945083601f19811610610971575b505050811b018155610411565b015160001960f88460031b161c191690558d8080610964565b81810151835560209485019460019093019290910190610949565b909150836000526020600020601f840160051c8101602085106109ee575b90849392915b601f830160051c820181106109df5750506103e5565b600081558594506001016109c9565b50806109c3565b634e487b7160e01b600052601160045260246000fd5b506020813d602011610a37575b81610a2560209383611b10565b810103126100e8576102ca90516102ba565b3d9150610a18565b6040513d6000823e3d90fd5b506020813d602011610a77575b81610a6560209383611b10565b810103126100e85761027e905161026e565b3d9150610a58565b346100e85760203660031901126100e8576000610180604051610aa181611abe565b6060815260606020820152606060408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526004356000526001602052604060002060ff600a60405192610b1084611abe565b604051610b2881610b218185611ce2565b0382611b10565b8452604051610b3e81610b218160018601611ce2565b6020850152604051610b5781610b218160028601611ce2565b6040850152604051610b7081610b218160038601611ce2565b606085015260018060a01b03600482015416608085015260018060a01b0360058201541660a0850152600681015460c0850152600781015460e085015260088101546101008501526009810154610120850152015460018060a01b038116610140840152818160a01c16151561016084015260a81c161515610180820152604051809160208252610180610c5d610c1583516101a060208701526101c0860190611bb6565b610c48610c34602086015192601f1993848983030160408a0152611bb6565b604086015183888303016060890152611bb6565b90606085015190868303016080870152611bb6565b9160018060a01b0360808201511660a085015260018060a01b0360a08201511660c085015260c081015160e085015260e081015161010085015261010081015161012085015261012081015161014085015260018060a01b0361014082015116610160850152610160810151151582850152015115156101a08301520390f35b346100e85760603660031901126100e85760206100e0600435610d20610d1b82600052600160205260018060a01b0360046040600020015416151590565b611f02565b6044359060243590611fbe565b346100e85760203660031901126100e85760048035600081815260016020526040902090910154610d68906001600160a01b03161515611f02565b806000526001602052604060002090600a82018054610d8d60ff8260a81c1615611f40565b610d9d60ff8260a01c1615611f7f565b60078401544210610e0c5760ff60a81b198116600160a81b179091556004830154600890930154602093610ddd926001600160a01b039182169116612350565b604051907f92b8d387b3b4732fb701784c5e553091c36997ec127e0865a7c990bc62cc7382600080a260018152f35b60405162461bcd60e51b81526020600482015260136024820152724e6f74205061737365642054696d656c6f636b60681b6044820152606490fd5b346100e85760403660031901126100e85760043560243590610e84610d1b82600052600160205260018060a01b0360046040600020015416151590565b806000526020916001835260406000206006810154604051858101848152868252604082018281106001600160401b038211176100ed57879281610ed2600094826040528351928391611b93565b8101039060025afa15610a3f5760005103610f78579081600a610f469301805492610f0360ff8560a81c1615611f40565b610f1360ff8560a01c1615611f7f565b600983015560ff60a01b198316600160a01b1790556005810154600890910154916001600160a01b039182169116612350565b7f0f7c50d316885e5d3719752f760bbbbf7d56363501e721eea4d913e255b632e482604051338152a260405160018152f35b60405162461bcd60e51b8152600481018590526012602482015271090c2e6d0d8dec6d6409cdee8409ac2e8c6d60731b6044820152606490fd5b346100e8576101403660031901126100e8576064356001600160a01b03811681036100e8576084356001600160401b0381116100e857610ff6903690600401611b4c565b9060a4356001600160401b0381116100e857611016903690600401611b4c565b9060c4356001600160401b0381116100e857611036903690600401611b4c565b9260e4356001600160401b0381116100e857611056903690600401611b4c565b61012435946001600160a01b03861686036100e857611079610104351515611d87565b6110864260443511611dc4565b60048035600090815260016020526040902001546110ae906001600160a01b03161515610326565b6040516370a0823160e01b81523360048201526020816024816001600160a01b038b165afa8015610a3f57600090611835575b6110f19150610104351115611e48565b604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b038b165afa8015610a3f57600090611801575b61113a9150610104351115611e8b565b6111526101043530336001600160a01b038a16612307565b60405161115e81611abe565b81815285602082015282604082015283606082015233608082015260018060a01b03851660a082015260243560c082015260443560e082015261010435610100820152600061012082015260018060a01b03871661014082015260006101608201526000610180820152600435600052600160205260406000209080518051906001600160401b0382116100ed5781906111f88554611ca8565b601f81116117b1575b50602090601f83116001146117455760009261173a575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b0382116100ed5781906112526001860154611ca8565b601f81116116e7575b50602090601f83116001146116755760009261166a575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b0382116100ed5781906112af6002860154611ca8565b601f8111611617575b50602090601f83116001146115a55760009261159a575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b0382116100ed5761130a6003850154611ca8565b601f8111611553575b50602090601f83116001146114cf579361018061144a94846114589895611412956114669c9b996000926114c4575b50508160011b916000199060031b1c19161760038401555b60808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783550151815460ff60a81b191690151560a81b60ff60a81b16179055565b61141d600435611ec6565b61143c604051986024358a5261010060208b01526101008a0190611bb6565b9088820360408a0152611bb6565b908682036060880152611bb6565b908482036080860152611bb6565b6101043560a084015260443560c08401526001600160a01b0393841660e08401529216913391600435917f3b0d81a1222f6461aad9f7e61041b1d52638afa81257eced76b240abc105de51919081900390a460206040516004358152f35b015190508f80611342565b906003850160005260206000209160005b601f198516811061153b575061144a94600185611412956114669c9b9995610180956114589c99601f19811610611522575b505050811b01600384015561135a565b015160001960f88460031b161c191690558f8080611512565b919260206001819286850151815501940192016114e0565b600385016000526020600020601f840160051c810160208510611593575b601f830160051c82018110611587575050611313565b60008155600101611571565b5080611571565b015190508a806112cf565b9250600285016000526020600020906000935b601f19841685106115fc576001945083601f198116106115e3575b505050811b0160028301556112e7565b015160001960f88460031b161c191690558a80806115d3565b818101518355602094850194600190930192909101906115b8565b909150600285016000526020600020601f840160051c810160208510611663575b90849392915b601f830160051c820181106116545750506112b8565b6000815585945060010161163e565b5080611638565b015190508a80611272565b9250600185016000526020600020906000935b601f19841685106116cc576001945083601f198116106116b3575b505050811b01600183015561128a565b015160001960f88460031b161c191690558a80806116a3565b81810151835560209485019460019093019290910190611688565b909150600185016000526020600020601f840160051c810160208510611733575b90849392915b601f830160051c8201811061172457505061125b565b6000815585945060010161170e565b5080611708565b015190508a80611218565b9250846000526020600020906000935b601f1984168510611796576001945083601f1981161061177d575b505050811b01825561122d565b015160001960f88460031b161c191690558a8080611770565b81810151835560209485019460019093019290910190611755565b909150846000526020600020601f840160051c8101602085106117fa575b90849392915b601f830160051c820181106117eb575050611201565b600081558594506001016117d5565b50806117cf565b506020813d60201161182d575b8161181b60209383611b10565b810103126100e85761113a905161112a565b3d915061180e565b506020813d602011611861575b8161184f60209383611b10565b810103126100e8576110f190516110e1565b3d9150611842565b346100e8576020806003193601126100e8576001600160a01b03600435818116908190036100e85760009060009060028054925b8381106119a25750506118c86118b284611bdb565b936118c06040519586611b10565b808552611bdb565b8386019490601f190136863760009160005b84811061192457878688604051928392818401908285525180915260408401929160005b82811061190d57505050500390f35b8351855286955093810193928101926001016118fe565b61192d81611c71565b9054600391821b1c6000526001895282846004604060002001541614611957575b506001016118da565b611962829592611c71565b9054911b1c865182101561198c5781611985918a60019460051b8a010152611d78565b939061194e565b634e487b7160e01b600052603260045260246000fd5b826119ac82611c71565b9054600391821b1c6000526001808a52610b21611a26604060002093610b216119fc604051956119db87611abe565b6040516119ec81610b21818c611ce2565b8752604051928380928a01611ce2565b8d850152604051611a1381610b21818c8a01611ce2565b6040850152604051928380928701611ce2565b60608201526101808960048401541692836080840152600a8b6005830154169160a09283860152600681015460c0860152600781015460e086015260088101546101008601526009810154610120860152015480918c821661014086015260ff9283911c16151561016085015260a81c16151591015214611aaa575b60010161189d565b93611ab6600191611d78565b949050611aa2565b6101a081019081106001600160401b038211176100ed57604052565b60a081019081106001600160401b038211176100ed57604052565b608081019081106001600160401b038211176100ed57604052565b90601f801991011681019081106001600160401b038211176100ed57604052565b6001600160401b0381116100ed57601f01601f191660200190565b81601f820112156100e857803590611b6382611b31565b92611b716040519485611b10565b828452602083830101116100e857816000926020809301838601378301015290565b60005b838110611ba65750506000910152565b8181015183820152602001611b96565b90602091611bcf81518092818552858086019101611b93565b601f01601f1916010190565b6001600160401b0381116100ed5760051b60200190565b81601f820112156100e857803591602091611c0c84611bdb565b93611c1a6040519586611b10565b808552838086019160051b830101928084116100e857848301915b848310611c455750505050505090565b82356001600160401b0381116100e8578691611c6684848094890101611b4c565b815201920191611c35565b60025481101561198c5760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b90600182811c92168015611cd8575b6020831014611cc257565b634e487b7160e01b600052602260045260246000fd5b91607f1691611cb7565b805460009392611cf182611ca8565b91828252602093600191600181169081600014611d595750600114611d18575b5050505050565b90939495506000929192528360002092846000945b838610611d4557505050500101903880808080611d11565b805485870183015294019385908201611d2d565b60ff19168685015250505090151560051b010191503880808080611d11565b60001981146109f55760010190565b15611d8e57565b60405162461bcd60e51b815260206004820152600e60248201526d119d5b991cc8139bdd0814d95b9d60921b6044820152606490fd5b15611dcb57565b60405162461bcd60e51b81526020600482015260136024820152724e6f74204675747572652054696d656c6f636b60681b6044820152606490fd5b15611e0d57565b60405162461bcd60e51b815260206004820152601360248201527248544c4320416c72656164792045786973747360681b6044820152606490fd5b15611e4f57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742042616c616e636560601b6044820152606490fd5b15611e9257565b60405162461bcd60e51b815260206004820152600c60248201526b4e6f20416c6c6f77616e636560a01b6044820152606490fd5b600254680100000000000000008110156100ed57806001611eea9201600255611c71565b819291549060031b91821b91600019901b1916179055565b15611f0957565b60405162461bcd60e51b815260206004820152600f60248201526e48544c43204e6f742045786973747360881b6044820152606490fd5b15611f4757565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481499599d5b99195960821b6044820152606490fd5b15611f8657565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e4814995919595b595960821b6044820152606490fd5b918260005260016020526040600020600a8101611fe260ff825460a81c1615611f40565b611fed428411611dc4565b6004820180546001600160a01b039590861633148015612109575b15611e925760068401928354156000146120cd5787948761208994847f3b0d81a1222f6461aad9f7e61041b1d52638afa81257eced76b240abc105de5197558860078401555416966120b7896005840154169960088401549454169260036120a8612097604051998a99610100908b528060208c01528a0160018601611ce2565b89810360408b015284611ce2565b88810360608a015260028401611ce2565b91878303608089015201611ce2565b9260a085015260c084015260e08301520390a490565b60405162461bcd60e51b815260206004820152601460248201527312185cda1b1bd8dac8105b1c9958591e4814d95d60621b6044820152606490fd5b50303314612008565b90808251908181526020809101926020808460051b8301019501936000915b8483106121415750505050505090565b909192939495848061215f600193601f198682030187528a51611bb6565b9801930193019194939290612131565b9060009182549080519584608060209586938486019960ff8b51986040809e818b019b8c518351918c8301937f45906d7e53feffed68a8db947e0f8839b1ee252166e8eead8c6ab3951a09c7b68552858401526060830152898201528881526121d781611ada565b5190209051908982019261190160f01b8452602283015260428201526042815261220081611af5565b519020938d5194855216868401528b830152606082015282805260015afa156122fd5783518151855260018452868520600401546001600160a01b039182169116036122c5575193519051908551946375ad188160e01b8652600486015260248501526044840152808360648185305af19384156122ba57508193612286575b50505090565b9091809350813d83116122b3575b61229e8183611b10565b810103126122b0575051388080612280565b80fd5b503d612294565b51913d9150823e3d90fd5b855162461bcd60e51b8152600481018490526011602482015270496e76616c6964205369676e697475726560781b6044820152606490fd5b85513d85823e3d90fd5b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261234e9161234982611ada565b612389565b565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261234e9161234982611af5565b60018060a01b0316906123d3600080836020829551910182875af13d1561242f573d906123b582611b31565b916123c36040519384611b10565b82523d84602084013e5b84612437565b908151918215159283612403575b5050506123eb5750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261242b5760200151908115918215036122b057503880806123e1565b5080fd5b6060906123cd565b9061245e575080511561244c57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612491575b61246f575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561246756fea2646970667358221220cbbe4e228c482b83096086bffdf7496ae458596804aa853934a1bed004e1847164736f6c63430008170033
Deployed ByteCode
0x6080604052600436101561001257600080fd5b60003560e01c8063213fe2b714611869578063527c58ba14610fb2578063673da15414610e475780637249fbb614610d2d57806375ad188114610cdd578063984bc70014610a7f578063b3c016cf146101035763beeaa6151461007457600080fd5b346100e857366003190160c081126100e8576060136100e857604051606081018181106001600160401b038211176100ed576040526004358152602435602082015260443560408201526064359060ff821682036100e8576020916100e09160a435916084359161216f565b604051908152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b346100e8576101603660031901126100e8576004356001600160401b0381116100e857610134903690600401611bf2565b6024356001600160401b0381116100e857610153903690600401611bf2565b906044356001600160401b0381116100e857610173903690600401611bf2565b906064356001600160401b0381116100e857610193903690600401611b4c565b6084356001600160401b0381116100e8576101b2903690600401611b4c565b60a4356001600160401b0381116100e8576101d1903690600401611b4c565b9060c4356001600160401b0381116100e8576101f1903690600401611b4c565b60e435939092906001600160a01b03851685036100e857610144356001600160a01b03811690036100e85761022a610124351515611d87565b610238426101043511611dc4565b6040516370a0823160e01b8152336004820152602081602481610144356001600160a01b03165afa8015610a3f57600090610a4b575b61027e9150610124351115611e48565b604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b0361014435165afa8015610a3f57600090610a0b575b6102ca9150610124351115611e8b565b6102e5610124353033610144356001600160a01b0316612307565b6004546001810181116109f55780600180920160045501600354189661032c61032689600052600160205260018060a01b0360046040600020015416151590565b15611e06565b61033588611ec6565b604051986103428a611abe565b838a528260208b01528460408b01528560608b01523360808b015260018060a01b03871660a08b0152600060c08b01526101043560e08b0152610124356101008b015260006101208b015260018060a01b0361014435166101408b015260006101608b015260006101808b015288600052600160205260406000208a518051906001600160401b0382116100ed5781906103dc8454611ca8565b601f81116109a5575b50602090601f83116001146109395760009261092e575b50508160011b916000199060031b1c19161781555b60208b01518051906001600160401b0382116100ed5781906104366001850154611ca8565b601f81116108db575b50602090601f83116001146108695760009261085e575b50508160011b916000199060031b1c19161760018201555b60408b01518051906001600160401b0382116100ed5781906104936002850154611ca8565b601f811161080b575b50602090601f83116001146107995760009261078e575b50508160011b916000199060031b1c19161760028201555b60608b01519a8b516001600160401b0381116100ed576104ee6003840154611ca8565b601f8111610747575b506020601f82116001146106ce5781908d9e60009e9c9d9e926106c3575b50508160011b916000199060031b1c19161760038301555b60808101516004830180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005860180549093169084161790915560c0830151600685015560e0830151600785015561010083015160088501556101208301516009850155610140830151600a90940180546101608501516001600160a81b03199091169590931694909417911515901b60ff60a01b161782556101800151815460ff60a81b191690151560a81b60ff60a81b16179055604051986101408a526101408a016105fc91612112565b89810360208b015261060d91612112565b88810360408a015261061e91612112565b878103606089015261062f91611bb6565b868103608088015261064091611bb6565b85810360a087015261065191611bb6565b84810360c086015261066291611bb6565b6101243560e085015261010435610100850152610144356001600160a01b039081166101208601529092169233927f625ba51e51c5f2c394db4494f428998d9a34cd2f81e1ff9f134570a67f92ac46919081900390a4604051908152602090f35b015190508e80610515565b6003840160005260206000209d60005b601f198416811061072a57509d82918e9f9d9e9c9d600194601f19811610610711575b505050811b01600383015561052d565b015160001960f88460031b161c191690558e8080610701565b909e8f60016020928584930151815501930191019e90919e6106de565b600384016000526020600020601f830160051c810160208410610787575b601f830160051c8201811061077b5750506104f7565b60008155600101610765565b5080610765565b015190508d806104b3565b9250600284016000526020600020906000935b601f19841685106107f0576001945083601f198116106107d7575b505050811b0160028201556104cb565b015160001960f88460031b161c191690558d80806107c7565b818101518355602094850194600190930192909101906107ac565b909150600284016000526020600020601f840160051c810160208510610857575b90849392915b601f830160051c8201811061084857505061049c565b60008155859450600101610832565b508061082c565b015190508d80610456565b9250600184016000526020600020906000935b601f19841685106108c0576001945083601f198116106108a7575b505050811b01600182015561046e565b015160001960f88460031b161c191690558d8080610897565b8181015183556020948501946001909301929091019061087c565b909150600184016000526020600020601f840160051c810160208510610927575b90849392915b601f830160051c8201811061091857505061043f565b60008155859450600101610902565b50806108fc565b015190508d806103fc565b9250836000526020600020906000935b601f198416851061098a576001945083601f19811610610971575b505050811b018155610411565b015160001960f88460031b161c191690558d8080610964565b81810151835560209485019460019093019290910190610949565b909150836000526020600020601f840160051c8101602085106109ee575b90849392915b601f830160051c820181106109df5750506103e5565b600081558594506001016109c9565b50806109c3565b634e487b7160e01b600052601160045260246000fd5b506020813d602011610a37575b81610a2560209383611b10565b810103126100e8576102ca90516102ba565b3d9150610a18565b6040513d6000823e3d90fd5b506020813d602011610a77575b81610a6560209383611b10565b810103126100e85761027e905161026e565b3d9150610a58565b346100e85760203660031901126100e8576000610180604051610aa181611abe565b6060815260606020820152606060408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526004356000526001602052604060002060ff600a60405192610b1084611abe565b604051610b2881610b218185611ce2565b0382611b10565b8452604051610b3e81610b218160018601611ce2565b6020850152604051610b5781610b218160028601611ce2565b6040850152604051610b7081610b218160038601611ce2565b606085015260018060a01b03600482015416608085015260018060a01b0360058201541660a0850152600681015460c0850152600781015460e085015260088101546101008501526009810154610120850152015460018060a01b038116610140840152818160a01c16151561016084015260a81c161515610180820152604051809160208252610180610c5d610c1583516101a060208701526101c0860190611bb6565b610c48610c34602086015192601f1993848983030160408a0152611bb6565b604086015183888303016060890152611bb6565b90606085015190868303016080870152611bb6565b9160018060a01b0360808201511660a085015260018060a01b0360a08201511660c085015260c081015160e085015260e081015161010085015261010081015161012085015261012081015161014085015260018060a01b0361014082015116610160850152610160810151151582850152015115156101a08301520390f35b346100e85760603660031901126100e85760206100e0600435610d20610d1b82600052600160205260018060a01b0360046040600020015416151590565b611f02565b6044359060243590611fbe565b346100e85760203660031901126100e85760048035600081815260016020526040902090910154610d68906001600160a01b03161515611f02565b806000526001602052604060002090600a82018054610d8d60ff8260a81c1615611f40565b610d9d60ff8260a01c1615611f7f565b60078401544210610e0c5760ff60a81b198116600160a81b179091556004830154600890930154602093610ddd926001600160a01b039182169116612350565b604051907f92b8d387b3b4732fb701784c5e553091c36997ec127e0865a7c990bc62cc7382600080a260018152f35b60405162461bcd60e51b81526020600482015260136024820152724e6f74205061737365642054696d656c6f636b60681b6044820152606490fd5b346100e85760403660031901126100e85760043560243590610e84610d1b82600052600160205260018060a01b0360046040600020015416151590565b806000526020916001835260406000206006810154604051858101848152868252604082018281106001600160401b038211176100ed57879281610ed2600094826040528351928391611b93565b8101039060025afa15610a3f5760005103610f78579081600a610f469301805492610f0360ff8560a81c1615611f40565b610f1360ff8560a01c1615611f7f565b600983015560ff60a01b198316600160a01b1790556005810154600890910154916001600160a01b039182169116612350565b7f0f7c50d316885e5d3719752f760bbbbf7d56363501e721eea4d913e255b632e482604051338152a260405160018152f35b60405162461bcd60e51b8152600481018590526012602482015271090c2e6d0d8dec6d6409cdee8409ac2e8c6d60731b6044820152606490fd5b346100e8576101403660031901126100e8576064356001600160a01b03811681036100e8576084356001600160401b0381116100e857610ff6903690600401611b4c565b9060a4356001600160401b0381116100e857611016903690600401611b4c565b9060c4356001600160401b0381116100e857611036903690600401611b4c565b9260e4356001600160401b0381116100e857611056903690600401611b4c565b61012435946001600160a01b03861686036100e857611079610104351515611d87565b6110864260443511611dc4565b60048035600090815260016020526040902001546110ae906001600160a01b03161515610326565b6040516370a0823160e01b81523360048201526020816024816001600160a01b038b165afa8015610a3f57600090611835575b6110f19150610104351115611e48565b604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b038b165afa8015610a3f57600090611801575b61113a9150610104351115611e8b565b6111526101043530336001600160a01b038a16612307565b60405161115e81611abe565b81815285602082015282604082015283606082015233608082015260018060a01b03851660a082015260243560c082015260443560e082015261010435610100820152600061012082015260018060a01b03871661014082015260006101608201526000610180820152600435600052600160205260406000209080518051906001600160401b0382116100ed5781906111f88554611ca8565b601f81116117b1575b50602090601f83116001146117455760009261173a575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b0382116100ed5781906112526001860154611ca8565b601f81116116e7575b50602090601f83116001146116755760009261166a575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b0382116100ed5781906112af6002860154611ca8565b601f8111611617575b50602090601f83116001146115a55760009261159a575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b0382116100ed5761130a6003850154611ca8565b601f8111611553575b50602090601f83116001146114cf579361018061144a94846114589895611412956114669c9b996000926114c4575b50508160011b916000199060031b1c19161760038401555b60808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783550151815460ff60a81b191690151560a81b60ff60a81b16179055565b61141d600435611ec6565b61143c604051986024358a5261010060208b01526101008a0190611bb6565b9088820360408a0152611bb6565b908682036060880152611bb6565b908482036080860152611bb6565b6101043560a084015260443560c08401526001600160a01b0393841660e08401529216913391600435917f3b0d81a1222f6461aad9f7e61041b1d52638afa81257eced76b240abc105de51919081900390a460206040516004358152f35b015190508f80611342565b906003850160005260206000209160005b601f198516811061153b575061144a94600185611412956114669c9b9995610180956114589c99601f19811610611522575b505050811b01600384015561135a565b015160001960f88460031b161c191690558f8080611512565b919260206001819286850151815501940192016114e0565b600385016000526020600020601f840160051c810160208510611593575b601f830160051c82018110611587575050611313565b60008155600101611571565b5080611571565b015190508a806112cf565b9250600285016000526020600020906000935b601f19841685106115fc576001945083601f198116106115e3575b505050811b0160028301556112e7565b015160001960f88460031b161c191690558a80806115d3565b818101518355602094850194600190930192909101906115b8565b909150600285016000526020600020601f840160051c810160208510611663575b90849392915b601f830160051c820181106116545750506112b8565b6000815585945060010161163e565b5080611638565b015190508a80611272565b9250600185016000526020600020906000935b601f19841685106116cc576001945083601f198116106116b3575b505050811b01600183015561128a565b015160001960f88460031b161c191690558a80806116a3565b81810151835560209485019460019093019290910190611688565b909150600185016000526020600020601f840160051c810160208510611733575b90849392915b601f830160051c8201811061172457505061125b565b6000815585945060010161170e565b5080611708565b015190508a80611218565b9250846000526020600020906000935b601f1984168510611796576001945083601f1981161061177d575b505050811b01825561122d565b015160001960f88460031b161c191690558a8080611770565b81810151835560209485019460019093019290910190611755565b909150846000526020600020601f840160051c8101602085106117fa575b90849392915b601f830160051c820181106117eb575050611201565b600081558594506001016117d5565b50806117cf565b506020813d60201161182d575b8161181b60209383611b10565b810103126100e85761113a905161112a565b3d915061180e565b506020813d602011611861575b8161184f60209383611b10565b810103126100e8576110f190516110e1565b3d9150611842565b346100e8576020806003193601126100e8576001600160a01b03600435818116908190036100e85760009060009060028054925b8381106119a25750506118c86118b284611bdb565b936118c06040519586611b10565b808552611bdb565b8386019490601f190136863760009160005b84811061192457878688604051928392818401908285525180915260408401929160005b82811061190d57505050500390f35b8351855286955093810193928101926001016118fe565b61192d81611c71565b9054600391821b1c6000526001895282846004604060002001541614611957575b506001016118da565b611962829592611c71565b9054911b1c865182101561198c5781611985918a60019460051b8a010152611d78565b939061194e565b634e487b7160e01b600052603260045260246000fd5b826119ac82611c71565b9054600391821b1c6000526001808a52610b21611a26604060002093610b216119fc604051956119db87611abe565b6040516119ec81610b21818c611ce2565b8752604051928380928a01611ce2565b8d850152604051611a1381610b21818c8a01611ce2565b6040850152604051928380928701611ce2565b60608201526101808960048401541692836080840152600a8b6005830154169160a09283860152600681015460c0860152600781015460e086015260088101546101008601526009810154610120860152015480918c821661014086015260ff9283911c16151561016085015260a81c16151591015214611aaa575b60010161189d565b93611ab6600191611d78565b949050611aa2565b6101a081019081106001600160401b038211176100ed57604052565b60a081019081106001600160401b038211176100ed57604052565b608081019081106001600160401b038211176100ed57604052565b90601f801991011681019081106001600160401b038211176100ed57604052565b6001600160401b0381116100ed57601f01601f191660200190565b81601f820112156100e857803590611b6382611b31565b92611b716040519485611b10565b828452602083830101116100e857816000926020809301838601378301015290565b60005b838110611ba65750506000910152565b8181015183820152602001611b96565b90602091611bcf81518092818552858086019101611b93565b601f01601f1916010190565b6001600160401b0381116100ed5760051b60200190565b81601f820112156100e857803591602091611c0c84611bdb565b93611c1a6040519586611b10565b808552838086019160051b830101928084116100e857848301915b848310611c455750505050505090565b82356001600160401b0381116100e8578691611c6684848094890101611b4c565b815201920191611c35565b60025481101561198c5760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b90600182811c92168015611cd8575b6020831014611cc257565b634e487b7160e01b600052602260045260246000fd5b91607f1691611cb7565b805460009392611cf182611ca8565b91828252602093600191600181169081600014611d595750600114611d18575b5050505050565b90939495506000929192528360002092846000945b838610611d4557505050500101903880808080611d11565b805485870183015294019385908201611d2d565b60ff19168685015250505090151560051b010191503880808080611d11565b60001981146109f55760010190565b15611d8e57565b60405162461bcd60e51b815260206004820152600e60248201526d119d5b991cc8139bdd0814d95b9d60921b6044820152606490fd5b15611dcb57565b60405162461bcd60e51b81526020600482015260136024820152724e6f74204675747572652054696d656c6f636b60681b6044820152606490fd5b15611e0d57565b60405162461bcd60e51b815260206004820152601360248201527248544c4320416c72656164792045786973747360681b6044820152606490fd5b15611e4f57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742042616c616e636560601b6044820152606490fd5b15611e9257565b60405162461bcd60e51b815260206004820152600c60248201526b4e6f20416c6c6f77616e636560a01b6044820152606490fd5b600254680100000000000000008110156100ed57806001611eea9201600255611c71565b819291549060031b91821b91600019901b1916179055565b15611f0957565b60405162461bcd60e51b815260206004820152600f60248201526e48544c43204e6f742045786973747360881b6044820152606490fd5b15611f4757565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481499599d5b99195960821b6044820152606490fd5b15611f8657565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e4814995919595b595960821b6044820152606490fd5b918260005260016020526040600020600a8101611fe260ff825460a81c1615611f40565b611fed428411611dc4565b6004820180546001600160a01b039590861633148015612109575b15611e925760068401928354156000146120cd5787948761208994847f3b0d81a1222f6461aad9f7e61041b1d52638afa81257eced76b240abc105de5197558860078401555416966120b7896005840154169960088401549454169260036120a8612097604051998a99610100908b528060208c01528a0160018601611ce2565b89810360408b015284611ce2565b88810360608a015260028401611ce2565b91878303608089015201611ce2565b9260a085015260c084015260e08301520390a490565b60405162461bcd60e51b815260206004820152601460248201527312185cda1b1bd8dac8105b1c9958591e4814d95d60621b6044820152606490fd5b50303314612008565b90808251908181526020809101926020808460051b8301019501936000915b8483106121415750505050505090565b909192939495848061215f600193601f198682030187528a51611bb6565b9801930193019194939290612131565b9060009182549080519584608060209586938486019960ff8b51986040809e818b019b8c518351918c8301937f45906d7e53feffed68a8db947e0f8839b1ee252166e8eead8c6ab3951a09c7b68552858401526060830152898201528881526121d781611ada565b5190209051908982019261190160f01b8452602283015260428201526042815261220081611af5565b519020938d5194855216868401528b830152606082015282805260015afa156122fd5783518151855260018452868520600401546001600160a01b039182169116036122c5575193519051908551946375ad188160e01b8652600486015260248501526044840152808360648185305af19384156122ba57508193612286575b50505090565b9091809350813d83116122b3575b61229e8183611b10565b810103126122b0575051388080612280565b80fd5b503d612294565b51913d9150823e3d90fd5b855162461bcd60e51b8152600481018490526011602482015270496e76616c6964205369676e697475726560781b6044820152606490fd5b85513d85823e3d90fd5b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261234e9161234982611ada565b612389565b565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261234e9161234982611af5565b60018060a01b0316906123d3600080836020829551910182875af13d1561242f573d906123b582611b31565b916123c36040519384611b10565b82523d84602084013e5b84612437565b908151918215159283612403575b5050506123eb5750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261242b5760200151908115918215036122b057503880806123e1565b5080fd5b6060906123cd565b9061245e575080511561244c57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612491575b61246f575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561246756fea2646970667358221220cbbe4e228c482b83096086bffdf7496ae458596804aa853934a1bed004e1847164736f6c63430008170033