Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- HashedTimeLockERC20
- Optimization enabled
- true
- Compiler version
- v0.8.23+commit.f704f362
- Optimization runs
- 200
- EVM Version
- paris
- Verified at
- 2024-08-15T11:31:03.753496Z
contracts/HashedTimeLockERC20.sol
/* _ __ _____ | | __ _ _ _ ___ _ __ _____ ____ _ _ __ \ \ / ( _ ) | | / _` | | | |/ _ \ '__/ __\ \ /\ / / _` | '_ \ \ \ / // _ \ | |__| (_| | |_| | __/ | \__ \\ V V / (_| | |_) | \ V /| (_) | |_____\__,_|\__, |\___|_| |___/ \_/\_/ \__,_| .__/ \_/ \___/ |___/ |_| */ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; /** * @title Hashed Timelock locks (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) unlock() - 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. */ interface IMessenger { function notify( bytes32 commitId, bytes32 hashlock, string memory dstChain, string memory dstAsset, string memory dstAddress, string memory srcAsset, address payable sender, address payable srcReceiver, uint256 amount, uint256 timelock, address tokenContract ) external; } contract HashedTimeLockERC20 { error FundsNotSent(); error NotFutureTimelock(); error NotPassedTimelock(); error LockAlreadyExists(); error CommitIdAlreadyExists(); error LockNotExists(); error HashlockNotMatch(); error AlreadyRedeemed(); error AlreadyUnlocked(); error NoMessenger(); error CommitmentNotExists(); error IncorrectData(); error InsufficientBalance(); error NoAllowance(); error AlreadyLocked(); error AlreadyUncommitted(); struct HTLC { string dstAddress; string dstChain; string dstAsset; string srcAsset; address payable sender; address payable srcReceiver; bytes32 hashlock; uint256 secret; uint256 amount; uint256 timelock; address tokenContract; bool redeemed; bool unlocked; } struct PHTLC { string dstAddress; string dstChain; string dstAsset; string srcAsset; address payable sender; address payable srcReceiver; bytes32 lockId; uint timelock; uint amount; address messenger; address tokenContract; bool locked; bool uncommitted; } using SafeERC20 for IERC20; mapping(bytes32 => HTLC) locks; mapping(bytes32 => PHTLC) commits; mapping(bytes32 => bytes32) commitIdToLockId; bytes32[] lockIds; bytes32[] commitIds; bytes32 blockHash = blockhash(block.number - 1); uint256 blockHashAsUint = uint256(blockHash); uint256 contractNonce = 0; event TokenLocked( bytes32 indexed hashlock, string dstChain, string dstAddress, string dstAsset, address indexed sender, address indexed srcReceiver, string srcAsset, uint amount, uint timelock, address messenger, bytes32 commitId, address tokenContract ); event TokenRedeemed(bytes32 indexed lockId, address redeemAddress); event TokenUnlocked(bytes32 indexed lockId); event TokenCommitted( bytes32 commitId, string[] hopChains, string[] hopAssets, string[] hopAddresses, string dstChain, string dstAddress, string dstAsset, address sender, address srcReceiver, string srcAsset, uint amount, uint timelock, address messenger, address tokenContract ); event LowLevelErrorOccurred(bytes lowLevelData); event TokenUncommitted(bytes32 indexed commitId); modifier _committed(bytes32 commitId) { if (!hasPHTLC(commitId)) revert CommitmentNotExists(); _; } modifier _locked(bytes32 lockId) { if (!hasHTLC(lockId)) revert LockNotExists(); _; } 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, address messenger, uint amount, address tokenContract ) external payable returns (bytes32 commitId) { if (amount == 0) { revert FundsNotSent(); } if (timelock <= block.timestamp) { revert NotFutureTimelock(); } IERC20 token = IERC20(tokenContract); if (token.balanceOf(msg.sender) < amount) { revert InsufficientBalance(); } if (token.allowance(msg.sender, address(this)) < amount) { revert NoAllowance(); } token.safeTransferFrom(msg.sender, address(this), amount); contractNonce+=1; commitId = bytes32(blockHashAsUint ^ contractNonce); if (hasPHTLC(commitId)) { revert CommitIdAlreadyExists(); } commitIds.push(commitId); commits[commitId] = PHTLC( dstAddress, dstChain, dstAsset, srcAsset, payable(msg.sender), payable(srcReceiver), bytes32(0), timelock, amount, messenger, tokenContract, false, false ); emit TokenCommitted( commitId, hopChains, hopAssets, hopAddresses, dstChain, dstAddress, dstAsset, msg.sender, srcReceiver, srcAsset, amount, timelock, messenger, tokenContract ); } function lockCommitment(bytes32 commitId, bytes32 hashlock, uint256 timelock) external _committed(commitId) returns (bytes32 lockId) { lockId = hashlock; if (commits[commitId].uncommitted == true) { revert AlreadyUncommitted(); } if (commits[commitId].locked == true) { revert AlreadyLocked(); } if (hasHTLC(lockId)) { revert LockAlreadyExists(); } if (msg.sender == commits[commitId].sender || msg.sender == commits[commitId].messenger) { commits[commitId].locked = true; commits[commitId].lockId = hashlock; locks[lockId] = HTLC( commits[commitId].dstAddress, commits[commitId].dstChain, commits[commitId].dstAsset, commits[commitId].srcAsset, payable(commits[commitId].sender), commits[commitId].srcReceiver, hashlock, 0x0, commits[commitId].amount, timelock, commits[commitId].tokenContract, false, false ); lockIds.push(hashlock); emit TokenLocked( hashlock, commits[commitId].dstChain, commits[commitId].dstAddress, commits[commitId].dstAsset, commits[commitId].sender, commits[commitId].srcReceiver, commits[commitId].srcAsset, commits[commitId].amount, timelock, commits[commitId].messenger, commitId, commits[commitId].tokenContract ); } else { revert NoAllowance(); } } /** * @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 lockId Id of the new HTLC. This is needed for subsequent * calls. */ function lock( bytes32 hashlock, uint256 timelock, address srcReceiver, string memory srcAsset, string memory dstChain, string memory dstAddress, string memory dstAsset, bytes32 commitId, address messenger, uint256 amount, address tokenContract ) external returns (bytes32 lockId) { if (timelock <= block.timestamp) { revert NotFutureTimelock(); } if (amount == 0) { revert FundsNotSent(); } lockId = hashlock; if (hasHTLC(lockId)) { revert LockAlreadyExists(); } IERC20 token = IERC20(tokenContract); if (token.balanceOf(msg.sender) < amount) { revert InsufficientBalance(); } if (token.allowance(msg.sender, address(this)) < amount) { revert NoAllowance(); } token.safeTransferFrom(msg.sender, address(this), amount); locks[lockId] = HTLC( dstAddress, dstChain, dstAsset, srcAsset, payable(msg.sender), payable(srcReceiver), hashlock, 0x0, amount, timelock, tokenContract, false, false ); lockIds.push(hashlock); commitIdToLockId[commitId] = lockId; emit TokenLocked( hashlock, dstChain, dstAddress, dstAsset, msg.sender, srcReceiver, srcAsset, amount, timelock, messenger, commitId, tokenContract ); if (messenger != address(0)) { uint256 codeSize; assembly { codeSize := extcodesize(messenger) } if (codeSize > 0) { try IMessenger(messenger).notify( commitId, hashlock, dstChain, dstAsset, dstAddress, srcAsset, payable(msg.sender), payable(srcReceiver), amount, timelock, tokenContract ) { // Notify successful } catch Error(string memory reason) { revert(reason); } catch (bytes memory lowLevelData) { emit LowLevelErrorOccurred(lowLevelData); revert('IMessenger notify failed'); } } else { revert NoMessenger(); } } } /** * @dev Called by the srcReceiver once they know the secret of the hashlock. * This will transfer the locked funds to their address. * * @param lockId Id of the HTLC. * @param secret sha256(secret) should equal the contract hashlock. * @return bool true on success */ function redeem(bytes32 lockId, uint256 secret) external _locked(lockId) returns (bool) { HTLC storage htlc = locks[lockId]; if (htlc.hashlock != sha256(abi.encodePacked(secret))) revert HashlockNotMatch(); if (htlc.redeemed) revert AlreadyRedeemed(); if (htlc.unlocked) revert AlreadyUnlocked(); htlc.secret = secret; htlc.redeemed = true; IERC20(htlc.tokenContract).safeTransfer(htlc.srcReceiver, htlc.amount); emit TokenRedeemed(lockId, msg.sender); return true; } /** * @dev Called by the sender if there was no redeem AND the time lock has * expired. This will unlock the contract amount. * @param lockId Id of HTLC to unlock from. * @return bool true on success */ function unlock(bytes32 lockId) external _locked(lockId) returns (bool) { HTLC storage htlc = locks[lockId]; if (htlc.unlocked) revert AlreadyUnlocked(); if (htlc.redeemed) revert AlreadyRedeemed(); if (htlc.timelock > block.timestamp) revert NotPassedTimelock(); htlc.unlocked = true; IERC20(htlc.tokenContract).safeTransfer(htlc.sender, htlc.amount); emit TokenUnlocked(lockId); return true; } function uncommit(bytes32 commitId) external _committed(commitId) returns (bool) { PHTLC storage phtlc = commits[commitId]; if (phtlc.uncommitted) revert AlreadyUncommitted(); if (phtlc.locked) revert AlreadyLocked(); if (phtlc.timelock > block.timestamp) revert NotPassedTimelock(); phtlc.uncommitted = true; IERC20(phtlc.tokenContract).safeTransfer(phtlc.sender, phtlc.amount); emit TokenUncommitted(commitId); return true; } /** * @dev Get contract details. * @param lockId HTLC contract id */ function getLockDetails(bytes32 lockId) external view returns (HTLC memory) { if (hasHTLC(lockId) == false) { HTLC memory emptyHTLC = HTLC({ dstAddress: '', dstChain: '', dstAsset: '', srcAsset: '', sender: payable(address(0)), srcReceiver: payable(address(0)), hashlock: bytes32(0x0), secret: uint256(0), amount: uint256(0), timelock: uint256(0), tokenContract: address(0), redeemed: false, unlocked: false }); return emptyHTLC; } HTLC storage htlc = locks[lockId]; return htlc; } function getCommitDetails(bytes32 commitId) public view returns (PHTLC memory) { if (!hasPHTLC(commitId)) { PHTLC memory empyPHTLC = PHTLC({ dstAddress: '', dstChain: '', dstAsset: '', srcAsset: '', sender: payable(address(0)), srcReceiver: payable(address(0)), lockId: bytes32(0), timelock: uint256(0), amount: uint256(0), messenger: address(0), tokenContract: address(0), locked: false, uncommitted: false }); return empyPHTLC; } PHTLC storage phtlc = commits[commitId]; return phtlc; } /** * @dev Check if there is a contract with a given id. * @param lockId Id into locks mapping. */ function hasHTLC(bytes32 lockId) internal view returns (bool exists) { exists = (locks[lockId].sender != address(0)); } function hasPHTLC(bytes32 commitId) internal view returns (bool exists) { exists = (commits[commitId].sender != address(0)); } function getLocks(address senderAddr) public view returns (bytes32[] memory) { uint count = 0; for (uint i = 0; i < lockIds.length; i++) { HTLC memory htlc = locks[lockIds[i]]; if (htlc.sender == senderAddr) { count++; } } bytes32[] memory result = new bytes32[](count); uint j = 0; for (uint i = 0; i < lockIds.length; i++) { if (locks[lockIds[i]].sender == senderAddr) { result[j] = lockIds[i]; j++; } } return result; } function getCommits(address senderAddr) public view returns (bytes32[] memory) { uint count = 0; for (uint i = 0; i < commitIds.length; i++) { PHTLC memory phtlc = commits[commitIds[i]]; if (phtlc.sender == senderAddr) { count++; } } bytes32[] memory result = new bytes32[](count); uint j = 0; for (uint i = 0; i < commitIds.length; i++) { if (commits[commitIds[i]].sender == senderAddr) { result[j] = commitIds[i]; j++; } } return result; } function getLockIdByCommitId(bytes32 commitId) public view returns (bytes32) { return commitIdToLockId[commitId]; } }
@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(); } } }
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":"error","name":"AddressEmptyCode","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"error","name":"AddressInsufficientBalance","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"AlreadyLocked","inputs":[]},{"type":"error","name":"AlreadyRedeemed","inputs":[]},{"type":"error","name":"AlreadyUncommitted","inputs":[]},{"type":"error","name":"AlreadyUnlocked","inputs":[]},{"type":"error","name":"CommitIdAlreadyExists","inputs":[]},{"type":"error","name":"CommitmentNotExists","inputs":[]},{"type":"error","name":"FailedInnerCall","inputs":[]},{"type":"error","name":"FundsNotSent","inputs":[]},{"type":"error","name":"HashlockNotMatch","inputs":[]},{"type":"error","name":"IncorrectData","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[]},{"type":"error","name":"LockAlreadyExists","inputs":[]},{"type":"error","name":"LockNotExists","inputs":[]},{"type":"error","name":"NoAllowance","inputs":[]},{"type":"error","name":"NoMessenger","inputs":[]},{"type":"error","name":"NotFutureTimelock","inputs":[]},{"type":"error","name":"NotPassedTimelock","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":"commitId","internalType":"bytes32","indexed":false},{"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":false},{"type":"address","name":"srcReceiver","internalType":"address","indexed":false},{"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":"messenger","internalType":"address","indexed":false},{"type":"address","name":"tokenContract","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenLocked","inputs":[{"type":"bytes32","name":"hashlock","internalType":"bytes32","indexed":true},{"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":"messenger","internalType":"address","indexed":false},{"type":"bytes32","name":"commitId","internalType":"bytes32","indexed":false},{"type":"address","name":"tokenContract","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenRedeemed","inputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32","indexed":true},{"type":"address","name":"redeemAddress","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenUncommitted","inputs":[{"type":"bytes32","name":"commitId","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"TokenUnlocked","inputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"payable","outputs":[{"type":"bytes32","name":"commitId","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":"address","name":"messenger","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct HashedTimeLockERC20.PHTLC","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":"lockId","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"messenger","internalType":"address"},{"type":"address","name":"tokenContract","internalType":"address"},{"type":"bool","name":"locked","internalType":"bool"},{"type":"bool","name":"uncommitted","internalType":"bool"}]}],"name":"getCommitDetails","inputs":[{"type":"bytes32","name":"commitId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getCommits","inputs":[{"type":"address","name":"senderAddr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct HashedTimeLockERC20.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":"secret","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"timelock","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"},{"type":"bool","name":"redeemed","internalType":"bool"},{"type":"bool","name":"unlocked","internalType":"bool"}]}],"name":"getLockDetails","inputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getLockIdByCommitId","inputs":[{"type":"bytes32","name":"commitId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getLocks","inputs":[{"type":"address","name":"senderAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32"}],"name":"lock","inputs":[{"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":"bytes32","name":"commitId","internalType":"bytes32"},{"type":"address","name":"messenger","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"tokenContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32"}],"name":"lockCommitment","inputs":[{"type":"bytes32","name":"commitId","internalType":"bytes32"},{"type":"bytes32","name":"hashlock","internalType":"bytes32"},{"type":"uint256","name":"timelock","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"redeem","inputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32"},{"type":"uint256","name":"secret","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"uncommit","inputs":[{"type":"bytes32","name":"commitId","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"unlock","inputs":[{"type":"bytes32","name":"lockId","internalType":"bytes32"}]}]
Contract Creation Code
0x6080806040523461004557600019430143811161002f574080600555600655600060075561304b908161004b8239f35b634e487b7160e01b600052601160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8063255f3154146125e75780632ea3b73c1461241657806339e35271146123ec5780633b9c1f5b146122ea5780636552b7421461184d578063673da15414611705578063719f308914611536578063c5bea8b514610d05578063dcc19d59146102bb578063ec9b5b3a146101b35763f5a1862a1461009657600080fd5b346101b05760203660031901126101b057600435906100cd82600052600160205260018060a01b0360046040600020015416151590565b1561019e5781815260016020526040812091600a8301805460ff8160a81c1661018c5760ff8160a01c1661017a57600785015442106101685760ff60a81b198116600160a81b17909155600484015460089094015460209461013b926001600160a01b039182169116612ee5565b7fa123e15752679aa06522e49c50e26d336ea83e1aa2e8ecdc4a32f437a474d1366040519280a260018152f35b60405163b3f711f760e01b8152600490fd5b6040516317c3335f60e21b8152600490fd5b604051630e4a482d60e11b8152600490fd5b604051630bfa77dd60e41b8152600490fd5b80fd5b50346101b05760203660031901126101b057600435906101eb82600052600060205260018060a01b0360046040600020015416151590565b156102a957818152806020526040812091600a8301805460ff8160a81c166102975760ff8160a01c1661028557600985015442106101685760ff60a81b198116600160a81b179091556004840154600890940154602094610258926001600160a01b039182169116612ee5565b7f3d4cedda486476ed25b0bd452211f1c4b1af03b25ad9d223a96238f84ce640f46040519280a260018152f35b6040516306d3830f60e21b8152600490fd5b6040516328486b6360e11b8152600490fd5b604051632254ea3d60e11b8152600490fd5b506101803660031901126101b0576004356001600160401b038111610d01576102e890369060040161280a565b6024356001600160401b038111610cfd5761030790369060040161280a565b906044356001600160401b038111610cf95761032790369060040161280a565b6064356001600160401b038111610cf5576103469036906004016127ac565b906084356001600160401b038111610cf1576103669036906004016127ac565b60a4356001600160401b038111610ced576103859036906004016127ac565b60c4356001600160401b038111610ce9576103a49036906004016127ac565b9160e435916001600160a01b0383168303610c695761012435956001600160a01b0387168703610c695761016435956001600160a01b0387168703610c69576101443515610cd75742610104351115610cc5576040516370a0823160e01b81523360048201526020816024816001600160a01b038c165afa908115610c76578c91610c93575b506101443511610c8157604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b038c165afa908115610c76578c91610c3f575b506101443511610c2d5761048f6101443530336001600160a01b038b16612e8b565b60075460018101809111610c1957600781905560065418600081815260016020526040902060040154909b906001600160a01b0316610c0757600454600160401b811015610bf1576105026104eb828f93600101600455612b65565b819391549060031b91821b91600019901b19161790565b905560405161051081612739565b84815260208082018590526040808301889052606083018a90523360808401526001600160a01b0389811660a085015260c084018590526101043560e0850152610144356101008501528c81166101208501528b16610140840152610160830184905261018083018490528e84526001909152822081518051919391906001600160401b038211610a555781906105a786546128ed565b601f8111610ba3575b50602090601f8311600114610b3a578492610b2f575b50508160011b916000199060031b1c19161783555b60208201518051906001600160401b038211610a5557819061060060018701546128ed565b601f8111610ade575b50602090601f8311600114610a74578492610a69575b50508160011b916000199060031b1c19161760018401555b60408201518051906001600160401b038211610a5557819061065c60028701546128ed565b601f8111610a04575b50602090601f831160011461099a57849261098f575b50508160011b916000199060031b1c19161760028401555b6060820151908151916001600160401b03831161097b579082916106ba60038701546128ed565b601f8111610928575b50602091601f84116001146108b957926108ae575b50508160011b916000199060031b1c19161760038301555b60808101516004830180546001600160a01b03199081166001600160a01b039384161790915560a083810151600586018054841691851691909117905560c0840151600686015560e08401516007860155610100840151600886015561012084015160098601805490931690841617909155610140830151600a90940180546101608501516001600160a81b03199091169590931694909417911515901b60ff60a01b161782556101800151815460ff60a81b191690151560a81b60ff60a81b16179055604051998a996101c08d8c528060208d01528b016107d191612e2e565b8a810360408c01526107e291612e2e565b89810360608b01526107f391612e2e565b88810360808a0152610804916126c2565b87810360a0890152610815916126c2565b86810360c0880152610826916126c2565b3360e08701526001600160a01b0390911661010086015284810361012086015261084f916126c2565b61014435610140850152610104356101608501526001600160a01b0392831661018085015291166101a08301527f39aa705c04023f1efa19bdc0767577e0092740a3754926bb71c98869b20000239291900390a1604051908152602090f35b0151905038806106d8565b6003870181526020812090945091905b601f198416851061090d576001945083601f198116106108f4575b505050811b0160038301556106f0565b015160001960f88460031b161c191690553880806108e4565b818101518355602094850194600190930192909101906108c9565b9091925060038601835260208320601f850160051c810160208610610974575b9085949392915b601f830160051c820181106109655750506106c3565b6000815586955060010161094f565b5080610948565b634e487b7160e01b82526041600452602482fd5b01519050388061067b565b600287018552602085209250601f198416855b8181106109ec57509084600195949392106109d3575b505050811b016002840155610693565b015160001960f88460031b161c191690553880806109c3565b929360206001819287860151815501950193016109ad565b90915060028601845260208420601f840160051c810160208510610a4e575b90849392915b601f830160051c82018110610a3f575050610665565b60008155859450600101610a29565b5080610a23565b634e487b7160e01b83526041600452602483fd5b01519050388061061f565b600187018552602085209250601f198416855b818110610ac65750908460019594939210610aad575b505050811b016001840155610637565b015160001960f88460031b161c19169055388080610a9d565b92936020600181928786015181550195019301610a87565b90915060018601845260208420601f840160051c810160208510610b28575b90849392915b601f830160051c82018110610b19575050610609565b60008155859450600101610b03565b5080610afd565b0151905038806105c6565b9250858452602084209084935b601f1984168510610b88576001945083601f19811610610b6f575b505050811b0183556105db565b015160001960f88460031b161c19169055388080610b62565b81810151835560209485019460019093019290910190610b47565b90915085845260208420601f840160051c810160208510610bea575b90849392915b601f830160051c82018110610bdb5750506105b0565b60008155859450600101610bc5565b5080610bbf565b634e487b7160e01b600052604160045260246000fd5b604051637870919b60e01b8152600490fd5b634e487b7160e01b8c52601160045260248cfd5b604051631d7eb35960e31b8152600490fd5b90506020813d602011610c6e575b81610c5a60209383612770565b81010312610c6957513861046d565b600080fd5b3d9150610c4d565b6040513d8e823e3d90fd5b604051631e9acf1760e31b8152600490fd5b90506020813d602011610cbd575b81610cae60209383612770565b81010312610c6957513861042a565b3d9150610ca1565b604051633dd8280960e21b8152600490fd5b604051636f8ab38d60e11b8152600490fd5b8780fd5b8680fd5b8580fd5b8480fd5b8380fd5b8280fd5b5080fd5b50346101b05760603660031901126101b05760048035600090815260016020526040902001546001600160a01b03161561019e5760043581526001602052600160ff600a60408420015460a81c1615151461018c5760043581526001602052600160ff600a60408420015460a01c1615151461017a576024356000908152602081905260409020600401546001600160a01b031661152457600435815260016020526040812060018060a01b03600482015416331490811561150d575b5015610c2d5760048035825260016020526040808320600a8101805460ff60a01b198116600160a01b17909155602435600683015592810154600582015460088301549351959493926001600160a01b039182169290911690600390610e8790610e2b89612739565b604051610e4381610e3c8185612927565b0382612770565b8952604051610e5981610e3c8160018601612927565b60208a0152604051610e7281610e3c8160028601612927565b60408a0152610e3c6040518094819301612927565b6060870152608086015260a085015260243560c08501528260e085015261010084015260443561012084015260018060a01b031661014083015280610160830152806101808301526024358152806020526040812082519283516001600160401b0381116112ce57610ef983546128ed565b601f81116114cb575b506020601f8211600114611465578495829394959261145a575b50508160011b916000199060031b1c19161782555b60208101519283516001600160401b03811161097b57610f5460018501546128ed565b601f8111611415575b506020601f82116001146113a9578293949582939261139e575b50508160011b916000199060031b1c19161760018401555b60408201519283516001600160401b038111610a5557610fb260028301546128ed565b601f8111611359575b506020601f82116001146112ed57839495829394926112e2575b50508160011b916000199060031b1c19161760028201555b60608301519283516001600160401b0381116112ce5761101060038401546128ed565b601f8111611289575b506020601f82116001146112135791816101809261110d95946040988892611208575b50508160011b916000199060031b1c19161760038401555b60808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783555b0151815460ff60a81b191690151560a81b60ff60a81b16179055565b611118602435612d67565b600435815260016020522060018060a01b0360048201541660018060a01b03600583015416917fe00962102cab6d15d8733bbc057ea3d34381c044904c4312bfdf966c2d11589a60088201549160018060a01b0360098201541660018060a01b03600a83015416906111d360405193610120855260036111c46111b36111a5610120890160018601612927565b88810360208a015284612927565b878103604089015260028401612927565b91868303606088015201612927565b94608084015260443560a084015260c083015260043560e083015261010082015280602435930390a460206040516024358152f35b01519050388061103c565b6003840185526020852095855b601f198416811061127157508260409761110d96959360019361018096601f19811610611258575b505050811b016003840155611054565b015160001960f88460031b161c19169055388080611248565b82820151885560019097019660209283019201611220565b60038401855260208520601f830160051c8101602084106112c7575b601f830160051c820181106112bb575050611019565b600081556001016112a5565b50806112a5565b634e487b7160e01b84526041600452602484fd5b015190503880610fd5565b6002830184526020842090845b601f1984168110611341575060019394959683601f19811610611328575b505050811b016002820155610fed565b015160001960f88460031b161c19169055388080611318565b9091602060018192858b0151815501930191016112fa565b60028301845260208420601f830160051c810160208410611397575b601f830160051c8201811061138b575050610fbb565b60008155600101611375565b5080611375565b015190503880610f77565b6001850183526020832090835b601f19841681106113fd575060019394959683601f198116106113e4575b505050811b016001840155610f8f565b015160001960f88460031b161c191690553880806113d4565b9091602060018192858b0151815501930191016113b6565b60018501835260208320601f830160051c810160208410611453575b601f830160051c82018110611447575050610f5d565b60008155600101611431565b5080611431565b015190503880610f1c565b8385526020852090855b601f19841681106114b3575060019394959683601f1981161061149a575b505050811b018255610f31565b015160001960f88460031b161c1916905538808061148d565b9091602060018192858b01518155019301910161146f565b83855260208520601f830160051c810160208410611506575b601f830160051c820181106114fa575050610f02565b600081556001016114e4565b50806114e4565b600901546001600160a01b03163314905038610dc2565b60405163748d150960e01b8152600490fd5b50346101b057602080600319360112610d01576115516126e7565b600380549290916001600160a01b039081169085805b8681106115f1575061157890612c0e565b958093815b87811061159657604051806115928b826126fd565b0390f35b61159f81612bb2565b905490881b1c83528282528484600460408620015416146115c3575b60010161157d565b946115e96001916115d388612bb2565b9054908a1b1c6115e3828d612c40565b52612be9565b9590506115bb565b6115fa81612bb2565b905490871b1c8852878552836040892060405161161681612739565b60405161162781610e3c8186612927565b815260405161163d81610e3c8160018701612927565b8882015260405161165581610e3c8160028701612927565b604082015260405161166d81610e3c818d8701612927565b60608201526101808660048401541692836080840152600a886005830154169160a09283860152600681015460c0860152600781015460e0860152600881015461010086015260098101546101208601520154809189821661014086015260ff9283911c16151561016085015260a81c161515910152146116f1575b600101611567565b906116fd600191612be9565b9190506116e9565b50346101b05760403660031901126101b05760043560243561173f82600052600060205260018060a01b0360046040600020015416151590565b156102a9578183526020928084526040812090600682015490604051868101858152878252604082018281106001600160401b03821117610bf157889281611790869482604052835192839161269f565b8101039060025afa1561184157510361182f57600a81019081549160ff8360a01c166102855760ff8360a81c1661029757600782019390935560ff60a01b198216600160a01b1790925560058201546008909201546117fd9290916001600160a01b039182169116612ee5565b7f0f7c50d316885e5d3719752f760bbbbf7d56363501e721eea4d913e255b632e482604051338152a260405160018152f35b60405163e73bcb3560e01b8152600490fd5b604051903d90823e3d90fd5b50346101b0576101603660031901126101b057604435906001600160a01b03821682036101b0576064356001600160401b038111610d01576118939036906004016127ac565b916084356001600160401b038111610cfd576118b39036906004016127ac565b9060a4356001600160401b038111610cf9576118d39036906004016127ac565b60c4356001600160401b038111610cf5576118f29036906004016127ac565b94610104356001600160a01b0381169003610cf55761014435916001600160a01b0383168303610cf157426024351115610cc5576101243515610cd75760048035600090815260208190526040902001546001600160a01b0316611524576040516370a0823160e01b81523360048201526020816024816001600160a01b0388165afa9081156122ad5787916122b8575b506101243511610c8157604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b0388165afa9081156122ad57879161227b575b506101243511610c2d576119e86101243530336001600160a01b038716612e8b565b6040516119f481612739565b81815285602082015287604082015282606082015233608082015260018060a01b03851660a082015260043560c08201528660e08201526101243561010082015260243561012082015260018060a01b0384166101408201528661016082015286610180820152600435875286602052604087209080518051906001600160401b03821161200f578190611a8885546128ed565b601f811161222d575b50602090601f83116001146121c4578b926121b9575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b03821161200f578190611ae160018601546128ed565b601f8111612168575b50602090601f83116001146120f9578b926120ee575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b03821161200f578190611b3d60028601546128ed565b601f811161209d575b50602090601f831160011461202e578b92612023575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b03821161200f57611b9760038501546128ed565b601f8111611fca575b50602090601f8311600114611f6f579180611c79959492610180948d926112085750508160011b916000199060031b1c191617600384015560808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783556110f1565b611c84600435612d67565b60e4358652600260205260043560408720556040516101208152611cdf611cd1611cc3611cb561012085018a6126c2565b8481036020860152856126c2565b83810360408501528a6126c2565b8281036060840152846126c2565b61012435608083015260243560a08301526001600160a01b0361010435811660c084015260e43560e08401528581166101008401528616913391600435917fe00962102cab6d15d8733bbc057ea3d34381c044904c4312bfdf966c2d11589a9181900390a4610104356001600160a01b0316611d62575b60206040516004358152f35b610104353b15611f5d57610104356001600160a01b03163b15610cf15791611dfc611dc69492611dea889795611dd86040519b8c998a99635e863a5b60e01b8b5260e43560048c015260043560248c015261016060448c01526101648b01906126c2565b8981036003190160648b0152906126c2565b878103600319016084890152906126c2565b8581036003190160a4870152906126c2565b913360c485015260018060a01b031660e48401526101243561010484015260243561012484015260018060a01b031661014483015203818360018060a01b0361010435165af19182611f46575b5090611f39578060033d11611f28575b506308c379a014611eed575b7f7b5bdb2f87e8e20f082bba9be5f7e870728f9bba18540559ccdcdcbb1fc5a087611ea5611e91612dfe565b6040519182916020835260208301906126c2565b0390a160405162461bcd60e51b815260206004820152601860248201527f494d657373656e676572206e6f74696679206661696c656400000000000000006044820152606490fd5b611ef5612d8d565b80611f005750611e65565b60405162461bcd60e51b815260206004820152908190611f249060248301906126c2565b0390fd5b9050600481803e5160e01c38611e59565b5038808080808080611d56565b6001600160401b03811161097b5760405238611e49565b604051633127e9d760e11b8152600490fd5b90600385018b5260208b20918b5b601f1985168110611fb2575092611c799594926001926101809583601f1981161061125857505050811b016003840155611054565b91926020600181928685015181550194019201611f7d565b600385018b5260208b20601f840160051c810160208510612008575b8c601f840160051c83018210611ffe57505050611ba0565b8155600101611fe6565b5080611fe6565b634e487b7160e01b8a52604160045260248afd5b015190503880611b5c565b9250600285018b5260208b20908b935b601f1984168510612082576001945083601f19811610612069575b505050811b016002830155611b74565b015160001960f88460031b161c19169055388080612059565b8181015183556020948501946001909301929091019061203e565b909150600285018b5260208b20601f840160051c8101602085106120e7575b90849392915b8d601f840160051c830182106120da57505050611b46565b81558594506001016120c2565b50806120bc565b015190503880611b00565b9250600185018b5260208b20908b935b601f198416851061214d576001945083601f19811610612134575b505050811b016001830155611b18565b015160001960f88460031b161c19169055388080612124565b81810151835560209485019460019093019290910190612109565b909150600185018b5260208b20601f840160051c8101602085106121b2575b90849392915b8d601f840160051c830182106121a557505050611aea565b815585945060010161218d565b5080612187565b015190503880611aa7565b9250848b5260208b20908b935b601f1984168510612212576001945083601f198116106121f9575b505050811b018255611abc565b015160001960f88460031b161c191690553880806121ec565b818101518355602094850194600190930192909101906121d1565b909150848b5260208b20601f840160051c810160208510612274575b90849392915b8d601f840160051c8301821061226757505050611a91565b815585945060010161224f565b5080612249565b90506020813d6020116122a5575b8161229660209383612770565b81010312610ced5751386119c6565b3d9150612289565b6040513d89823e3d90fd5b90506020813d6020116122e2575b816122d360209383612770565b81010312610ced575138611983565b3d91506122c6565b50346101b05760203660031901126101b057612307600435612c54565b604051809160208252805161237561232d6101a0928360208701526101c08601906126c2565b61236061234c602086015192601f1993848983030160408a01526126c2565b6040860151838883030160608901526126c2565b906060850151908683030160808701526126c2565b91608081015160018060a01b0380911660a08601528060a08301511660c086015260c082015160e086015260e0820151610100908187015282015161012090818701528201518161014091168187015282015190610160911681860152810151906101809115158286015201511515908301520390f35b50346101b05760203660031901126101b05760406020916004358152600283522054604051908152f35b50346101b05760209060206003193601126101b0576124336126e7565b6004546001600160a01b039390929091841681805b8581106124ca575061245990612c0e565b9482805b86811061247257604051806115928a826126fd565b61247b81612b65565b9054600391821b1c8352600187528484600460408620015416146124a3575b5060010161245d565b81956124c3916124b4600194612b65565b9054911b1c6115e3828c612c40565b949061249a565b826124d482612b65565b9054600391821b1c86526001808852610e3c61254d6040892093610e3c6125226040519561250187612739565b60405161251281610e3c818c612927565b8752604051928380928a01612927565b8b85015260405161253a81610e3c8160028a01612927565b6040850152604051928380928701612927565b60608201526101808a60048401541692836080840152600a8c6005830154169160a09283860152600681015460c0860152600781015460e086015260088101546101008601528d600982015416610120860152015480918d821661014086015260ff9283911c16151561016085015260a81c161515910152146125d3575b600101612448565b906125df600191612be9565b9190506125cb565b50346101b05760203660031901126101b0576126046004356129bd565b604051809160208252805161262a61232d6101a0928360208701526101c08601906126c2565b91608081015160018060a01b0380911660a08601528060a08301511660c086015260c082015160e086015260e082015161010090818701528201516101209081870152820151610140908187015282015190610160911681860152810151906101809115158286015201511515908301520390f35b60005b8381106126b25750506000910152565b81810151838201526020016126a2565b906020916126db8151809281855285808601910161269f565b601f01601f1916010190565b600435906001600160a01b0382168203610c6957565b602090602060408183019282815285518094520193019160005b828110612725575050505090565b835185529381019392810192600101612717565b6101a081019081106001600160401b03821117610bf157604052565b602081019081106001600160401b03821117610bf157604052565b90601f801991011681019081106001600160401b03821117610bf157604052565b6001600160401b038111610bf157601f01601f191660200190565b81601f82011215610c69578035906127c382612791565b926127d16040519485612770565b82845260208383010111610c6957816000926020809301838601378301015290565b6001600160401b038111610bf15760051b60200190565b81601f82011215610c6957803591602091612824846127f3565b936128326040519586612770565b808552838086019160051b83010192808411610c6957848301915b84831061285d5750505050505090565b82356001600160401b038111610c6957869161287e848480948901016127ac565b81520192019161284d565b6040519061289682612739565b816060815260606020820152606060408201526060808201526101806000918260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201520152565b90600182811c9216801561291d575b602083101461290757565b634e487b7160e01b600052602260045260246000fd5b91607f16916128fc565b805460009392612936826128ed565b9182825260209360019160018116908160001461299e575060011461295d575b5050505050565b90939495506000929192528360002092846000945b83861061298a57505050500101903880808080612956565b805485870183015294019385908201612972565b60ff19168685015250505090151560051b010191503880808080612956565b6129c5612889565b506000818152602081905260409020600401546001600160a01b031615612ace576000526000602052604060ff81600020825192612a0284612739565b8051612a1281610e3c8186612927565b84528051612a2781610e3c8160018701612927565b60208501528051612a3f81610e3c8160028701612927565b8185015251612a5581610e3c8160038601612927565b6060840152600a60018060a01b03918260048201541660808601528260058201541660a0860152600681015460c0860152600781015460e0860152600881015461010086015260098101546101208601520154908116610140840152818160a01c16151561016084015260a81c16151561018082015290565b506040805190612add82612739565b805190612ae982612755565b60009182815283528051612afc81612755565b82815260208401528051612b0f81612755565b8281528184015251612b2081612755565b81815260608301528060808301528060a08301528060c08301528060e08301528061010083015280610120830152806101408301528061016083015261018082015290565b600454811015612b9c5760046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0190600090565b634e487b7160e01b600052603260045260246000fd5b600354811015612b9c5760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b6000198114612bf85760010190565b634e487b7160e01b600052601160045260246000fd5b90612c18826127f3565b612c256040519182612770565b8281528092612c36601f19916127f3565b0190602036910137565b8051821015612b9c5760209160051b010190565b612c5c612889565b506000818152600160205260409020600401546001600160a01b031615612ace576000526001602052604060ff81600020825192612c9984612739565b8051612ca981610e3c8186612927565b84528051612cbe81610e3c8160018701612927565b60208501528051612cd681610e3c8160028701612927565b8185015251612cec81610e3c8160038601612927565b6060840152600a60018060a01b03918260048201541660808601528260058201541660a0860152600681015460c0860152600781015460e08601526008810154610100860152826009820154166101208601520154908116610140840152818160a01c16151561016084015260a81c16151561018082015290565b600354600160401b811015610bf1576104eb816001612d899301600355612bb2565b9055565b600060443d10612dea57604051600319913d83016004833e81516001600160401b03918282113d602484011117612ded57818401948551938411612df5573d85010160208487010111612ded5750612dea92910160200190612770565b90565b949350505050565b50949350505050565b3d15612e29573d90612e0f82612791565b91612e1d6040519384612770565b82523d6000602084013e565b606090565b90808251908181526020809101926020808460051b8301019501936000915b848310612e5d5750505050505090565b9091929394958480612e7b600193601f198682030187528a516126c2565b9801930193019194939290612e4d565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b03841117610bf157612ee392604052612f30565b565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b03831182841017610bf157612ee3926040525b60018060a01b031690612f5a600080836020829551910182875af1612f53612dfe565b9084612fb2565b908151918215159283612f8a575b505050612f725750565b60249060405190635274afe760e01b82526004820152fd5b819293509060209181010312610d015760200151908115918215036101b05750388080612f68565b90612fd95750805115612fc757805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061300c575b612fea575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612fe256fea2646970667358221220e05f0e2090bd06d5e2afc3ae47a834c2eef5acc9d809d88af103ebff4b8f455564736f6c63430008170033
Deployed ByteCode
0x6080604052600436101561001257600080fd5b6000803560e01c8063255f3154146125e75780632ea3b73c1461241657806339e35271146123ec5780633b9c1f5b146122ea5780636552b7421461184d578063673da15414611705578063719f308914611536578063c5bea8b514610d05578063dcc19d59146102bb578063ec9b5b3a146101b35763f5a1862a1461009657600080fd5b346101b05760203660031901126101b057600435906100cd82600052600160205260018060a01b0360046040600020015416151590565b1561019e5781815260016020526040812091600a8301805460ff8160a81c1661018c5760ff8160a01c1661017a57600785015442106101685760ff60a81b198116600160a81b17909155600484015460089094015460209461013b926001600160a01b039182169116612ee5565b7fa123e15752679aa06522e49c50e26d336ea83e1aa2e8ecdc4a32f437a474d1366040519280a260018152f35b60405163b3f711f760e01b8152600490fd5b6040516317c3335f60e21b8152600490fd5b604051630e4a482d60e11b8152600490fd5b604051630bfa77dd60e41b8152600490fd5b80fd5b50346101b05760203660031901126101b057600435906101eb82600052600060205260018060a01b0360046040600020015416151590565b156102a957818152806020526040812091600a8301805460ff8160a81c166102975760ff8160a01c1661028557600985015442106101685760ff60a81b198116600160a81b179091556004840154600890940154602094610258926001600160a01b039182169116612ee5565b7f3d4cedda486476ed25b0bd452211f1c4b1af03b25ad9d223a96238f84ce640f46040519280a260018152f35b6040516306d3830f60e21b8152600490fd5b6040516328486b6360e11b8152600490fd5b604051632254ea3d60e11b8152600490fd5b506101803660031901126101b0576004356001600160401b038111610d01576102e890369060040161280a565b6024356001600160401b038111610cfd5761030790369060040161280a565b906044356001600160401b038111610cf95761032790369060040161280a565b6064356001600160401b038111610cf5576103469036906004016127ac565b906084356001600160401b038111610cf1576103669036906004016127ac565b60a4356001600160401b038111610ced576103859036906004016127ac565b60c4356001600160401b038111610ce9576103a49036906004016127ac565b9160e435916001600160a01b0383168303610c695761012435956001600160a01b0387168703610c695761016435956001600160a01b0387168703610c69576101443515610cd75742610104351115610cc5576040516370a0823160e01b81523360048201526020816024816001600160a01b038c165afa908115610c76578c91610c93575b506101443511610c8157604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b038c165afa908115610c76578c91610c3f575b506101443511610c2d5761048f6101443530336001600160a01b038b16612e8b565b60075460018101809111610c1957600781905560065418600081815260016020526040902060040154909b906001600160a01b0316610c0757600454600160401b811015610bf1576105026104eb828f93600101600455612b65565b819391549060031b91821b91600019901b19161790565b905560405161051081612739565b84815260208082018590526040808301889052606083018a90523360808401526001600160a01b0389811660a085015260c084018590526101043560e0850152610144356101008501528c81166101208501528b16610140840152610160830184905261018083018490528e84526001909152822081518051919391906001600160401b038211610a555781906105a786546128ed565b601f8111610ba3575b50602090601f8311600114610b3a578492610b2f575b50508160011b916000199060031b1c19161783555b60208201518051906001600160401b038211610a5557819061060060018701546128ed565b601f8111610ade575b50602090601f8311600114610a74578492610a69575b50508160011b916000199060031b1c19161760018401555b60408201518051906001600160401b038211610a5557819061065c60028701546128ed565b601f8111610a04575b50602090601f831160011461099a57849261098f575b50508160011b916000199060031b1c19161760028401555b6060820151908151916001600160401b03831161097b579082916106ba60038701546128ed565b601f8111610928575b50602091601f84116001146108b957926108ae575b50508160011b916000199060031b1c19161760038301555b60808101516004830180546001600160a01b03199081166001600160a01b039384161790915560a083810151600586018054841691851691909117905560c0840151600686015560e08401516007860155610100840151600886015561012084015160098601805490931690841617909155610140830151600a90940180546101608501516001600160a81b03199091169590931694909417911515901b60ff60a01b161782556101800151815460ff60a81b191690151560a81b60ff60a81b16179055604051998a996101c08d8c528060208d01528b016107d191612e2e565b8a810360408c01526107e291612e2e565b89810360608b01526107f391612e2e565b88810360808a0152610804916126c2565b87810360a0890152610815916126c2565b86810360c0880152610826916126c2565b3360e08701526001600160a01b0390911661010086015284810361012086015261084f916126c2565b61014435610140850152610104356101608501526001600160a01b0392831661018085015291166101a08301527f39aa705c04023f1efa19bdc0767577e0092740a3754926bb71c98869b20000239291900390a1604051908152602090f35b0151905038806106d8565b6003870181526020812090945091905b601f198416851061090d576001945083601f198116106108f4575b505050811b0160038301556106f0565b015160001960f88460031b161c191690553880806108e4565b818101518355602094850194600190930192909101906108c9565b9091925060038601835260208320601f850160051c810160208610610974575b9085949392915b601f830160051c820181106109655750506106c3565b6000815586955060010161094f565b5080610948565b634e487b7160e01b82526041600452602482fd5b01519050388061067b565b600287018552602085209250601f198416855b8181106109ec57509084600195949392106109d3575b505050811b016002840155610693565b015160001960f88460031b161c191690553880806109c3565b929360206001819287860151815501950193016109ad565b90915060028601845260208420601f840160051c810160208510610a4e575b90849392915b601f830160051c82018110610a3f575050610665565b60008155859450600101610a29565b5080610a23565b634e487b7160e01b83526041600452602483fd5b01519050388061061f565b600187018552602085209250601f198416855b818110610ac65750908460019594939210610aad575b505050811b016001840155610637565b015160001960f88460031b161c19169055388080610a9d565b92936020600181928786015181550195019301610a87565b90915060018601845260208420601f840160051c810160208510610b28575b90849392915b601f830160051c82018110610b19575050610609565b60008155859450600101610b03565b5080610afd565b0151905038806105c6565b9250858452602084209084935b601f1984168510610b88576001945083601f19811610610b6f575b505050811b0183556105db565b015160001960f88460031b161c19169055388080610b62565b81810151835560209485019460019093019290910190610b47565b90915085845260208420601f840160051c810160208510610bea575b90849392915b601f830160051c82018110610bdb5750506105b0565b60008155859450600101610bc5565b5080610bbf565b634e487b7160e01b600052604160045260246000fd5b604051637870919b60e01b8152600490fd5b634e487b7160e01b8c52601160045260248cfd5b604051631d7eb35960e31b8152600490fd5b90506020813d602011610c6e575b81610c5a60209383612770565b81010312610c6957513861046d565b600080fd5b3d9150610c4d565b6040513d8e823e3d90fd5b604051631e9acf1760e31b8152600490fd5b90506020813d602011610cbd575b81610cae60209383612770565b81010312610c6957513861042a565b3d9150610ca1565b604051633dd8280960e21b8152600490fd5b604051636f8ab38d60e11b8152600490fd5b8780fd5b8680fd5b8580fd5b8480fd5b8380fd5b8280fd5b5080fd5b50346101b05760603660031901126101b05760048035600090815260016020526040902001546001600160a01b03161561019e5760043581526001602052600160ff600a60408420015460a81c1615151461018c5760043581526001602052600160ff600a60408420015460a01c1615151461017a576024356000908152602081905260409020600401546001600160a01b031661152457600435815260016020526040812060018060a01b03600482015416331490811561150d575b5015610c2d5760048035825260016020526040808320600a8101805460ff60a01b198116600160a01b17909155602435600683015592810154600582015460088301549351959493926001600160a01b039182169290911690600390610e8790610e2b89612739565b604051610e4381610e3c8185612927565b0382612770565b8952604051610e5981610e3c8160018601612927565b60208a0152604051610e7281610e3c8160028601612927565b60408a0152610e3c6040518094819301612927565b6060870152608086015260a085015260243560c08501528260e085015261010084015260443561012084015260018060a01b031661014083015280610160830152806101808301526024358152806020526040812082519283516001600160401b0381116112ce57610ef983546128ed565b601f81116114cb575b506020601f8211600114611465578495829394959261145a575b50508160011b916000199060031b1c19161782555b60208101519283516001600160401b03811161097b57610f5460018501546128ed565b601f8111611415575b506020601f82116001146113a9578293949582939261139e575b50508160011b916000199060031b1c19161760018401555b60408201519283516001600160401b038111610a5557610fb260028301546128ed565b601f8111611359575b506020601f82116001146112ed57839495829394926112e2575b50508160011b916000199060031b1c19161760028201555b60608301519283516001600160401b0381116112ce5761101060038401546128ed565b601f8111611289575b506020601f82116001146112135791816101809261110d95946040988892611208575b50508160011b916000199060031b1c19161760038401555b60808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783555b0151815460ff60a81b191690151560a81b60ff60a81b16179055565b611118602435612d67565b600435815260016020522060018060a01b0360048201541660018060a01b03600583015416917fe00962102cab6d15d8733bbc057ea3d34381c044904c4312bfdf966c2d11589a60088201549160018060a01b0360098201541660018060a01b03600a83015416906111d360405193610120855260036111c46111b36111a5610120890160018601612927565b88810360208a015284612927565b878103604089015260028401612927565b91868303606088015201612927565b94608084015260443560a084015260c083015260043560e083015261010082015280602435930390a460206040516024358152f35b01519050388061103c565b6003840185526020852095855b601f198416811061127157508260409761110d96959360019361018096601f19811610611258575b505050811b016003840155611054565b015160001960f88460031b161c19169055388080611248565b82820151885560019097019660209283019201611220565b60038401855260208520601f830160051c8101602084106112c7575b601f830160051c820181106112bb575050611019565b600081556001016112a5565b50806112a5565b634e487b7160e01b84526041600452602484fd5b015190503880610fd5565b6002830184526020842090845b601f1984168110611341575060019394959683601f19811610611328575b505050811b016002820155610fed565b015160001960f88460031b161c19169055388080611318565b9091602060018192858b0151815501930191016112fa565b60028301845260208420601f830160051c810160208410611397575b601f830160051c8201811061138b575050610fbb565b60008155600101611375565b5080611375565b015190503880610f77565b6001850183526020832090835b601f19841681106113fd575060019394959683601f198116106113e4575b505050811b016001840155610f8f565b015160001960f88460031b161c191690553880806113d4565b9091602060018192858b0151815501930191016113b6565b60018501835260208320601f830160051c810160208410611453575b601f830160051c82018110611447575050610f5d565b60008155600101611431565b5080611431565b015190503880610f1c565b8385526020852090855b601f19841681106114b3575060019394959683601f1981161061149a575b505050811b018255610f31565b015160001960f88460031b161c1916905538808061148d565b9091602060018192858b01518155019301910161146f565b83855260208520601f830160051c810160208410611506575b601f830160051c820181106114fa575050610f02565b600081556001016114e4565b50806114e4565b600901546001600160a01b03163314905038610dc2565b60405163748d150960e01b8152600490fd5b50346101b057602080600319360112610d01576115516126e7565b600380549290916001600160a01b039081169085805b8681106115f1575061157890612c0e565b958093815b87811061159657604051806115928b826126fd565b0390f35b61159f81612bb2565b905490881b1c83528282528484600460408620015416146115c3575b60010161157d565b946115e96001916115d388612bb2565b9054908a1b1c6115e3828d612c40565b52612be9565b9590506115bb565b6115fa81612bb2565b905490871b1c8852878552836040892060405161161681612739565b60405161162781610e3c8186612927565b815260405161163d81610e3c8160018701612927565b8882015260405161165581610e3c8160028701612927565b604082015260405161166d81610e3c818d8701612927565b60608201526101808660048401541692836080840152600a886005830154169160a09283860152600681015460c0860152600781015460e0860152600881015461010086015260098101546101208601520154809189821661014086015260ff9283911c16151561016085015260a81c161515910152146116f1575b600101611567565b906116fd600191612be9565b9190506116e9565b50346101b05760403660031901126101b05760043560243561173f82600052600060205260018060a01b0360046040600020015416151590565b156102a9578183526020928084526040812090600682015490604051868101858152878252604082018281106001600160401b03821117610bf157889281611790869482604052835192839161269f565b8101039060025afa1561184157510361182f57600a81019081549160ff8360a01c166102855760ff8360a81c1661029757600782019390935560ff60a01b198216600160a01b1790925560058201546008909201546117fd9290916001600160a01b039182169116612ee5565b7f0f7c50d316885e5d3719752f760bbbbf7d56363501e721eea4d913e255b632e482604051338152a260405160018152f35b60405163e73bcb3560e01b8152600490fd5b604051903d90823e3d90fd5b50346101b0576101603660031901126101b057604435906001600160a01b03821682036101b0576064356001600160401b038111610d01576118939036906004016127ac565b916084356001600160401b038111610cfd576118b39036906004016127ac565b9060a4356001600160401b038111610cf9576118d39036906004016127ac565b60c4356001600160401b038111610cf5576118f29036906004016127ac565b94610104356001600160a01b0381169003610cf55761014435916001600160a01b0383168303610cf157426024351115610cc5576101243515610cd75760048035600090815260208190526040902001546001600160a01b0316611524576040516370a0823160e01b81523360048201526020816024816001600160a01b0388165afa9081156122ad5787916122b8575b506101243511610c8157604051636eb1769f60e11b81523360048201523060248201526020816044816001600160a01b0388165afa9081156122ad57879161227b575b506101243511610c2d576119e86101243530336001600160a01b038716612e8b565b6040516119f481612739565b81815285602082015287604082015282606082015233608082015260018060a01b03851660a082015260043560c08201528660e08201526101243561010082015260243561012082015260018060a01b0384166101408201528661016082015286610180820152600435875286602052604087209080518051906001600160401b03821161200f578190611a8885546128ed565b601f811161222d575b50602090601f83116001146121c4578b926121b9575b50508160011b916000199060031b1c19161782555b60208101518051906001600160401b03821161200f578190611ae160018601546128ed565b601f8111612168575b50602090601f83116001146120f9578b926120ee575b50508160011b916000199060031b1c19161760018301555b60408101518051906001600160401b03821161200f578190611b3d60028601546128ed565b601f811161209d575b50602090601f831160011461202e578b92612023575b50508160011b916000199060031b1c19161760028301555b60608101518051906001600160401b03821161200f57611b9760038501546128ed565b601f8111611fca575b50602090601f8311600114611f6f579180611c79959492610180948d926112085750508160011b916000199060031b1c191617600384015560808101516004840180546001600160a01b03199081166001600160a01b039384161790915560a0838101516005870180549093169084161790915560c0830151600686015560e0830151600786015561010083015160088601556101208301516009860155610140830151600a9590950180546101608501516001600160a81b03199091169690931695909517911515901b60ff60a01b161783556110f1565b611c84600435612d67565b60e4358652600260205260043560408720556040516101208152611cdf611cd1611cc3611cb561012085018a6126c2565b8481036020860152856126c2565b83810360408501528a6126c2565b8281036060840152846126c2565b61012435608083015260243560a08301526001600160a01b0361010435811660c084015260e43560e08401528581166101008401528616913391600435917fe00962102cab6d15d8733bbc057ea3d34381c044904c4312bfdf966c2d11589a9181900390a4610104356001600160a01b0316611d62575b60206040516004358152f35b610104353b15611f5d57610104356001600160a01b03163b15610cf15791611dfc611dc69492611dea889795611dd86040519b8c998a99635e863a5b60e01b8b5260e43560048c015260043560248c015261016060448c01526101648b01906126c2565b8981036003190160648b0152906126c2565b878103600319016084890152906126c2565b8581036003190160a4870152906126c2565b913360c485015260018060a01b031660e48401526101243561010484015260243561012484015260018060a01b031661014483015203818360018060a01b0361010435165af19182611f46575b5090611f39578060033d11611f28575b506308c379a014611eed575b7f7b5bdb2f87e8e20f082bba9be5f7e870728f9bba18540559ccdcdcbb1fc5a087611ea5611e91612dfe565b6040519182916020835260208301906126c2565b0390a160405162461bcd60e51b815260206004820152601860248201527f494d657373656e676572206e6f74696679206661696c656400000000000000006044820152606490fd5b611ef5612d8d565b80611f005750611e65565b60405162461bcd60e51b815260206004820152908190611f249060248301906126c2565b0390fd5b9050600481803e5160e01c38611e59565b5038808080808080611d56565b6001600160401b03811161097b5760405238611e49565b604051633127e9d760e11b8152600490fd5b90600385018b5260208b20918b5b601f1985168110611fb2575092611c799594926001926101809583601f1981161061125857505050811b016003840155611054565b91926020600181928685015181550194019201611f7d565b600385018b5260208b20601f840160051c810160208510612008575b8c601f840160051c83018210611ffe57505050611ba0565b8155600101611fe6565b5080611fe6565b634e487b7160e01b8a52604160045260248afd5b015190503880611b5c565b9250600285018b5260208b20908b935b601f1984168510612082576001945083601f19811610612069575b505050811b016002830155611b74565b015160001960f88460031b161c19169055388080612059565b8181015183556020948501946001909301929091019061203e565b909150600285018b5260208b20601f840160051c8101602085106120e7575b90849392915b8d601f840160051c830182106120da57505050611b46565b81558594506001016120c2565b50806120bc565b015190503880611b00565b9250600185018b5260208b20908b935b601f198416851061214d576001945083601f19811610612134575b505050811b016001830155611b18565b015160001960f88460031b161c19169055388080612124565b81810151835560209485019460019093019290910190612109565b909150600185018b5260208b20601f840160051c8101602085106121b2575b90849392915b8d601f840160051c830182106121a557505050611aea565b815585945060010161218d565b5080612187565b015190503880611aa7565b9250848b5260208b20908b935b601f1984168510612212576001945083601f198116106121f9575b505050811b018255611abc565b015160001960f88460031b161c191690553880806121ec565b818101518355602094850194600190930192909101906121d1565b909150848b5260208b20601f840160051c810160208510612274575b90849392915b8d601f840160051c8301821061226757505050611a91565b815585945060010161224f565b5080612249565b90506020813d6020116122a5575b8161229660209383612770565b81010312610ced5751386119c6565b3d9150612289565b6040513d89823e3d90fd5b90506020813d6020116122e2575b816122d360209383612770565b81010312610ced575138611983565b3d91506122c6565b50346101b05760203660031901126101b057612307600435612c54565b604051809160208252805161237561232d6101a0928360208701526101c08601906126c2565b61236061234c602086015192601f1993848983030160408a01526126c2565b6040860151838883030160608901526126c2565b906060850151908683030160808701526126c2565b91608081015160018060a01b0380911660a08601528060a08301511660c086015260c082015160e086015260e0820151610100908187015282015161012090818701528201518161014091168187015282015190610160911681860152810151906101809115158286015201511515908301520390f35b50346101b05760203660031901126101b05760406020916004358152600283522054604051908152f35b50346101b05760209060206003193601126101b0576124336126e7565b6004546001600160a01b039390929091841681805b8581106124ca575061245990612c0e565b9482805b86811061247257604051806115928a826126fd565b61247b81612b65565b9054600391821b1c8352600187528484600460408620015416146124a3575b5060010161245d565b81956124c3916124b4600194612b65565b9054911b1c6115e3828c612c40565b949061249a565b826124d482612b65565b9054600391821b1c86526001808852610e3c61254d6040892093610e3c6125226040519561250187612739565b60405161251281610e3c818c612927565b8752604051928380928a01612927565b8b85015260405161253a81610e3c8160028a01612927565b6040850152604051928380928701612927565b60608201526101808a60048401541692836080840152600a8c6005830154169160a09283860152600681015460c0860152600781015460e086015260088101546101008601528d600982015416610120860152015480918d821661014086015260ff9283911c16151561016085015260a81c161515910152146125d3575b600101612448565b906125df600191612be9565b9190506125cb565b50346101b05760203660031901126101b0576126046004356129bd565b604051809160208252805161262a61232d6101a0928360208701526101c08601906126c2565b91608081015160018060a01b0380911660a08601528060a08301511660c086015260c082015160e086015260e082015161010090818701528201516101209081870152820151610140908187015282015190610160911681860152810151906101809115158286015201511515908301520390f35b60005b8381106126b25750506000910152565b81810151838201526020016126a2565b906020916126db8151809281855285808601910161269f565b601f01601f1916010190565b600435906001600160a01b0382168203610c6957565b602090602060408183019282815285518094520193019160005b828110612725575050505090565b835185529381019392810192600101612717565b6101a081019081106001600160401b03821117610bf157604052565b602081019081106001600160401b03821117610bf157604052565b90601f801991011681019081106001600160401b03821117610bf157604052565b6001600160401b038111610bf157601f01601f191660200190565b81601f82011215610c69578035906127c382612791565b926127d16040519485612770565b82845260208383010111610c6957816000926020809301838601378301015290565b6001600160401b038111610bf15760051b60200190565b81601f82011215610c6957803591602091612824846127f3565b936128326040519586612770565b808552838086019160051b83010192808411610c6957848301915b84831061285d5750505050505090565b82356001600160401b038111610c6957869161287e848480948901016127ac565b81520192019161284d565b6040519061289682612739565b816060815260606020820152606060408201526060808201526101806000918260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201520152565b90600182811c9216801561291d575b602083101461290757565b634e487b7160e01b600052602260045260246000fd5b91607f16916128fc565b805460009392612936826128ed565b9182825260209360019160018116908160001461299e575060011461295d575b5050505050565b90939495506000929192528360002092846000945b83861061298a57505050500101903880808080612956565b805485870183015294019385908201612972565b60ff19168685015250505090151560051b010191503880808080612956565b6129c5612889565b506000818152602081905260409020600401546001600160a01b031615612ace576000526000602052604060ff81600020825192612a0284612739565b8051612a1281610e3c8186612927565b84528051612a2781610e3c8160018701612927565b60208501528051612a3f81610e3c8160028701612927565b8185015251612a5581610e3c8160038601612927565b6060840152600a60018060a01b03918260048201541660808601528260058201541660a0860152600681015460c0860152600781015460e0860152600881015461010086015260098101546101208601520154908116610140840152818160a01c16151561016084015260a81c16151561018082015290565b506040805190612add82612739565b805190612ae982612755565b60009182815283528051612afc81612755565b82815260208401528051612b0f81612755565b8281528184015251612b2081612755565b81815260608301528060808301528060a08301528060c08301528060e08301528061010083015280610120830152806101408301528061016083015261018082015290565b600454811015612b9c5760046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0190600090565b634e487b7160e01b600052603260045260246000fd5b600354811015612b9c5760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b6000198114612bf85760010190565b634e487b7160e01b600052601160045260246000fd5b90612c18826127f3565b612c256040519182612770565b8281528092612c36601f19916127f3565b0190602036910137565b8051821015612b9c5760209160051b010190565b612c5c612889565b506000818152600160205260409020600401546001600160a01b031615612ace576000526001602052604060ff81600020825192612c9984612739565b8051612ca981610e3c8186612927565b84528051612cbe81610e3c8160018701612927565b60208501528051612cd681610e3c8160028701612927565b8185015251612cec81610e3c8160038601612927565b6060840152600a60018060a01b03918260048201541660808601528260058201541660a0860152600681015460c0860152600781015460e08601526008810154610100860152826009820154166101208601520154908116610140840152818160a01c16151561016084015260a81c16151561018082015290565b600354600160401b811015610bf1576104eb816001612d899301600355612bb2565b9055565b600060443d10612dea57604051600319913d83016004833e81516001600160401b03918282113d602484011117612ded57818401948551938411612df5573d85010160208487010111612ded5750612dea92910160200190612770565b90565b949350505050565b50949350505050565b3d15612e29573d90612e0f82612791565b91612e1d6040519384612770565b82523d6000602084013e565b606090565b90808251908181526020809101926020808460051b8301019501936000915b848310612e5d5750505050505090565b9091929394958480612e7b600193601f198682030187528a516126c2565b9801930193019194939290612e4d565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b03841117610bf157612ee392604052612f30565b565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b03831182841017610bf157612ee3926040525b60018060a01b031690612f5a600080836020829551910182875af1612f53612dfe565b9084612fb2565b908151918215159283612f8a575b505050612f725750565b60249060405190635274afe760e01b82526004820152fd5b819293509060209181010312610d015760200151908115918215036101b05750388080612f68565b90612fd95750805115612fc757805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061300c575b612fea575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612fe256fea2646970667358221220e05f0e2090bd06d5e2afc3ae47a834c2eef5acc9d809d88af103ebff4b8f455564736f6c63430008170033