Overview
ETH Balance
ETH Value
$0.00Multichain Info
Latest 6 from a total of 6 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 10189284 | 54 days ago | IN | 0 ETH | 0.00000138 | ||||
| Get Deployed Int... | 4546516 | 119 days ago | IN | 0 ETH | 0.00000007 | ||||
| Get Deployed Int... | 4545547 | 120 days ago | IN | 0 ETH | 0.00000007 | ||||
| Enroll Remote Ro... | 2922610 | 138 days ago | IN | 0 ETH | 0.00000011 | ||||
| Enroll Remote Ro... | 2917953 | 138 days ago | IN | 0 ETH | 0.00000011 | ||||
| Enroll Remote Ro... | 2916305 | 138 days ago | IN | 0 ETH | 0.00000931 |
Latest 4 internal transactions
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 4546516 | 119 days ago | Contract Creation | 0 ETH | |||
| 4545547 | 120 days ago | Contract Creation | 0 ETH | |||
| 2913321 | 138 days ago | Contract Creation | 0 ETH | |||
| 2913321 | 138 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
/*@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@ HYPERLANE @@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@*/
// ============ Internal Imports ============
import {OwnableMulticall} from "./libs/OwnableMulticall.sol";
import {InterchainAccountMessage, InterchainAccountMessageReveal} from "./libs/InterchainAccountMessage.sol";
import {CallLib} from "./libs/Call.sol";
import {MinimalProxy} from "../libs/MinimalProxy.sol";
import {TypeCasts} from "../libs/TypeCasts.sol";
import {StandardHookMetadata} from "../hooks/libs/StandardHookMetadata.sol";
import {Router} from "../client/Router.sol";
import {IPostDispatchHook} from "../interfaces/hooks/IPostDispatchHook.sol";
import {IInterchainSecurityModule} from "../interfaces/IInterchainSecurityModule.sol";
import {CommitmentReadIsm} from "../isms/ccip-read/CommitmentReadIsm.sol";
import {Mailbox} from "../Mailbox.sol";
import {Message} from "../libs/Message.sol";
import {AbstractRoutingIsm} from "../isms/routing/AbstractRoutingIsm.sol";
import {StandardHookMetadata} from "../hooks/libs/StandardHookMetadata.sol";
// ============ External Imports ============
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/*
* @title A contract that allows accounts on chain A to call contracts via a
* proxy contract on chain B.
*/
contract InterchainAccountRouter is Router, AbstractRoutingIsm {
// ============ Libraries ============
using TypeCasts for address;
using TypeCasts for bytes32;
using InterchainAccountMessage for bytes;
using Message for bytes;
using StandardHookMetadata for bytes;
// ============ Constants ============
address public immutable implementation;
bytes32 public immutable bytecodeHash;
CommitmentReadIsm public immutable CCIP_READ_ISM;
uint public immutable COMMIT_TX_GAS_USAGE;
// ============ Public Storage ============
mapping(uint32 destinationDomain => bytes32 ism) public isms;
// ============ Upgrade Gap ============
uint256[47] private __GAP;
// ============ Events ============
/**
* @notice Emitted when a default ISM is set for a remote domain
* @param domain The remote domain
* @param ism The address of the remote ISM
*/
event RemoteIsmEnrolled(uint32 indexed domain, bytes32 ism);
/**
* @notice Emitted when an interchain call is dispatched to a remote domain
* @param destination The destination domain on which to make the call
* @param owner The local owner of the remote ICA
* @param router The address of the remote router
* @param ism The address of the remote ISM
* @param salt The salt used to derive the interchain account
*/
event RemoteCallDispatched(
uint32 indexed destination,
address indexed owner,
bytes32 router,
bytes32 ism,
bytes32 salt
);
/**
* @notice Emitted when a commit-reveal interchain call is dispatched to a remote domain
* @param commitment The commitment that was dispatched
*/
event CommitRevealDispatched(bytes32 indexed commitment);
/**
* @notice Emitted when an interchain account contract is deployed
* @param account The address of the proxy account that was created
* @param origin The domain of the chain where the message was sent from
* @param router The router on the origin domain
* @param owner The address of the account that sent the message
* @param ism The address of the local ISM
* @param salt The salt used to derive the interchain account
*/
event InterchainAccountCreated(
address indexed account,
uint32 origin,
bytes32 router,
bytes32 owner,
address ism,
bytes32 salt
);
// ============ Constructor ============
constructor(
address _mailbox,
address _hook,
address _owner,
uint _commit_tx_gas_usage,
string[] memory _commitment_urls
) Router(_mailbox) {
setHook(_hook);
_transferOwnership(_owner);
bytes memory bytecode = _implementationBytecode(address(this));
implementation = Create2.deploy(0, bytes32(0), bytecode);
bytecodeHash = _proxyBytecodeHash(implementation);
CCIP_READ_ISM = new CommitmentReadIsm(_owner, _commitment_urls);
COMMIT_TX_GAS_USAGE = _commit_tx_gas_usage;
}
function interchainSecurityModule()
external
view
override
returns (IInterchainSecurityModule)
{
return IInterchainSecurityModule(address(this));
}
/**
* @notice Registers the address of remote InterchainAccountRouter
* and ISM contracts to use as a default when making interchain calls
* @param _destination The remote domain
* @param _router The address of the remote InterchainAccountRouter
* @param _ism The address of the remote ISM
*/
function enrollRemoteRouterAndIsm(
uint32 _destination,
bytes32 _router,
bytes32 _ism
) external onlyOwner {
_enrollRemoteRouterAndIsm(_destination, _router, _ism);
}
/**
* @notice Registers the address of remote InterchainAccountRouters
* and ISM contracts to use as defaults when making interchain calls
* @param _destinations The remote domains
* @param _routers The address of the remote InterchainAccountRouters
* @param _isms The address of the remote ISMs
*/
function enrollRemoteRouterAndIsms(
uint32[] calldata _destinations,
bytes32[] calldata _routers,
bytes32[] calldata _isms
) external onlyOwner {
require(
_destinations.length == _routers.length &&
_destinations.length == _isms.length,
"length mismatch"
);
for (uint256 i = 0; i < _destinations.length; i++) {
_enrollRemoteRouterAndIsm(_destinations[i], _routers[i], _isms[i]);
}
}
// ============ External Functions ============
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Uses the default router and ISM addresses for the destination
* domain, reverting if none have been configured
* @dev Recommend using CallLib.build to format the interchain calls.
* @param _destination The remote domain of the chain to make calls on
* @param _calls The sequence of calls to make
* @return The Hyperlane message ID
*/
function callRemote(
uint32 _destination,
CallLib.Call[] calldata _calls
) public payable returns (bytes32) {
return callRemote(_destination, _calls, bytes(""));
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Uses the default router and ISM addresses for the destination
* domain, reverting if none have been configured
* @dev Recommend using CallLib.build to format the interchain calls.
* @param _destination The remote domain of the chain to make calls on
* @param _calls The sequence of calls to make
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @return The Hyperlane message ID
*/
function callRemote(
uint32 _destination,
CallLib.Call[] calldata _calls,
bytes memory _hookMetadata
) public payable returns (bytes32) {
bytes32 _router = routers(_destination);
bytes32 _ism = isms[_destination];
return
callRemoteWithOverrides(
_destination,
_router,
_ism,
_calls,
_hookMetadata
);
}
/**
* @notice Handles dispatched messages by relaying calls to the interchain account
* @param _origin The origin domain of the interchain account
* @param _sender The sender of the interchain message
* @param _message The InterchainAccountMessage containing the account
* owner, ISM, and sequence of calls to be relayed
* @dev Does not need to be onlyRemoteRouter, as this application is designed
* to receive messages from untrusted remote contracts.
*/
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _message
) external payable override onlyMailbox {
InterchainAccountMessage.MessageType _messageType = _message
.messageType();
if (_messageType == InterchainAccountMessage.MessageType.REVEAL) {
// If the message is a reveal,
// the commitment should have been executed in the `verify` method of the ISM
// that verified this message. The commitment is deleted in `revealAndExecute`.
// Simply return.
return;
}
bytes32 _owner = _message.owner();
bytes32 _salt = _message.salt();
bytes32 _ism = _message.ism();
OwnableMulticall ica = getDeployedInterchainAccount(
_origin,
_owner,
_sender,
_ism.bytes32ToAddress(),
_salt
);
if (_messageType == InterchainAccountMessage.MessageType.CALLS) {
CallLib.Call[] memory calls = _message.calls();
ica.multicall{value: msg.value}(calls);
} else {
// This is definitely a message of type COMMITMENT
ica.setCommitment(_message.commitment());
}
}
function route(
bytes calldata _message
) public view override returns (IInterchainSecurityModule) {
bytes calldata _body = _message.body();
InterchainAccountMessage.MessageType _messageType = _body.messageType();
// If the ISM is not set, we need to check if the message is a reveal
// If it is, we need to set the ISM to the CCIP read ISM
// Otherwise, we need to set the ISM to the default ISM
address _ism;
if (_messageType == InterchainAccountMessage.MessageType.REVEAL) {
_ism = InterchainAccountMessageReveal
.revealIsm(_body)
.bytes32ToAddress();
_ism = _ism == address(0) ? address(CCIP_READ_ISM) : _ism;
} else {
_ism = InterchainAccountMessage.ism(_body).bytes32ToAddress();
_ism = _ism == address(0) ? address(mailbox.defaultIsm()) : _ism;
}
return IInterchainSecurityModule(_ism);
}
/**
* @notice Returns the local address of an interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @param _origin The remote origin domain of the interchain account
* @param _router The remote origin InterchainAccountRouter
* @param _owner The remote owner of the interchain account
* @param _ism The local address of the ISM
* @return The local address of the interchain account
*/
function getLocalInterchainAccount(
uint32 _origin,
address _owner,
address _router,
address _ism
) external view returns (OwnableMulticall) {
return
getLocalInterchainAccount(
_origin,
_owner.addressToBytes32(),
_router.addressToBytes32(),
_ism
);
}
/**
* @notice Returns the remote address of a locally owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @dev This function will only work if the destination domain is
* EVM compatible
* @param _destination The remote destination domain of the interchain account
* @param _owner The local owner of the interchain account
* @return The remote address of the interchain account
*/
function getRemoteInterchainAccount(
uint32 _destination,
address _owner
) external view returns (address) {
return
getRemoteInterchainAccount(
_destination,
_owner,
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Returns the remote address of a locally owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @dev This function will only work if the destination domain is
* EVM compatible
* @param _destination The remote destination domain of the interchain account
* @param _owner The local owner of the interchain account
* @param _userSalt A user provided salt. Allows control over account derivation.
* @return The remote address of the interchain account
*/
function getRemoteInterchainAccount(
uint32 _destination,
address _owner,
bytes32 _userSalt
) public view returns (address) {
address _router = routers(_destination).bytes32ToAddress();
address _ism = isms[_destination].bytes32ToAddress();
return getRemoteInterchainAccount(_owner, _router, _ism, _userSalt);
}
// ============ Public Functions ============
/**
* @notice Returns and deploys (if not already) an interchain account
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote origin InterchainAccountRouter
* @param _ism The local address of the ISM
* @return The address of the interchain account
*/
function getDeployedInterchainAccount(
uint32 _origin,
address _owner,
address _router,
address _ism
) public returns (OwnableMulticall) {
return
getDeployedInterchainAccount(
_origin,
_owner.addressToBytes32(),
_router.addressToBytes32(),
_ism,
InterchainAccountMessage.EMPTY_SALT
);
}
/*
* @notice Returns and deploys (if not already) an interchain account
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote origin InterchainAccountRouter
* @param _ism The local address of the ISM
* @return The address of the interchain account
*/
function getDeployedInterchainAccount(
uint32 _origin,
bytes32 _owner,
bytes32 _router,
address _ism
) public returns (OwnableMulticall) {
return
getDeployedInterchainAccount(
_origin,
_owner,
_router,
_ism,
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Returns and deploys (if not already) an interchain account
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote origin InterchainAccountRouter
* @param _ism The local address of the ISM
* @return The address of the interchain account
*/
function getDeployedInterchainAccount(
uint32 _origin,
bytes32 _owner,
bytes32 _router,
address _ism,
bytes32 _userSalt
) public returns (OwnableMulticall) {
bytes32 _deploySalt = _getSalt(
_origin,
_owner,
_router,
_ism.addressToBytes32(),
_userSalt
);
address payable _account = _getLocalInterchainAccount(_deploySalt);
if (!Address.isContract(_account)) {
bytes memory _bytecode = MinimalProxy.bytecode(implementation);
_account = payable(Create2.deploy(0, _deploySalt, _bytecode));
emit InterchainAccountCreated(
_account,
_origin,
_router,
_owner,
_ism,
_userSalt
);
}
return OwnableMulticall(_account);
}
/**
* @notice Returns the local address of a remotely owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote InterchainAccountRouter
* @param _ism The local address of the ISM
* @return The local address of the interchain account
*/
function getLocalInterchainAccount(
uint32 _origin,
bytes32 _owner,
bytes32 _router,
address _ism
) public view returns (OwnableMulticall) {
return
getLocalInterchainAccount(
_origin,
_owner,
_router,
_ism,
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Returns the local address of a remotely owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote InterchainAccountRouter
* @param _ism The local address of the ISM
* @param _userSalt A user provided salt. Allows control over account derivation.
* @return The local address of the interchain account
*/
function getLocalInterchainAccount(
uint32 _origin,
bytes32 _owner,
bytes32 _router,
address _ism,
bytes32 _userSalt
) public view returns (OwnableMulticall) {
return
OwnableMulticall(
_getLocalInterchainAccount(
_getSalt(
_origin,
_owner,
_router,
_ism.addressToBytes32(),
_userSalt
)
)
);
}
/**
* @notice Returns the remote address of a locally owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @dev This function will only work if the destination domain is
* EVM compatible
* @param _owner The local owner of the interchain account
* @param _router The remote InterchainAccountRouter
* @param _ism The remote address of the ISM
* @return The remote address of the interchain account
*/
function getRemoteInterchainAccount(
address _owner,
address _router,
address _ism
) public view returns (address) {
return
getRemoteInterchainAccount(
_owner,
_router,
_ism,
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Returns the remote address of a locally owned interchain account
* @dev This interchain account is not guaranteed to have been deployed
* @dev This function will only work if the destination domain is
* EVM compatible
* @param _owner The local owner of the interchain account
* @param _router The remote InterchainAccountRouter
* @param _ism The remote address of the ISM
* @param _userSalt Salt provided by the user, allows control over account derivation.
* @return The remote address of the interchain account
*/
function getRemoteInterchainAccount(
address _owner,
address _router,
address _ism,
bytes32 _userSalt
) public view returns (address) {
require(_router != address(0), "no router specified for destination");
// replicate router constructor Create2 derivation
address _implementation = Create2.computeAddress(
bytes32(0),
keccak256(_implementationBytecode(_router)),
_router
);
bytes32 _bytecodeHash = _proxyBytecodeHash(_implementation);
bytes32 _salt = _getSalt(
localDomain,
_owner.addressToBytes32(),
address(this).addressToBytes32(),
_ism.addressToBytes32(),
_userSalt
);
return Create2.computeAddress(_salt, _bytecodeHash, _router);
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Recommend using CallLib.build to format the interchain calls
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _calls The sequence of calls to make
* @return The Hyperlane message ID
*/
function callRemoteWithOverrides(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
CallLib.Call[] calldata _calls
) public payable returns (bytes32) {
return
callRemoteWithOverrides(
_destination,
_router,
_ism,
_calls,
bytes(""),
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Recommend using CallLib.build to format the interchain calls
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _calls The sequence of calls to make
* @return The Hyperlane message ID
*/
function callRemoteWithOverrides(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes32 _userSalt
) public payable returns (bytes32) {
return
callRemoteWithOverrides(
_destination,
_router,
_ism,
_calls,
bytes(""),
_userSalt
);
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Recommend using CallLib.build to format the interchain calls
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _calls The sequence of calls to make
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @return The Hyperlane message ID
*/
function callRemoteWithOverrides(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes memory _hookMetadata
) public payable returns (bytes32) {
return
callRemoteWithOverrides(
_destination,
_router,
_ism,
_calls,
_hookMetadata,
InterchainAccountMessage.EMPTY_SALT
);
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Recommend using CallLib.build to format the interchain calls
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _calls The sequence of calls to make
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @param _userSalt Salt provided by the user, allows control over account derivation.
* @return The Hyperlane message ID
*/
function callRemoteWithOverrides(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes memory _hookMetadata,
bytes32 _userSalt
) public payable returns (bytes32) {
return
callRemoteWithOverrides(
_destination,
_router,
_ism,
_calls,
_hookMetadata,
_userSalt,
hook
);
}
/**
* @notice Dispatches a sequence of remote calls to be made by an owner's
* interchain account on the destination domain
* @dev Recommend using CallLib.build to format the interchain calls
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _calls The sequence of calls to make
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @param _salt Salt which allows control over account derivation.
* @param _hook The hook to use after sending our message to the mailbox
* @return The Hyperlane message ID
*/
function callRemoteWithOverrides(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes memory _hookMetadata,
bytes32 _salt,
IPostDispatchHook _hook
) public payable returns (bytes32) {
emit RemoteCallDispatched(
_destination,
msg.sender,
_router,
_ism,
_salt
);
bytes memory _body = InterchainAccountMessage.encode(
msg.sender,
_ism,
_calls,
_salt
);
return
_dispatchMessageWithHook(
_destination,
_router,
_body,
_hookMetadata,
_hook
);
}
// refunds from the commit dispatch call used to fund reveal dispatch call
receive() external payable {}
/**
* @notice Dispatches a commitment and reveal message to the destination domain.
* Useful for when we want to keep calldata secret (e.g. when executing a swap
* @dev The commitment message is dispatched first, followed by the reveal message.
* To find the calladata, the user must fetch the calldata from the url provided by the OffChainLookupIsm
* specified in the _ccipReadIsm parameter.
* The revealed calladata is executed by the `revealAndExecute` function, which will be called the OffChainLookupIsm in its `verify` function.
* @param _destination The remote domain of the chain to make calls on
* @param _router The remote router address
* @param _ism The remote ISM address
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @param _salt Salt which allows control over account derivation.
* @param _hook The hook to use after sending our message to the mailbox
* @param _commitment The commitment to dispatch
* @return _commitmentMsgId The Hyperlane message ID of the commitment message
* @return _revealMsgId The Hyperlane message ID of the reveal message
*/
function callRemoteCommitReveal(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
bytes32 _ccipReadIsm,
bytes memory _hookMetadata,
IPostDispatchHook _hook,
bytes32 _salt,
bytes32 _commitment
) public payable returns (bytes32 _commitmentMsgId, bytes32 _revealMsgId) {
bytes memory _commitmentMsg = InterchainAccountMessage
.encodeCommitment({
_owner: msg.sender.addressToBytes32(),
_ism: _ism,
_commitment: _commitment,
_userSalt: _salt
});
emit RemoteCallDispatched(
_destination,
msg.sender,
_router,
_ism,
_salt
);
emit CommitRevealDispatched(_commitment);
_commitmentMsgId = _dispatchMessageWithValue(
_destination,
_router,
_commitmentMsg,
StandardHookMetadata.formatMetadata(
0,
COMMIT_TX_GAS_USAGE,
address(this),
bytes("")
),
_hook,
msg.value
);
bytes memory _revealMsg = InterchainAccountMessage.encodeReveal({
_ism: _ccipReadIsm,
_commitment: _commitment
});
_revealMsgId = _dispatchMessageWithValue(
_destination,
_router,
_revealMsg,
_hookMetadata,
_hook,
address(this).balance
);
}
function callRemoteCommitReveal(
uint32 _destination,
bytes32 _router,
bytes32 _ism,
bytes memory _hookMetadata,
IPostDispatchHook _hook,
bytes32 _salt,
bytes32 _commitment
) public payable returns (bytes32 _commitmentMsgId, bytes32 _revealMsgId) {
return
callRemoteCommitReveal(
_destination,
_router,
_ism,
bytes32(0),
_hookMetadata,
_hook,
_salt,
_commitment
);
}
function callRemoteCommitReveal(
uint32 _destination,
bytes32 _commitment,
uint _gasLimit
) public payable returns (bytes32 _commitmentMsgId, bytes32 _revealMsgId) {
bytes32 _router = routers(_destination);
bytes32 _ism = isms[_destination];
bytes memory hookMetadata = StandardHookMetadata.formatMetadata(
0,
_gasLimit,
msg.sender,
bytes("")
);
return
callRemoteCommitReveal(
_destination,
_router,
_ism,
bytes32(0),
hookMetadata,
hook,
InterchainAccountMessage.EMPTY_SALT,
_commitment
);
}
// ============ Internal Functions ============
function _implementationBytecode(
address router
) internal pure returns (bytes memory) {
return
abi.encodePacked(
type(OwnableMulticall).creationCode,
abi.encode(router)
);
}
function _proxyBytecodeHash(
address _implementation
) internal pure returns (bytes32) {
return keccak256(MinimalProxy.bytecode(_implementation));
}
/**
* @dev Required for use of Router, compiler will not include this function in the bytecode
*/
function _handle(uint32, bytes32, bytes calldata) internal pure override {
assert(false);
}
/**
* @notice Overrides Router._enrollRemoteRouter to also enroll a default ISM
* @param _destination The remote domain
* @param _address The address of the remote InterchainAccountRouter
* @dev Sets the default ISM to the zero address
*/
function _enrollRemoteRouter(
uint32 _destination,
bytes32 _address
) internal override {
_enrollRemoteRouterAndIsm(
_destination,
_address,
InterchainAccountMessage.EMPTY_SALT
);
}
// ============ Private Functions ============
/**
* @notice Registers the address of a remote ISM contract to use as default
* @param _destination The remote domain
* @param _ism The address of the remote ISM
*/
function _enrollRemoteIsm(uint32 _destination, bytes32 _ism) private {
isms[_destination] = _ism;
emit RemoteIsmEnrolled(_destination, _ism);
}
/**
* @notice Registers the address of remote InterchainAccountRouter
* and ISM contracts to use as a default when making interchain calls
* @param _destination The remote domain
* @param _router The address of the remote InterchainAccountRouter
* @param _ism The address of the remote ISM
*/
function _enrollRemoteRouterAndIsm(
uint32 _destination,
bytes32 _router,
bytes32 _ism
) private {
require(
routers(_destination) == InterchainAccountMessage.EMPTY_SALT &&
isms[_destination] == InterchainAccountMessage.EMPTY_SALT,
"router and ISM defaults are immutable once set"
);
Router._enrollRemoteRouter(_destination, _router);
_enrollRemoteIsm(_destination, _ism);
}
/**
* @notice Dispatches an InterchainAccountMessage to the remote router
* @param _destination The remote domain
* @param _router The address of the remote InterchainAccountRouter
* @param _body The InterchainAccountMessage body
*/
function _dispatchMessage(
uint32 _destination,
bytes32 _router,
bytes memory _body
) private returns (bytes32) {
return
_dispatchMessageWithMetadata(
_destination,
_router,
_body,
bytes("")
);
}
/**
* @notice Dispatches an InterchainAccountMessage to the remote router with hook metadata
* @param _destination The remote domain
* @param _router The address of the remote InterchainAccountRouter
* @param _body The InterchainAccountMessage body
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
*/
function _dispatchMessageWithMetadata(
uint32 _destination,
bytes32 _router,
bytes memory _body,
bytes memory _hookMetadata
) private returns (bytes32) {
return
_dispatchMessageWithHook(
_destination,
_router,
_body,
_hookMetadata,
hook
);
}
/**
* @notice Dispatches an InterchainAccountMessage to the remote router with hook metadata
* @param _destination The remote domain
* @param _router The address of the remote InterchainAccountRouter
* @param _body The InterchainAccountMessage body
* @param _hookMetadata The hook metadata to override with for the hook set by the owner
* @param _hook The hook to use after sending our message to the mailbox
*/
function _dispatchMessageWithHook(
uint32 _destination,
bytes32 _router,
bytes memory _body,
bytes memory _hookMetadata,
IPostDispatchHook _hook
) private returns (bytes32) {
return
_dispatchMessageWithValue(
_destination,
_router,
_body,
_hookMetadata,
_hook,
msg.value
);
}
/**
* @notice Dispatches an InterchainAccountMessage to the remote router using a `value` parameter for msg.value
* @param _value The amount to pass as `msg.value` to the mailbox.dispatch()
*/
function _dispatchMessageWithValue(
uint32 _destination,
bytes32 _router,
bytes memory _body,
bytes memory _hookMetadata,
IPostDispatchHook _hook,
uint _value
) private returns (bytes32) {
require(_router != bytes32(0), "no router specified for destination");
return
mailbox.dispatch{value: _value}(
_destination,
_router,
_body,
_hookMetadata,
_hook
);
}
/**
* @notice Returns the salt used to deploy an interchain account
* @param _origin The remote origin domain of the interchain account
* @param _owner The remote owner of the interchain account
* @param _router The remote origin InterchainAccountRouter
* @param _ism The local address of the ISM
* @param _userSalt Salt provided by the user, allows control over account derivation.
* @return The CREATE2 salt used for deploying the interchain account
*/
function _getSalt(
uint32 _origin,
bytes32 _owner,
bytes32 _router,
bytes32 _ism,
bytes32 _userSalt
) private pure returns (bytes32) {
return
keccak256(
abi.encodePacked(_origin, _owner, _router, _ism, _userSalt)
);
}
/**
* @notice Returns the address of the interchain account on the local chain
* @param _salt The CREATE2 salt used for deploying the interchain account
* @return The address of the interchain account
*/
function _getLocalInterchainAccount(
bytes32 _salt
) private view returns (address payable) {
return payable(Create2.computeAddress(_salt, bytecodeHash));
}
/**
* @notice Returns the gas payment required to dispatch a message to the given domain's router.
* @param _destination The domain of the destination router.
* @param _gasLimit The gas limit that the calls will use.
* @return _gasPayment Payment computed by the registered hooks via MailboxClient.
*/
function quoteGasPayment(
uint32 _destination,
uint256 _gasLimit
) public view returns (uint256 _gasPayment) {
return
_Router_quoteDispatch(
_destination,
new bytes(0),
StandardHookMetadata.overrideGasLimit(_gasLimit),
address(hook)
);
}
/**
* @notice Returns the gas payment required to dispatch a message to the given domain's router.
* @param _destination The domain of the destination router.
* @return _gasPayment Payment computed by the registered hooks via MailboxClient.
*/
function quoteGasPayment(
uint32 _destination
) public view returns (uint256 _gasPayment) {
return
_Router_quoteDispatch(
_destination,
bytes(""),
bytes(""),
address(hook)
);
}
/**
* @notice Returns the payment required to commit reveal to the destination router.
* @param _destination The domain of the destination router.
* @param gasLimit The gas limit that the reveal calls will use.
* @return _gasPayment Payment computed by the registered hooks via MailboxClient.
*/
function quoteGasForCommitReveal(
uint32 _destination,
uint256 gasLimit
) external view returns (uint256 _gasPayment) {
return
_Router_quoteDispatch(
_destination,
new bytes(0),
StandardHookMetadata.overrideGasLimit(COMMIT_TX_GAS_USAGE),
address(hook)
) + quoteGasPayment(_destination, gasLimit);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ External Imports ============
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
// extends EnumerableMap with uint256 => bytes32 type
// modelled after https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/utils/structs/EnumerableMap.sol
library EnumerableMapExtended {
using EnumerableMap for EnumerableMap.Bytes32ToBytes32Map;
using EnumerableSet for EnumerableSet.Bytes32Set;
struct UintToBytes32Map {
EnumerableMap.Bytes32ToBytes32Map _inner;
}
// ============ Library Functions ============
function keys(
UintToBytes32Map storage map
) internal view returns (uint256[] memory _keys) {
uint256 _length = map._inner.length();
_keys = new uint256[](_length);
for (uint256 i = 0; i < _length; i++) {
_keys[i] = uint256(map._inner._keys.at(i));
}
}
function uint32Keys(
UintToBytes32Map storage map
) internal view returns (uint32[] memory _keys) {
uint256[] memory uint256keys = keys(map);
_keys = new uint32[](uint256keys.length);
for (uint256 i = 0; i < uint256keys.length; i++) {
_keys[i] = uint32(uint256keys[i]);
}
}
function set(
UintToBytes32Map storage map,
uint256 key,
bytes32 value
) internal {
map._inner.set(bytes32(key), value);
}
function get(
UintToBytes32Map storage map,
uint256 key
) internal view returns (bytes32) {
return map._inner.get(bytes32(key));
}
function tryGet(
UintToBytes32Map storage map,
uint256 key
) internal view returns (bool, bytes32) {
return map._inner.tryGet(bytes32(key));
}
function remove(
UintToBytes32Map storage map,
uint256 key
) internal returns (bool) {
return map._inner.remove(bytes32(key));
}
function contains(
UintToBytes32Map storage map,
uint256 key
) internal view returns (bool) {
return map._inner.contains(bytes32(key));
}
function length(
UintToBytes32Map storage map
) internal view returns (uint256) {
return map._inner.length();
}
function at(
UintToBytes32Map storage map,
uint256 index
) internal view returns (uint256, bytes32) {
(bytes32 key, bytes32 value) = map._inner.at(index);
return (uint256(key), value);
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {IMessageRecipient} from "../interfaces/IMessageRecipient.sol";
import {IPostDispatchHook} from "../interfaces/hooks/IPostDispatchHook.sol";
import {MailboxClient} from "./MailboxClient.sol";
import {EnumerableMapExtended} from "../libs/EnumerableMapExtended.sol";
// ============ External Imports ============
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
abstract contract Router is MailboxClient, IMessageRecipient {
using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;
using Strings for uint32;
// ============ Mutable Storage ============
/// @dev Mapping of domain => router. For a given domain we have one router we send/receive messages from.
EnumerableMapExtended.UintToBytes32Map internal _routers;
uint256[48] private __GAP; // gap for upgrade safety
constructor(address _mailbox) MailboxClient(_mailbox) {}
// ============ External functions ============
function domains() external view returns (uint32[] memory) {
return _routers.uint32Keys();
}
/**
* @notice Returns the address of the Router contract for the given domain
* @param _domain The remote domain ID.
* @dev Returns 0 address if no router is enrolled for the given domain
* @return router The address of the Router contract for the given domain
*/
function routers(uint32 _domain) public view virtual returns (bytes32) {
(, bytes32 _router) = _routers.tryGet(_domain);
return _router;
}
/**
* @notice Unregister the domain
* @param _domain The domain of the remote Application Router
*/
function unenrollRemoteRouter(uint32 _domain) external virtual onlyOwner {
_unenrollRemoteRouter(_domain);
}
/**
* @notice Register the address of a Router contract for the same Application on a remote chain
* @param _domain The domain of the remote Application Router
* @param _router The address of the remote Application Router
*/
function enrollRemoteRouter(
uint32 _domain,
bytes32 _router
) external virtual onlyOwner {
_enrollRemoteRouter(_domain, _router);
}
/**
* @notice Batch version of `enrollRemoteRouter`
* @param _domains The domains of the remote Application Routers
* @param _addresses The addresses of the remote Application Routers
*/
function enrollRemoteRouters(
uint32[] calldata _domains,
bytes32[] calldata _addresses
) external virtual onlyOwner {
require(_domains.length == _addresses.length, "!length");
uint256 length = _domains.length;
for (uint256 i = 0; i < length; i += 1) {
_enrollRemoteRouter(_domains[i], _addresses[i]);
}
}
/**
* @notice Batch version of `unenrollRemoteRouter`
* @param _domains The domains of the remote Application Routers
*/
function unenrollRemoteRouters(
uint32[] calldata _domains
) external virtual onlyOwner {
uint256 length = _domains.length;
for (uint256 i = 0; i < length; i += 1) {
_unenrollRemoteRouter(_domains[i]);
}
}
/**
* @notice Handles an incoming message
* @param _origin The origin domain
* @param _sender The sender address
* @param _message The message
*/
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _message
) external payable virtual override onlyMailbox {
bytes32 _router = _mustHaveRemoteRouter(_origin);
require(_router == _sender, "Enrolled router does not match sender");
_handle(_origin, _sender, _message);
}
// ============ Virtual functions ============
function _handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _message
) internal virtual;
// ============ Internal functions ============
/**
* @notice Set the router for a given domain
* @param _domain The domain
* @param _address The new router
*/
function _enrollRemoteRouter(
uint32 _domain,
bytes32 _address
) internal virtual {
_routers.set(_domain, _address);
}
/**
* @notice Remove the router for a given domain
* @param _domain The domain
*/
function _unenrollRemoteRouter(uint32 _domain) internal virtual {
require(_routers.remove(_domain), _domainNotFoundError(_domain));
}
/**
* @notice Return true if the given domain / router is the address of a remote Application Router
* @param _domain The domain of the potential remote Application Router
* @param _address The address of the potential remote Application Router
*/
function _isRemoteRouter(
uint32 _domain,
bytes32 _address
) internal view returns (bool) {
return routers(_domain) == _address;
}
/**
* @notice Assert that the given domain has an Application Router registered and return its address
* @param _domain The domain of the chain for which to get the Application Router
* @return _router The address of the remote Application Router on _domain
*/
function _mustHaveRemoteRouter(
uint32 _domain
) internal view returns (bytes32) {
(bool contained, bytes32 _router) = _routers.tryGet(_domain);
if (contained) {
return _router;
}
revert(_domainNotFoundError(_domain));
}
function _domainNotFoundError(
uint32 _domain
) internal pure returns (string memory) {
return
string.concat(
"No router enrolled for domain: ",
_domain.toString()
);
}
function _Router_dispatch(
uint32 _destinationDomain,
uint256 _value,
bytes memory _messageBody,
bytes memory _hookMetadata,
address _hook
) internal returns (bytes32) {
bytes32 _router = _mustHaveRemoteRouter(_destinationDomain);
return
mailbox.dispatch{value: _value}(
_destinationDomain,
_router,
_messageBody,
_hookMetadata,
IPostDispatchHook(_hook)
);
}
/**
* DEPRECATED: Use `_Router_dispatch` instead
* @dev For backward compatibility with v2 client contracts
*/
function _dispatch(
uint32 _destinationDomain,
bytes memory _messageBody
) internal returns (bytes32) {
return
_Router_dispatch(
_destinationDomain,
msg.value,
_messageBody,
"",
address(hook)
);
}
function _Router_quoteDispatch(
uint32 _destinationDomain,
bytes memory _messageBody,
bytes memory _hookMetadata,
address _hook
) internal view returns (uint256) {
bytes32 _router = _mustHaveRemoteRouter(_destinationDomain);
return
mailbox.quoteDispatch(
_destinationDomain,
_router,
_messageBody,
_hookMetadata,
IPostDispatchHook(_hook)
);
}
/**
* DEPRECATED: Use `_Router_quoteDispatch` instead
* @dev For backward compatibility with v2 client contracts
*/
function _quoteDispatch(
uint32 _destinationDomain,
bytes memory _messageBody
) internal view returns (uint256) {
return
_Router_quoteDispatch(
_destinationDomain,
_messageBody,
"",
address(hook)
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
/**
* @title PackageVersioned
* @notice Package version getter for contracts
**/
abstract contract PackageVersioned {
// GENERATED CODE - DO NOT EDIT
string public constant PACKAGE_VERSION = "7.1.10";
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
library TypeCasts {
// alignment preserving cast
function addressToBytes32(address _addr) internal pure returns (bytes32) {
return bytes32(uint256(uint160(_addr)));
}
// alignment preserving cast
function bytes32ToAddress(bytes32 _buf) internal pure returns (address) {
require(
uint256(_buf) <= uint256(type(uint160).max),
"TypeCasts: bytes32ToAddress overflow"
);
return address(uint160(uint256(_buf)));
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
/*@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@ HYPERLANE @@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@*/
/**
* Format of metadata:
*
* [0:2] variant
* [2:34] msg.value
* [34:66] Gas limit for message (IGP)
* [66:86] Refund address for message (IGP)
* [86:] Custom metadata
*/
library StandardHookMetadata {
struct Metadata {
uint16 variant;
uint256 msgValue;
uint256 gasLimit;
address refundAddress;
}
uint8 private constant VARIANT_OFFSET = 0;
uint8 private constant MSG_VALUE_OFFSET = 2;
uint8 private constant GAS_LIMIT_OFFSET = 34;
uint8 private constant REFUND_ADDRESS_OFFSET = 66;
uint256 private constant MIN_METADATA_LENGTH = 86;
uint16 public constant VARIANT = 1;
/**
* @notice Returns the variant of the metadata.
* @param _metadata ABI encoded standard hook metadata.
* @return variant of the metadata as uint8.
*/
function variant(bytes calldata _metadata) internal pure returns (uint16) {
if (_metadata.length < VARIANT_OFFSET + 2) return 0;
return uint16(bytes2(_metadata[VARIANT_OFFSET:VARIANT_OFFSET + 2]));
}
/**
* @notice Returns the specified value for the message.
* @param _metadata ABI encoded standard hook metadata.
* @param _default Default fallback value.
* @return Value for the message as uint256.
*/
function msgValue(
bytes calldata _metadata,
uint256 _default
) internal pure returns (uint256) {
if (_metadata.length < MSG_VALUE_OFFSET + 32) return _default;
return
uint256(bytes32(_metadata[MSG_VALUE_OFFSET:MSG_VALUE_OFFSET + 32]));
}
/**
* @notice Returns the specified gas limit for the message.
* @param _metadata ABI encoded standard hook metadata.
* @param _default Default fallback gas limit.
* @return Gas limit for the message as uint256.
*/
function gasLimit(
bytes calldata _metadata,
uint256 _default
) internal pure returns (uint256) {
if (_metadata.length < GAS_LIMIT_OFFSET + 32) return _default;
return
uint256(bytes32(_metadata[GAS_LIMIT_OFFSET:GAS_LIMIT_OFFSET + 32]));
}
function gasLimit(
bytes memory _metadata
) internal pure returns (uint256 _gasLimit) {
if (_metadata.length < GAS_LIMIT_OFFSET + 32) return 50_000;
assembly {
_gasLimit := mload(add(_metadata, add(0x20, GAS_LIMIT_OFFSET)))
}
}
/**
* @notice Returns the specified refund address for the message.
* @param _metadata ABI encoded standard hook metadata.
* @param _default Default fallback refund address.
* @return Refund address for the message as address.
*/
function refundAddress(
bytes calldata _metadata,
address _default
) internal pure returns (address) {
if (_metadata.length < REFUND_ADDRESS_OFFSET + 20) return _default;
return
address(
bytes20(
_metadata[REFUND_ADDRESS_OFFSET:REFUND_ADDRESS_OFFSET + 20]
)
);
}
/**
* @notice Returns any custom metadata.
* @param _metadata ABI encoded standard hook metadata.
* @return Custom metadata.
*/
function getCustomMetadata(
bytes calldata _metadata
) internal pure returns (bytes calldata) {
if (_metadata.length < MIN_METADATA_LENGTH) return _metadata[0:0];
return _metadata[MIN_METADATA_LENGTH:];
}
/**
* @notice Formats the specified gas limit and refund address into standard hook metadata.
* @param _msgValue msg.value for the message.
* @param _gasLimit Gas limit for the message.
* @param _refundAddress Refund address for the message.
* @return ABI encoded standard hook metadata.
*/
function format(
uint256 _msgValue,
uint256 _gasLimit,
address _refundAddress
) internal pure returns (bytes memory) {
return abi.encodePacked(VARIANT, _msgValue, _gasLimit, _refundAddress);
}
/**
/**
* @notice Formats the specified gas limit and refund address into standard hook metadata.
* @param _msgValue msg.value for the message.
* @param _gasLimit Gas limit for the message.
* @param _refundAddress Refund address for the message.
* @param _customMetadata Additional metadata to include in the standard hook metadata.
* @return ABI encoded standard hook metadata.
*/
function formatMetadata(
uint256 _msgValue,
uint256 _gasLimit,
address _refundAddress,
bytes memory _customMetadata
) internal pure returns (bytes memory) {
return
abi.encodePacked(
VARIANT,
_msgValue,
_gasLimit,
_refundAddress,
_customMetadata
);
}
/**
* @notice Formats the specified gas limit and refund address into standard hook metadata.
* @param _msgValue msg.value for the message.
* @return ABI encoded standard hook metadata.
*/
function overrideMsgValue(
uint256 _msgValue
) internal view returns (bytes memory) {
return formatMetadata(_msgValue, uint256(0), msg.sender, "");
}
/**
* @notice Formats the specified gas limit and refund address into standard hook metadata.
* @param _gasLimit Gas limit for the message.
* @return ABI encoded standard hook metadata.
*/
function overrideGasLimit(
uint256 _gasLimit
) internal view returns (bytes memory) {
return formatMetadata(uint256(0), _gasLimit, msg.sender, "");
}
/**
* @notice Formats the specified refund address into standard hook metadata.
* @param _refundAddress Refund address for the message.
* @return ABI encoded standard hook metadata.
*/
function overrideRefundAddress(
address _refundAddress
) internal pure returns (bytes memory) {
return formatMetadata(uint256(0), uint256(0), _refundAddress, "");
}
function getRefundAddress(
bytes memory _metadata,
address _default
) internal pure returns (address) {
if (_metadata.length < REFUND_ADDRESS_OFFSET + 20) return _default;
address result;
assembly {
let data_start_ptr := add(_metadata, 32) // Skip length prefix of _metadata
let mload_ptr := add(data_start_ptr, sub(REFUND_ADDRESS_OFFSET, 12))
result := mload(mload_ptr) // Loads 32 bytes; address takes lower 20 bytes.
}
return result;
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {TypeCasts} from "./TypeCasts.sol";
/**
* @title Hyperlane Message Library
* @notice Library for formatted messages used by Mailbox
**/
library Message {
using TypeCasts for bytes32;
uint256 private constant VERSION_OFFSET = 0;
uint256 private constant NONCE_OFFSET = 1;
uint256 private constant ORIGIN_OFFSET = 5;
uint256 private constant SENDER_OFFSET = 9;
uint256 private constant DESTINATION_OFFSET = 41;
uint256 private constant RECIPIENT_OFFSET = 45;
uint256 private constant BODY_OFFSET = 77;
/**
* @notice Returns formatted (packed) Hyperlane message with provided fields
* @dev This function should only be used in memory message construction.
* @param _version The version of the origin and destination Mailboxes
* @param _nonce A nonce to uniquely identify the message on its origin chain
* @param _originDomain Domain of origin chain
* @param _sender Address of sender as bytes32
* @param _destinationDomain Domain of destination chain
* @param _recipient Address of recipient on destination chain as bytes32
* @param _messageBody Raw bytes of message body
* @return Formatted message
*/
function formatMessage(
uint8 _version,
uint32 _nonce,
uint32 _originDomain,
bytes32 _sender,
uint32 _destinationDomain,
bytes32 _recipient,
bytes calldata _messageBody
) internal pure returns (bytes memory) {
return
abi.encodePacked(
_version,
_nonce,
_originDomain,
_sender,
_destinationDomain,
_recipient,
_messageBody
);
}
/**
* @notice Returns the message ID.
* @param _message ABI encoded Hyperlane message.
* @return ID of `_message`
*/
function id(bytes memory _message) internal pure returns (bytes32) {
return keccak256(_message);
}
/**
* @notice Returns the message version.
* @param _message ABI encoded Hyperlane message.
* @return Version of `_message`
*/
function version(bytes calldata _message) internal pure returns (uint8) {
return uint8(bytes1(_message[VERSION_OFFSET:NONCE_OFFSET]));
}
/**
* @notice Returns the message nonce.
* @param _message ABI encoded Hyperlane message.
* @return Nonce of `_message`
*/
function nonce(bytes calldata _message) internal pure returns (uint32) {
return uint32(bytes4(_message[NONCE_OFFSET:ORIGIN_OFFSET]));
}
/**
* @notice Returns the message origin domain.
* @param _message ABI encoded Hyperlane message.
* @return Origin domain of `_message`
*/
function origin(bytes calldata _message) internal pure returns (uint32) {
return uint32(bytes4(_message[ORIGIN_OFFSET:SENDER_OFFSET]));
}
/**
* @notice Returns the message sender as bytes32.
* @param _message ABI encoded Hyperlane message.
* @return Sender of `_message` as bytes32
*/
function sender(bytes calldata _message) internal pure returns (bytes32) {
return bytes32(_message[SENDER_OFFSET:DESTINATION_OFFSET]);
}
/**
* @notice Returns the message sender as address.
* @param _message ABI encoded Hyperlane message.
* @return Sender of `_message` as address
*/
function senderAddress(
bytes calldata _message
) internal pure returns (address) {
return sender(_message).bytes32ToAddress();
}
/**
* @notice Returns the message destination domain.
* @param _message ABI encoded Hyperlane message.
* @return Destination domain of `_message`
*/
function destination(
bytes calldata _message
) internal pure returns (uint32) {
return uint32(bytes4(_message[DESTINATION_OFFSET:RECIPIENT_OFFSET]));
}
/**
* @notice Returns the message recipient as bytes32.
* @param _message ABI encoded Hyperlane message.
* @return Recipient of `_message` as bytes32
*/
function recipient(
bytes calldata _message
) internal pure returns (bytes32) {
return bytes32(_message[RECIPIENT_OFFSET:BODY_OFFSET]);
}
/**
* @notice Returns the message recipient as address.
* @param _message ABI encoded Hyperlane message.
* @return Recipient of `_message` as address
*/
function recipientAddress(
bytes calldata _message
) internal pure returns (address) {
return recipient(_message).bytes32ToAddress();
}
/**
* @notice Returns the message body.
* @param _message ABI encoded Hyperlane message.
* @return Body of `_message`
*/
function body(
bytes calldata _message
) internal pure returns (bytes calldata) {
return bytes(_message[BODY_OFFSET:]);
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
/*@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@ HYPERLANE @@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@*/
interface IPostDispatchHook {
enum Types {
UNUSED,
ROUTING,
AGGREGATION,
MERKLE_TREE,
INTERCHAIN_GAS_PAYMASTER,
FALLBACK_ROUTING,
ID_AUTH_ISM,
PAUSABLE,
PROTOCOL_FEE,
LAYER_ZERO_V1,
RATE_LIMITED,
ARB_L2_TO_L1,
OP_L2_TO_L1,
MAILBOX_DEFAULT_HOOK,
AMOUNT_ROUTING,
CCTP
}
/**
* @notice Returns an enum that represents the type of hook
*/
function hookType() external view returns (uint8);
/**
* @notice Returns whether the hook supports metadata
* @param metadata metadata
* @return Whether the hook supports metadata
*/
function supportsMetadata(
bytes calldata metadata
) external view returns (bool);
/**
* @notice Post action after a message is dispatched via the Mailbox
* @param metadata The metadata required for the hook
* @param message The message passed from the Mailbox.dispatch() call
*/
function postDispatch(
bytes calldata metadata,
bytes calldata message
) external payable;
/**
* @notice Compute the payment required by the postDispatch call
* @param metadata The metadata required for the hook
* @param message The message passed from the Mailbox.dispatch() call
* @return Quoted payment for the postDispatch call
*/
function quoteDispatch(
bytes calldata metadata,
bytes calldata message
) external view returns (uint256);
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
// ============ Internal Imports ============
import {Mailbox} from "../../Mailbox.sol";
import {AbstractCcipReadIsm} from "./AbstractCcipReadIsm.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {InterchainAccountMessageReveal} from "../../middleware/libs/InterchainAccountMessage.sol";
import {InterchainAccountRouter} from "../../middleware/InterchainAccountRouter.sol";
import {CallLib} from "../../middleware/libs/Call.sol";
import {Message} from "../../libs/Message.sol";
import {TypeCasts} from "../../libs/TypeCasts.sol";
import {OwnableMulticall} from "../../middleware/libs/OwnableMulticall.sol";
import {MailboxClient} from "../../client/MailboxClient.sol";
interface CommitmentReadIsmService {
function getCallsFromRevealMessage(
bytes memory _message
)
external
view
returns (address ica, bytes32 salt, CallLib.Call[] memory _calls);
}
contract CommitmentReadIsm is AbstractCcipReadIsm {
using InterchainAccountMessageReveal for bytes;
using Message for bytes;
using TypeCasts for bytes32;
constructor(address _owner, string[] memory _urls) {
_transferOwnership(msg.sender);
setUrls(_urls);
_transferOwnership(_owner);
}
function _offchainLookupCalldata(
bytes calldata _message
) internal pure override returns (bytes memory) {
return
abi.encodeCall(
CommitmentReadIsmService.getCallsFromRevealMessage,
(_message)
);
}
/**
* @notice Verifies the commitment by comparing the calldata hash to the commitment
* @param _metadata The encoded (ica, salt, calls)
* @param _message The reveal Hyperlane message
* @return true If the hash of the metadata matches the commitment.
*/
function verify(
bytes calldata _metadata,
bytes calldata _message
) external returns (bool) {
// This is hash(salt, calls). The ica address is excluded
bytes32 revealedHash = keccak256(_metadata[20:]);
bytes32 msgCommitment = _message.body().revealCommitment();
require(
revealedHash == msgCommitment,
"Commitment ISM: Revealed Hash Invalid"
);
// Fetch encoded ica, salt, and calls
address _ica = address(bytes20(_metadata[:20]));
OwnableMulticall ica = OwnableMulticall(payable(_ica));
bytes32 salt = bytes32(_metadata[20:52]);
CallLib.Call[] memory calls = abi.decode(
_metadata[52:],
(CallLib.Call[])
);
// The ica will check if the commitment is pending execution, reverting if not.
ica.revealAndExecute(calls, salt);
return true;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {IInterchainSecurityModule} from "./IInterchainSecurityModule.sol";
import {IPostDispatchHook} from "./hooks/IPostDispatchHook.sol";
interface IMailbox {
// ============ Events ============
/**
* @notice Emitted when a new message is dispatched via Hyperlane
* @param sender The address that dispatched the message
* @param destination The destination domain of the message
* @param recipient The message recipient address on `destination`
* @param message Raw bytes of message
*/
event Dispatch(
address indexed sender,
uint32 indexed destination,
bytes32 indexed recipient,
bytes message
);
/**
* @notice Emitted when a new message is dispatched via Hyperlane
* @param messageId The unique message identifier
*/
event DispatchId(bytes32 indexed messageId);
/**
* @notice Emitted when a Hyperlane message is processed
* @param messageId The unique message identifier
*/
event ProcessId(bytes32 indexed messageId);
/**
* @notice Emitted when a Hyperlane message is delivered
* @param origin The origin domain of the message
* @param sender The message sender address on `origin`
* @param recipient The address that handled the message
*/
event Process(
uint32 indexed origin,
bytes32 indexed sender,
address indexed recipient
);
function localDomain() external view returns (uint32);
function delivered(bytes32 messageId) external view returns (bool);
function defaultIsm() external view returns (IInterchainSecurityModule);
function defaultHook() external view returns (IPostDispatchHook);
function requiredHook() external view returns (IPostDispatchHook);
function latestDispatchedId() external view returns (bytes32);
function dispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody
) external payable returns (bytes32 messageId);
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody
) external view returns (uint256 fee);
function dispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata body,
bytes calldata defaultHookMetadata
) external payable returns (bytes32 messageId);
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata defaultHookMetadata
) external view returns (uint256 fee);
function dispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata body,
bytes calldata customHookMetadata,
IPostDispatchHook customHook
) external payable returns (bytes32 messageId);
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata customHookMetadata,
IPostDispatchHook customHook
) external view returns (uint256 fee);
function process(
bytes calldata metadata,
bytes calldata message
) external payable;
function recipientIsm(
address recipient
) external view returns (IInterchainSecurityModule module);
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
// ============ Internal Imports ============
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
import {ICcipReadIsm} from "../../interfaces/isms/ICcipReadIsm.sol";
import {PackageVersioned} from "../../PackageVersioned.sol";
// ============ External Imports ============
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
/**
* @title AbstractCcipReadIsm
* @notice An ISM that allows arbitrary payloads to be submitted and verified on chain
* @dev https://eips.ethereum.org/EIPS/eip-3668
* @dev The AbstractCcipReadIsm provided by Hyperlane is left intentionally minimalist as
* the range of applications that could be supported by a CcipReadIsm are so broad. However
* there are few things to note when building a custom CcipReadIsm.
*
*/
abstract contract AbstractCcipReadIsm is
ICcipReadIsm,
OwnableUpgradeable,
PackageVersioned
{
// ============ Constants ============
// solhint-disable-next-line const-name-snakecase
uint8 public constant moduleType =
uint8(IInterchainSecurityModule.Types.CCIP_READ);
string[] internal _urls;
/**
* @notice Emitted when new CCIP-read urls are being set
*/
event UrlsChanged(string[] newUrls);
function setUrls(string[] memory __urls) public onlyOwner {
require(__urls.length > 0, "AbstractCcipReadIsm: urls cannot be empty");
_urls = __urls;
emit UrlsChanged(__urls);
}
function getOffchainVerifyInfo(
bytes calldata _message
) external view override {
revert OffchainLookup({
sender: address(this),
urls: _urls,
callData: _offchainLookupCalldata(_message),
callbackFunction: this.verify.selector,
extraData: _message
});
}
function urls() external view returns (string[] memory) {
return _urls;
}
/*
* @dev This should return the calldata to be used for the offchain lookup.
**/
function _offchainLookupCalldata(
bytes calldata _message
) internal view virtual returns (bytes memory);
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
/**
* @title Versioned
* @notice Version getter for contracts
**/
contract Versioned {
uint8 public constant VERSION = 3;
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
// ============ Internal Imports ============
import {Versioned} from "./upgrade/Versioned.sol";
import {Indexed} from "./libs/Indexed.sol";
import {Message} from "./libs/Message.sol";
import {TypeCasts} from "./libs/TypeCasts.sol";
import {IInterchainSecurityModule, ISpecifiesInterchainSecurityModule} from "./interfaces/IInterchainSecurityModule.sol";
import {IPostDispatchHook} from "./interfaces/hooks/IPostDispatchHook.sol";
import {IMessageRecipient} from "./interfaces/IMessageRecipient.sol";
import {IMailbox} from "./interfaces/IMailbox.sol";
import {PackageVersioned} from "./PackageVersioned.sol";
// ============ External Imports ============
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
contract Mailbox is
IMailbox,
Indexed,
Versioned,
OwnableUpgradeable,
PackageVersioned
{
// ============ Libraries ============
using Message for bytes;
using TypeCasts for bytes32;
using TypeCasts for address;
// ============ Constants ============
// Domain of chain on which the contract is deployed
uint32 public immutable localDomain;
// ============ Public Storage ============
// A monotonically increasing nonce for outbound unique message IDs.
uint32 public nonce;
// The latest dispatched message ID used for auth in post-dispatch hooks.
bytes32 public latestDispatchedId;
// The default ISM, used if the recipient fails to specify one.
IInterchainSecurityModule public defaultIsm;
// The default post dispatch hook, used for post processing of opting-in dispatches.
IPostDispatchHook public defaultHook;
// The required post dispatch hook, used for post processing of ALL dispatches.
IPostDispatchHook public requiredHook;
// Mapping of message ID to delivery context that processed the message.
struct Delivery {
address processor;
uint48 blockNumber;
}
mapping(bytes32 messageId => Delivery delivery) internal deliveries;
// ============ Events ============
/**
* @notice Emitted when the default ISM is updated
* @param module The new default ISM
*/
event DefaultIsmSet(address indexed module);
/**
* @notice Emitted when the default hook is updated
* @param hook The new default hook
*/
event DefaultHookSet(address indexed hook);
/**
* @notice Emitted when the required hook is updated
* @param hook The new required hook
*/
event RequiredHookSet(address indexed hook);
// ============ Constructor ============
constructor(uint32 _localDomain) {
localDomain = _localDomain;
}
// ============ Initializers ============
function initialize(
address _owner,
address _defaultIsm,
address _defaultHook,
address _requiredHook
) external initializer {
__Ownable_init();
setDefaultIsm(_defaultIsm);
setDefaultHook(_defaultHook);
setRequiredHook(_requiredHook);
transferOwnership(_owner);
}
// ============ External Functions ============
/**
* @notice Dispatches a message to the destination domain & recipient
* using the default hook and empty metadata.
* @param _destinationDomain Domain of destination chain
* @param _recipientAddress Address of recipient on destination chain as bytes32
* @param _messageBody Raw bytes content of message body
* @return The message ID inserted into the Mailbox's merkle tree
*/
function dispatch(
uint32 _destinationDomain,
bytes32 _recipientAddress,
bytes calldata _messageBody
) external payable override returns (bytes32) {
return
dispatch(
_destinationDomain,
_recipientAddress,
_messageBody,
_messageBody[0:0],
defaultHook
);
}
/**
* @notice Dispatches a message to the destination domain & recipient.
* @param destinationDomain Domain of destination chain
* @param recipientAddress Address of recipient on destination chain as bytes32
* @param messageBody Raw bytes content of message body
* @param hookMetadata Metadata used by the post dispatch hook
* @return The message ID inserted into the Mailbox's merkle tree
*/
function dispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata hookMetadata
) external payable override returns (bytes32) {
return
dispatch(
destinationDomain,
recipientAddress,
messageBody,
hookMetadata,
defaultHook
);
}
/**
* @notice Computes quote for dipatching a message to the destination domain & recipient
* using the default hook and empty metadata.
* @param destinationDomain Domain of destination chain
* @param recipientAddress Address of recipient on destination chain as bytes32
* @param messageBody Raw bytes content of message body
* @return fee The payment required to dispatch the message
*/
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody
) external view returns (uint256 fee) {
return
quoteDispatch(
destinationDomain,
recipientAddress,
messageBody,
messageBody[0:0],
defaultHook
);
}
/**
* @notice Computes quote for dispatching a message to the destination domain & recipient.
* @param destinationDomain Domain of destination chain
* @param recipientAddress Address of recipient on destination chain as bytes32
* @param messageBody Raw bytes content of message body
* @param defaultHookMetadata Metadata used by the default post dispatch hook
* @return fee The payment required to dispatch the message
*/
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata defaultHookMetadata
) external view returns (uint256 fee) {
return
quoteDispatch(
destinationDomain,
recipientAddress,
messageBody,
defaultHookMetadata,
defaultHook
);
}
/**
* @notice Attempts to deliver `_message` to its recipient. Verifies
* `_message` via the recipient's ISM using the provided `_metadata`.
* @param _metadata Metadata used by the ISM to verify `_message`.
* @param _message Formatted Hyperlane message (refer to Message.sol).
*/
function process(
bytes calldata _metadata,
bytes calldata _message
) external payable override {
/// CHECKS ///
// Check that the message was intended for this mailbox.
require(_message.version() == VERSION, "Mailbox: bad version");
require(
_message.destination() == localDomain,
"Mailbox: unexpected destination"
);
// Check that the message hasn't already been delivered.
bytes32 _id = _message.id();
require(delivered(_id) == false, "Mailbox: already delivered");
// Get the recipient's ISM.
address recipient = _message.recipientAddress();
IInterchainSecurityModule ism = recipientIsm(recipient);
/// EFFECTS ///
deliveries[_id] = Delivery({
processor: msg.sender,
blockNumber: uint48(block.number)
});
emit Process(_message.origin(), _message.sender(), recipient);
emit ProcessId(_id);
/// INTERACTIONS ///
// Verify the message via the interchain security module.
require(
ism.verify(_metadata, _message),
"Mailbox: ISM verification failed"
);
// Deliver the message to the recipient.
IMessageRecipient(recipient).handle{value: msg.value}(
_message.origin(),
_message.sender(),
_message.body()
);
}
/**
* @notice Returns the account that processed the message.
* @param _id The message ID to check.
* @return The account that processed the message.
*/
function processor(bytes32 _id) external view returns (address) {
return deliveries[_id].processor;
}
/**
* @notice Returns the account that processed the message.
* @param _id The message ID to check.
* @return The number of the block that the message was processed at.
*/
function processedAt(bytes32 _id) external view returns (uint48) {
return deliveries[_id].blockNumber;
}
// ============ Public Functions ============
/**
* @notice Dispatches a message to the destination domain & recipient.
* @param destinationDomain Domain of destination chain
* @param recipientAddress Address of recipient on destination chain as bytes32
* @param messageBody Raw bytes content of message body
* @param metadata Metadata used by the post dispatch hook
* @param hook Custom hook to use instead of the default
* @return The message ID inserted into the Mailbox's merkle tree
*/
function dispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata metadata,
IPostDispatchHook hook
) public payable virtual returns (bytes32) {
if (address(hook) == address(0)) {
hook = defaultHook;
}
/// CHECKS ///
// Format the message into packed bytes.
bytes memory message = _buildMessage(
destinationDomain,
recipientAddress,
messageBody
);
bytes32 id = message.id();
/// EFFECTS ///
latestDispatchedId = id;
nonce += 1;
emit Dispatch(msg.sender, destinationDomain, recipientAddress, message);
emit DispatchId(id);
/// INTERACTIONS ///
uint256 requiredValue = requiredHook.quoteDispatch(metadata, message);
// if underpaying, defer to required hook's reverting behavior
if (msg.value < requiredValue) {
requiredValue = msg.value;
}
requiredHook.postDispatch{value: requiredValue}(metadata, message);
hook.postDispatch{value: msg.value - requiredValue}(metadata, message);
return id;
}
/**
* @notice Computes quote for dispatching a message to the destination domain & recipient.
* @param destinationDomain Domain of destination chain
* @param recipientAddress Address of recipient on destination chain as bytes32
* @param messageBody Raw bytes content of message body
* @param metadata Metadata used by the post dispatch hook
* @param hook Custom hook to use instead of the default
* @return fee The payment required to dispatch the message
*/
function quoteDispatch(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody,
bytes calldata metadata,
IPostDispatchHook hook
) public view returns (uint256 fee) {
if (address(hook) == address(0)) {
hook = defaultHook;
}
bytes memory message = _buildMessage(
destinationDomain,
recipientAddress,
messageBody
);
return
requiredHook.quoteDispatch(metadata, message) +
hook.quoteDispatch(metadata, message);
}
/**
* @notice Returns true if the message has been processed.
* @param _id The message ID to check.
* @return True if the message has been delivered.
*/
function delivered(bytes32 _id) public view override returns (bool) {
return deliveries[_id].blockNumber > 0;
}
/**
* @notice Sets the default ISM for the Mailbox.
* @param _module The new default ISM. Must be a contract.
*/
function setDefaultIsm(address _module) public onlyOwner {
require(
Address.isContract(_module),
"Mailbox: default ISM not contract"
);
defaultIsm = IInterchainSecurityModule(_module);
emit DefaultIsmSet(_module);
}
/**
* @notice Sets the default post dispatch hook for the Mailbox.
* @param _hook The new default post dispatch hook. Must be a contract.
*/
function setDefaultHook(address _hook) public onlyOwner {
require(
Address.isContract(_hook),
"Mailbox: default hook not contract"
);
defaultHook = IPostDispatchHook(_hook);
emit DefaultHookSet(_hook);
}
/**
* @notice Sets the required post dispatch hook for the Mailbox.
* @param _hook The new default post dispatch hook. Must be a contract.
*/
function setRequiredHook(address _hook) public onlyOwner {
require(
Address.isContract(_hook),
"Mailbox: required hook not contract"
);
requiredHook = IPostDispatchHook(_hook);
emit RequiredHookSet(_hook);
}
/**
* @notice Returns the ISM to use for the recipient, defaulting to the
* default ISM if none is specified.
* @param _recipient The message recipient whose ISM should be returned.
* @return The ISM to use for `_recipient`.
*/
function recipientIsm(
address _recipient
) public view returns (IInterchainSecurityModule) {
// use low-level staticcall in case of revert or empty return data
(bool success, bytes memory returnData) = _recipient.staticcall(
abi.encodeCall(
ISpecifiesInterchainSecurityModule.interchainSecurityModule,
()
)
);
// check if call was successful and returned data
if (success && returnData.length != 0) {
// check if returnData is a valid address
address ism = abi.decode(returnData, (address));
// check if the ISM is a contract
if (ism != address(0)) {
return IInterchainSecurityModule(ism);
}
}
// Use the default if a valid one is not specified by the recipient.
return defaultIsm;
}
// ============ Internal Functions ============
function _buildMessage(
uint32 destinationDomain,
bytes32 recipientAddress,
bytes calldata messageBody
) internal view returns (bytes memory) {
return
Message.formatMessage(
VERSION,
nonce,
localDomain,
msg.sender.addressToBytes32(),
destinationDomain,
recipientAddress,
messageBody
);
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {IInterchainSecurityModule} from "../IInterchainSecurityModule.sol";
interface ICcipReadIsm is IInterchainSecurityModule {
/// @dev https://eips.ethereum.org/EIPS/eip-3668
/// @param sender the address of the contract making the call, usually address(this)
/// @param urls the URLs to query for offchain data
/// @param callData context needed for offchain service to service request
/// @param callbackFunction function selector to call with offchain information
/// @param extraData additional passthrough information to call callbackFunction with
error OffchainLookup(
address sender,
string[] urls,
bytes callData,
bytes4 callbackFunction,
bytes extraData
);
/**
* @notice Reverts with the data needed to query information offchain
* and be submitted via the origin mailbox
* @dev See https://eips.ethereum.org/EIPS/eip-3668 for more information
* @param _message data that will help construct the offchain query
*/
function getOffchainVerifyInfo(bytes calldata _message) external view;
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
/*@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@ HYPERLANE @@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@*/
// ============ Internal Imports ============
import {IMailbox} from "../interfaces/IMailbox.sol";
import {IPostDispatchHook} from "../interfaces/hooks/IPostDispatchHook.sol";
import {IInterchainSecurityModule} from "../interfaces/IInterchainSecurityModule.sol";
import {Message} from "../libs/Message.sol";
import {PackageVersioned} from "../PackageVersioned.sol";
// ============ External Imports ============
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
abstract contract MailboxClient is OwnableUpgradeable, PackageVersioned {
using Message for bytes;
event HookSet(address _hook);
event IsmSet(address _ism);
IMailbox public immutable mailbox;
uint32 public immutable localDomain;
IPostDispatchHook public hook;
IInterchainSecurityModule internal _interchainSecurityModule;
uint256[48] private __GAP; // gap for upgrade safety
// ============ Modifiers ============
modifier onlyContract(address _contract) {
require(
Address.isContract(_contract),
"MailboxClient: invalid mailbox"
);
_;
}
modifier onlyContractOrNull(address _contract) {
require(
Address.isContract(_contract) || _contract == address(0),
"MailboxClient: invalid contract setting"
);
_;
}
/**
* @notice Only accept messages from a Hyperlane Mailbox contract
*/
modifier onlyMailbox() {
require(
msg.sender == address(mailbox),
"MailboxClient: sender not mailbox"
);
_;
}
constructor(address _mailbox) onlyContract(_mailbox) {
mailbox = IMailbox(_mailbox);
localDomain = mailbox.localDomain();
_transferOwnership(msg.sender);
}
function interchainSecurityModule()
external
view
virtual
returns (IInterchainSecurityModule)
{
return _interchainSecurityModule;
}
/**
* @notice Sets the address of the application's custom hook.
* @param _hook The address of the hook contract.
*/
function setHook(
address _hook
) public virtual onlyContractOrNull(_hook) onlyOwner {
hook = IPostDispatchHook(_hook);
emit HookSet(_hook);
}
/**
* @notice Sets the address of the application's custom interchain security module.
* @param _module The address of the interchain security module contract.
*/
function setInterchainSecurityModule(
address _module
) public onlyContractOrNull(_module) onlyOwner {
_interchainSecurityModule = IInterchainSecurityModule(_module);
emit IsmSet(_module);
}
// ======== Initializer =========
function _MailboxClient_initialize(
address _hook,
address __interchainSecurityModule,
address _owner
) internal onlyInitializing {
__Ownable_init();
setHook(_hook);
setInterchainSecurityModule(__interchainSecurityModule);
_transferOwnership(_owner);
}
function _isLatestDispatched(bytes32 id) internal view returns (bool) {
return mailbox.latestDispatchedId() == id;
}
function _isDelivered(bytes32 id) internal view returns (bool) {
return mailbox.delivered(id);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {IInterchainSecurityModule} from "../IInterchainSecurityModule.sol";
interface IRoutingIsm is IInterchainSecurityModule {
/**
* @notice Returns the ISM responsible for verifying _message
* @dev Can change based on the content of _message
* @param _message Formatted Hyperlane message (see Message.sol).
* @return module The ISM to use to verify _message
*/
function route(
bytes calldata _message
) external view returns (IInterchainSecurityModule);
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
// ============ Internal Imports ============
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
import {IRoutingIsm} from "../../interfaces/isms/IRoutingIsm.sol";
/**
* @title RoutingIsm
*/
abstract contract AbstractRoutingIsm is IRoutingIsm {
// ============ Constants ============
// solhint-disable-next-line const-name-snakecase
uint8 public constant moduleType =
uint8(IInterchainSecurityModule.Types.ROUTING);
// ============ Virtual Functions ============
// ======= OVERRIDE THESE TO IMPLEMENT =======
/**
* @notice Returns the ISM responsible for verifying _message
* @dev Can change based on the content of _message
* @param _message Formatted Hyperlane message (see Message.sol).
* @return module The ISM to use to verify _message
*/
function route(
bytes calldata _message
) public view virtual returns (IInterchainSecurityModule);
// ============ Public Functions ============
/**
* @notice Routes _metadata and _message to the correct ISM
* @param _metadata ABI encoded module metadata
* @param _message Formatted Hyperlane message (see Message.sol).
*/
function verify(
bytes calldata _metadata,
bytes calldata _message
) public returns (bool) {
return route(_message).verify(_metadata, _message);
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// Library for building bytecode of minimal proxies (see https://eips.ethereum.org/EIPS/eip-1167)
library MinimalProxy {
bytes20 private constant PREFIX =
hex"3d602d80600a3d3981f3363d3d373d3d3d363d73";
bytes15 private constant SUFFIX = hex"5af43d82803e903d91602b57fd5bf3";
function create(address implementation) internal returns (address proxy) {
bytes memory _bytecode = bytecode(implementation);
assembly {
proxy := create(0, add(_bytecode, 32), mload(_bytecode))
}
}
function bytecode(
address implementation
) internal pure returns (bytes memory) {
return abi.encodePacked(PREFIX, bytes20(implementation), SUFFIX);
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {TypeCasts} from "../../libs/TypeCasts.sol";
library CallLib {
struct StaticCall {
// supporting non EVM targets
bytes32 to;
bytes data;
}
struct Call {
// supporting non EVM targets
bytes32 to;
uint256 value;
bytes data;
}
struct StaticCallWithCallback {
StaticCall _call;
bytes callback;
}
function call(
Call memory _call
) internal returns (bytes memory returnData) {
return
Address.functionCallWithValue(
TypeCasts.bytes32ToAddress(_call.to),
_call.data,
_call.value
);
}
function staticcall(
StaticCall memory _call
) private view returns (bytes memory) {
return
Address.functionStaticCall(
TypeCasts.bytes32ToAddress(_call.to),
_call.data
);
}
function staticcall(
StaticCallWithCallback memory _call
) internal view returns (bytes memory callback) {
return bytes.concat(_call.callback, staticcall(_call._call));
}
function multicall(Call[] memory calls) internal {
uint256 i = 0;
uint256 len = calls.length;
while (i < len) {
call(calls[i]);
unchecked {
++i;
}
}
}
function multistaticcall(
StaticCallWithCallback[] memory _calls
) internal view returns (bytes[] memory) {
uint256 i = 0;
uint256 len = _calls.length;
bytes[] memory callbacks = new bytes[](len);
while (i < len) {
callbacks[i] = staticcall(_calls[i]);
unchecked {
++i;
}
}
return callbacks;
}
function multicallto(address to, bytes[] memory calls) internal {
uint256 i = 0;
uint256 len = calls.length;
while (i < len) {
Address.functionCall(to, calls[i]);
unchecked {
++i;
}
}
}
function build(
bytes32 to,
bytes memory data
) internal pure returns (StaticCall memory) {
return StaticCall(to, data);
}
function build(
address to,
bytes memory data
) internal pure returns (StaticCall memory) {
return build(TypeCasts.addressToBytes32(to), data);
}
function build(
bytes32 to,
uint256 value,
bytes memory data
) internal pure returns (Call memory) {
return Call(to, value, data);
}
function build(
address to,
uint256 value,
bytes memory data
) internal pure returns (Call memory) {
return Call(TypeCasts.addressToBytes32(to), value, data);
}
function build(
bytes32 to,
bytes memory data,
bytes memory callback
) internal pure returns (StaticCallWithCallback memory) {
return StaticCallWithCallback(build(to, data), callback);
}
function build(
address to,
bytes memory data,
bytes memory callback
) internal pure returns (StaticCallWithCallback memory) {
return StaticCallWithCallback(build(to, data), callback);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// ? `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// ? `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
// ============ Internal Imports ============
import {CallLib} from "./Call.sol";
/*
* @title OwnableMulticall
* @dev Permits immutable owner address to execute calls with value to other contracts.
*/
contract OwnableMulticall {
/// @dev The owner will be the ICA Router that deployed this contract (via CREATE2).
address public immutable owner;
constructor(address _owner) {
require(_owner != address(0), "OwnableMulticall: invalid owner");
owner = _owner;
}
modifier onlyOwner() {
require(msg.sender == owner, "!owner");
_;
}
function multicall(
CallLib.Call[] calldata calls
) external payable onlyOwner {
return CallLib.multicall(calls);
}
/// @notice A mapping of commitment hashes to status
mapping(bytes32 commitmentHash => bool isPendingExecution)
public commitments;
event CommitmentSet(bytes32 indexed commitmentHash);
event CommitmentExecuted(bytes32 indexed commitmentHash);
/// @notice Sets the commitment value that will be executed next
/// @param _commitment The new commitment value to be set
function setCommitment(bytes32 _commitment) external onlyOwner {
require(
!commitments[_commitment],
"ICA: Previous commitment pending execution"
);
commitments[_commitment] = true;
emit CommitmentSet(_commitment);
}
/// @dev The calls represented by the commitment can only be executed once per commitment,
/// though you can submit the same commitment again after the calls have been executed.
function revealAndExecute(
CallLib.Call[] calldata calls,
bytes32 salt
) external payable returns (bytes32 executedCommitment) {
// Check if metadata matches stored commitment (checks)
bytes32 revealedHash = keccak256(
abi.encodePacked(salt, abi.encode(calls))
);
require(commitments[revealedHash], "ICA: Invalid Reveal");
// Delete the commitment (effects)
executedCommitment = revealedHash;
delete commitments[revealedHash];
emit CommitmentExecuted(executedCommitment);
// Execute the calls (interactions)
CallLib.multicall(calls);
return executedCommitment;
}
// solhint-disable-next-line no-empty-blocks
receive() external payable {}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
contract Indexed {
uint256 public immutable deployedBlock;
constructor() {
deployedBlock = block.number;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)
pragma solidity ^0.8.0;
/**
* @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.
* `CREATE2` can be used to compute in advance the address where a smart
* contract will be deployed, which allows for interesting new mechanisms known
* as 'counterfactual interactions'.
*
* See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
* information.
*/
library Create2 {
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCode`.
*
* Requirements:
*
* - `bytecode` must not be empty.
* - `salt` must have not been used for `bytecode` already.
* - the factory must have a balance of at least `amount`.
* - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
*/
function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {
require(address(this).balance >= amount, "Create2: insufficient balance");
require(bytecode.length != 0, "Create2: bytecode length is zero");
/// @solidity memory-safe-assembly
assembly {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
}
require(addr != address(0), "Create2: Failed on deploy");
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
* `bytecodeHash` or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {
return computeAddress(salt, bytecodeHash, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40) // Get free memory pointer
// | | ? ptr ... ? ptr + 0x0B (start) ... ? ptr + 0x20 ... ? ptr + 0x40 ... |
// |-------------------|---------------------------------------------------------------------------|
// | bytecodeHash | CCCCCCCCCCCCC...CC |
// | salt | BBBBBBBBBBBBB...BB |
// | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |
// | 0xFF | FF |
// |-------------------|---------------------------------------------------------------------------|
// | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |
// | keccak(start, 85) | ?????????????????????????????????????????????????????????????? |
mstore(add(ptr, 0x40), bytecodeHash)
mstore(add(ptr, 0x20), salt)
mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes
let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff
mstore8(start, 0xff)
addr := keccak256(start, 85)
}
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
interface IMessageRecipient {
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _message
) external payable;
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {CallLib} from "./Call.sol";
import {TypeCasts} from "../../libs/TypeCasts.sol";
/**
* Format of CALLS message:
* [ 0: 1] MessageType.CALLS (uint8)
* [ 1: 33] ICA owner (bytes32)
* [ 33: 65] ICA ISM (bytes32)
* [ 65: 97] User Salt (bytes32)
* [ 97:????] Calls (CallLib.Call[]), abi encoded
*
* Format of COMMITMENT message:
* [ 0: 1] MessageType.COMMITMENT (uint8)
* [ 1: 33] ICA owner (bytes32)
* [ 33: 65] ICA ISM (bytes32)
* [ 65: 97] User Salt (bytes32)
* [ 97: 129] Commitment (bytes32)
*/
library InterchainAccountMessage {
using TypeCasts for bytes32;
using TypeCasts for address;
enum MessageType {
CALLS,
COMMITMENT,
REVEAL
}
bytes32 internal constant EMPTY_SALT = bytes32(0);
/**
* @notice Returns formatted (packed) InterchainAccountMessage
* @dev This function should only be used in memory message construction.
* @param _owner The owner of the interchain account
* @param _ism The address of the remote ISM
* @param _calls The sequence of calls to make
* @return Formatted message body
*/
function encode(
address _owner,
bytes32 _ism,
CallLib.Call[] calldata _calls
) internal pure returns (bytes memory) {
return encode(TypeCasts.addressToBytes32(_owner), _ism, _calls);
}
/**
* @notice Returns formatted (packed) InterchainAccountMessage
* @dev This function should only be used in memory message construction.
* @param _owner The owner of the interchain account
* @param _ism The address of the remote ISM
* @param _calls The sequence of calls to make
* @return Formatted message body
*/
function encode(
bytes32 _owner,
bytes32 _ism,
CallLib.Call[] calldata _calls
) internal pure returns (bytes memory) {
return encode(_owner, _ism, _calls, EMPTY_SALT);
}
/**
* @notice Returns formatted (packed) InterchainAccountMessage
* @dev This function should only be used in memory message construction.
* @param _owner The owner of the interchain account
* @param _ism The address of the remote ISM
* @param _calls The sequence of calls to make
* @return Formatted message body
*/
function encode(
address _owner,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes32 _userSalt
) internal pure returns (bytes memory) {
return
encode(TypeCasts.addressToBytes32(_owner), _ism, _calls, _userSalt);
}
/**
* @notice Returns formatted (packed) InterchainAccountMessage
* @dev This function should only be used in memory message construction.
* @param _owner The owner of the interchain account
* @param _ism The address of the remote ISM
* @param _calls The sequence of calls to make
* @return Formatted message body
*/
function encode(
bytes32 _owner,
bytes32 _ism,
CallLib.Call[] calldata _calls,
bytes32 _userSalt
) internal pure returns (bytes memory) {
bytes memory prefix = abi.encodePacked(
MessageType.CALLS,
_owner,
_ism,
_userSalt
);
bytes memory suffix = abi.encode(_calls);
return bytes.concat(prefix, suffix);
}
/**
* @notice Returns formatted (packed) InterchainAccountMessage
* @dev This function should only be used in memory message construction.
* @param _owner The owner of the interchain account
* @param _ism The address of the remote ISM
* @return Formatted message body
*/
function encodeCommitment(
bytes32 _owner,
bytes32 _ism,
bytes32 _commitment,
bytes32 _userSalt
) internal pure returns (bytes memory) {
return
abi.encodePacked(
MessageType.COMMITMENT,
_owner,
_ism,
_userSalt,
_commitment
);
}
function encodeReveal(
bytes32 _ism,
bytes32 _commitment
) internal pure returns (bytes memory) {
return abi.encodePacked(MessageType.REVEAL, _ism, _commitment);
}
function messageType(
bytes calldata _message
) internal pure returns (MessageType) {
return MessageType(uint8(_message[0]));
}
function owner(bytes calldata _message) internal pure returns (bytes32) {
return bytes32(_message[1:33]);
}
/**
* @notice Parses and returns the ISM address from the provided message
* @param _message The interchain account message
* @return The ISM encoded in the message
*/
function ism(bytes calldata _message) internal pure returns (bytes32) {
return bytes32(_message[33:65]);
}
function salt(bytes calldata _message) internal pure returns (bytes32) {
return bytes32(_message[65:97]);
}
function calls(
bytes calldata _message
) internal pure returns (CallLib.Call[] memory) {
return abi.decode(_message[97:], (CallLib.Call[]));
}
function commitment(
bytes calldata _message
) internal pure returns (bytes32) {
return bytes32(_message[97:]);
}
}
/**
* Format of REVEAL message:
* [ 0: 1] MessageType.REVEAL (uint8)
* [ 1: 33] ICA ISM (bytes32)
* [ 33: 65] Commitment (bytes32)
*/
library InterchainAccountMessageReveal {
function revealIsm(
bytes calldata _message
) internal pure returns (bytes32) {
return bytes32(_message[1:33]);
}
function revealCommitment(
bytes calldata _message
) internal pure returns (bytes32) {
return bytes32(_message[33:65]);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableMap.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.
pragma solidity ^0.8.0;
import "./EnumerableSet.sol";
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* The following map types are supported:
*
* - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
* - `address -> uint256` (`AddressToUintMap`) since v4.6.0
* - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
* - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
* - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableMap.
* ====
*/
library EnumerableMap {
using EnumerableSet for EnumerableSet.Bytes32Set;
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct Bytes32ToBytes32Map {
// Storage of keys
EnumerableSet.Bytes32Set _keys;
mapping(bytes32 => bytes32) _values;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) {
map._values[key] = value;
return map._keys.add(key);
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {
delete map._values[key];
return map._keys.remove(key);
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {
return map._keys.contains(key);
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {
return map._keys.length();
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) {
bytes32 key = map._keys.at(index);
return (key, map._values[key]);
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) {
bytes32 value = map._values[key];
if (value == bytes32(0)) {
return (contains(map, key), bytes32(0));
} else {
return (true, value);
}
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {
bytes32 value = map._values[key];
require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key");
return value;
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(
Bytes32ToBytes32Map storage map,
bytes32 key,
string memory errorMessage
) internal view returns (bytes32) {
bytes32 value = map._values[key];
require(value != 0 || contains(map, key), errorMessage);
return value;
}
/**
* @dev Return the an array containing all the keys
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) {
return map._keys.values();
}
// UintToUintMap
struct UintToUintMap {
Bytes32ToBytes32Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) {
return set(map._inner, bytes32(key), bytes32(value));
}
/**
* @dev Removes a value from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {
return remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {
return contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToUintMap storage map) internal view returns (uint256) {
return length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the map. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) {
(bytes32 key, bytes32 value) = at(map._inner, index);
return (uint256(key), uint256(value));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) {
(bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
return (success, uint256(value));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {
return uint256(get(map._inner, bytes32(key)));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(UintToUintMap storage map, uint256 key, string memory errorMessage) internal view returns (uint256) {
return uint256(get(map._inner, bytes32(key), errorMessage));
}
/**
* @dev Return the an array containing all the keys
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function keys(UintToUintMap storage map) internal view returns (uint256[] memory) {
bytes32[] memory store = keys(map._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintToAddressMap
struct UintToAddressMap {
Bytes32ToBytes32Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the map. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = at(map._inner, index);
return (uint256(key), address(uint160(uint256(value))));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
return (success, address(uint160(uint256(value))));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint160(uint256(get(map._inner, bytes32(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(
UintToAddressMap storage map,
uint256 key,
string memory errorMessage
) internal view returns (address) {
return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage))));
}
/**
* @dev Return the an array containing all the keys
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) {
bytes32[] memory store = keys(map._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressToUintMap
struct AddressToUintMap {
Bytes32ToBytes32Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) {
return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
}
/**
* @dev Removes a value from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(AddressToUintMap storage map, address key) internal returns (bool) {
return remove(map._inner, bytes32(uint256(uint160(key))));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(AddressToUintMap storage map, address key) internal view returns (bool) {
return contains(map._inner, bytes32(uint256(uint160(key))));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(AddressToUintMap storage map) internal view returns (uint256) {
return length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the map. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) {
(bytes32 key, bytes32 value) = at(map._inner, index);
return (address(uint160(uint256(key))), uint256(value));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) {
(bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key))));
return (success, uint256(value));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
return uint256(get(map._inner, bytes32(uint256(uint160(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(
AddressToUintMap storage map,
address key,
string memory errorMessage
) internal view returns (uint256) {
return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage));
}
/**
* @dev Return the an array containing all the keys
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function keys(AddressToUintMap storage map) internal view returns (address[] memory) {
bytes32[] memory store = keys(map._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// Bytes32ToUintMap
struct Bytes32ToUintMap {
Bytes32ToBytes32Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) {
return set(map._inner, key, bytes32(value));
}
/**
* @dev Removes a value from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {
return remove(map._inner, key);
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {
return contains(map._inner, key);
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(Bytes32ToUintMap storage map) internal view returns (uint256) {
return length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the map. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) {
(bytes32 key, bytes32 value) = at(map._inner, index);
return (key, uint256(value));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) {
(bool success, bytes32 value) = tryGet(map._inner, key);
return (success, uint256(value));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {
return uint256(get(map._inner, key));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(
Bytes32ToUintMap storage map,
bytes32 key,
string memory errorMessage
) internal view returns (uint256) {
return uint256(get(map._inner, key, errorMessage));
}
/**
* @dev Return the an array containing all the keys
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) {
bytes32[] memory store = keys(map._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
interface IInterchainSecurityModule {
enum Types {
UNUSED,
ROUTING,
AGGREGATION,
LEGACY_MULTISIG,
MERKLE_ROOT_MULTISIG,
MESSAGE_ID_MULTISIG,
NULL, // used with relayer carrying no metadata
CCIP_READ,
ARB_L2_TO_L1,
WEIGHTED_MERKLE_ROOT_MULTISIG,
WEIGHTED_MESSAGE_ID_MULTISIG,
OP_L2_TO_L1
}
/**
* @notice Returns an enum that represents the type of security model
* encoded by this ISM.
* @dev Relayers infer how to fetch and format metadata.
*/
function moduleType() external view returns (uint8);
/**
* @notice Defines a security model responsible for verifying interchain
* messages based on the provided metadata.
* @param _metadata Off-chain metadata provided by a relayer, specific to
* the security model encoded by the module (e.g. validator signatures)
* @param _message Hyperlane encoded interchain message
* @return True if the message was verified
*/
function verify(
bytes calldata _metadata,
bytes calldata _message
) external returns (bool);
}
interface ISpecifiesInterchainSecurityModule {
function interchainSecurityModule()
external
view
returns (IInterchainSecurityModule);
}{
"evmVersion": "paris",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 999999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_mailbox","type":"address"},{"internalType":"address","name":"_hook","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_commit_tx_gas_usage","type":"uint256"},{"internalType":"string[]","name":"_commitment_urls","type":"string[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"CommitRevealDispatched","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_hook","type":"address"}],"name":"HookSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint32","name":"origin","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"router","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"owner","type":"bytes32"},{"indexed":false,"internalType":"address","name":"ism","type":"address"},{"indexed":false,"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"InterchainAccountCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_ism","type":"address"}],"name":"IsmSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"destination","type":"uint32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes32","name":"router","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"ism","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"RemoteCallDispatched","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"domain","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"ism","type":"bytes32"}],"name":"RemoteIsmEnrolled","type":"event"},{"inputs":[],"name":"CCIP_READ_ISM","outputs":[{"internalType":"contract CommitmentReadIsm","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMIT_TX_GAS_USAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PACKAGE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bytecodeHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"}],"name":"callRemote","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"}],"name":"callRemote","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"internalType":"bytes32","name":"_ccipReadIsm","type":"bytes32"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"},{"internalType":"contract IPostDispatchHook","name":"_hook","type":"address"},{"internalType":"bytes32","name":"_salt","type":"bytes32"},{"internalType":"bytes32","name":"_commitment","type":"bytes32"}],"name":"callRemoteCommitReveal","outputs":[{"internalType":"bytes32","name":"_commitmentMsgId","type":"bytes32"},{"internalType":"bytes32","name":"_revealMsgId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_commitment","type":"bytes32"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"}],"name":"callRemoteCommitReveal","outputs":[{"internalType":"bytes32","name":"_commitmentMsgId","type":"bytes32"},{"internalType":"bytes32","name":"_revealMsgId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"},{"internalType":"contract IPostDispatchHook","name":"_hook","type":"address"},{"internalType":"bytes32","name":"_salt","type":"bytes32"},{"internalType":"bytes32","name":"_commitment","type":"bytes32"}],"name":"callRemoteCommitReveal","outputs":[{"internalType":"bytes32","name":"_commitmentMsgId","type":"bytes32"},{"internalType":"bytes32","name":"_revealMsgId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"callRemoteWithOverrides","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"}],"name":"callRemoteWithOverrides","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"callRemoteWithOverrides","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"},{"internalType":"contract IPostDispatchHook","name":"_hook","type":"address"}],"name":"callRemoteWithOverrides","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CallLib.Call[]","name":"_calls","type":"tuple[]"},{"internalType":"bytes","name":"_hookMetadata","type":"bytes"}],"name":"callRemoteWithOverrides","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"domains","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_domain","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"}],"name":"enrollRemoteRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"bytes32","name":"_ism","type":"bytes32"}],"name":"enrollRemoteRouterAndIsm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_destinations","type":"uint32[]"},{"internalType":"bytes32[]","name":"_routers","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_isms","type":"bytes32[]"}],"name":"enrollRemoteRouterAndIsms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_domains","type":"uint32[]"},{"internalType":"bytes32[]","name":"_addresses","type":"bytes32[]"}],"name":"enrollRemoteRouters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_owner","type":"bytes32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"address","name":"_ism","type":"address"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"getDeployedInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_ism","type":"address"}],"name":"getDeployedInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_owner","type":"bytes32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"address","name":"_ism","type":"address"}],"name":"getDeployedInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_owner","type":"bytes32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"address","name":"_ism","type":"address"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"getLocalInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_ism","type":"address"}],"name":"getLocalInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_owner","type":"bytes32"},{"internalType":"bytes32","name":"_router","type":"bytes32"},{"internalType":"address","name":"_ism","type":"address"}],"name":"getLocalInterchainAccount","outputs":[{"internalType":"contract OwnableMulticall","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_ism","type":"address"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"getRemoteInterchainAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"}],"name":"getRemoteInterchainAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"bytes32","name":"_userSalt","type":"bytes32"}],"name":"getRemoteInterchainAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_ism","type":"address"}],"name":"getRemoteInterchainAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"handle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"hook","outputs":[{"internalType":"contract IPostDispatchHook","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainSecurityModule","outputs":[{"internalType":"contract IInterchainSecurityModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"destinationDomain","type":"uint32"}],"name":"isms","outputs":[{"internalType":"bytes32","name":"ism","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"localDomain","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mailbox","outputs":[{"internalType":"contract IMailbox","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moduleType","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"uint256","name":"gasLimit","type":"uint256"}],"name":"quoteGasForCommitReveal","outputs":[{"internalType":"uint256","name":"_gasPayment","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"}],"name":"quoteGasPayment","outputs":[{"internalType":"uint256","name":"_gasPayment","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_destination","type":"uint32"}],"name":"quoteGasPayment","outputs":[{"internalType":"uint256","name":"_gasPayment","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"route","outputs":[{"internalType":"contract IInterchainSecurityModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_domain","type":"uint32"}],"name":"routers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_hook","type":"address"}],"name":"setHook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"}],"name":"setInterchainSecurityModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_domain","type":"uint32"}],"name":"unenrollRemoteRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_domains","type":"uint32[]"}],"name":"unenrollRemoteRouters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_metadata","type":"bytes"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6101406040523480156200001257600080fd5b5060405162008415380380620084158339810160408190526200003591620005fc565b8480806001600160a01b0381163b620000955760405162461bcd60e51b815260206004820152601e60248201527f4d61696c626f78436c69656e743a20696e76616c6964206d61696c626f78000060448201526064015b60405180910390fd5b6001600160a01b03821660808190526040805163234d8e3d60e21b81529051638d3638f4916004808201926020929091908290030181865afa158015620000e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010691906200076d565b63ffffffff1660a0526200011a33620001cc565b5050506200012e846200021e60201b60201c565b6200013983620001cc565b60006200014630620002fc565b905062000156600080836200036b565b6001600160a01b031660c08190526200016f906200047c565b60e05260405184908390620001849062000554565b6200019192919062000795565b604051809103906000f080158015620001ae573d6000803e3d6000fd5b506001600160a01b0316610100525050610120525062000856915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b806001600160a01b0381163b1515806200023f57506001600160a01b038116155b6200029d5760405162461bcd60e51b815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201526673657474696e6760c81b60648201526084016200008c565b620002a762000497565b606580546001600160a01b0319166001600160a01b0384169081179091556040519081527f4eab7b127c764308788622363ad3e9532de3dfba7845bd4f84c125a22544255a9060200160405180910390a15050565b606060405180602001620003109062000562565b601f1982820381018352601f9091011660408181526001600160a01b03851660208301520160408051601f198184030181529082905262000355929160200162000823565b6040516020818303038152906040529050919050565b600083471015620003bf5760405162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064016200008c565b8151600003620004125760405162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016200008c565b8282516020840186f590506001600160a01b038116620004755760405162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016200008c565b9392505050565b60006200048982620004f5565b805190602001209050919050565b6033546001600160a01b03163314620004f35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200008c565b565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000006020820152606082811b6001600160601b03191660348301526e5af43d82803e903d91602b57fd5bf360881b60488301529060570162000355565b6119f98062005b5883390190565b610ec4806200755183390190565b80516001600160a01b03811681146200058857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620005ce57620005ce6200058d565b604052919050565b60005b83811015620005f3578181015183820152602001620005d9565b50506000910152565b600080600080600060a086880312156200061557600080fd5b620006208662000570565b9450620006306020870162000570565b9350620006406040870162000570565b6060870151608088015191945092506001600160401b03808211156200066557600080fd5b818801915088601f8301126200067a57600080fd5b8151818111156200068f576200068f6200058d565b620006a060208260051b01620005a3565b8082825260208201915060208360051b86010192508b831115620006c357600080fd5b602085015b838110156200075a57805185811115620006e157600080fd5b8601603f81018e13620006f357600080fd5b6020810151868111156200070b576200070b6200058d565b62000720601f8201601f1916602001620005a3565b8181528f60408385010111156200073657600080fd5b62000749826020830160408601620005d6565b8552505060209283019201620006c8565b5080955050505050509295509295909350565b6000602082840312156200078057600080fd5b815163ffffffff811681146200047557600080fd5b60006040820160018060a01b0385168352602060408185015281855180845260608601915060608160051b870101935082870160005b828110156200081557878603605f1901845281518051808852620007f581888a01898501620005d6565b601f01601f191696909601850195509284019290840190600101620007cb565b509398975050505050505050565b6000835162000837818460208801620005d6565b8351908301906200084d818360208801620005d6565b01949350505050565b60805160a05160c05160e051610100516101205161526c620008ec6000396000818161097f015281816111b501526116710152600081816107160152610f3201526000818161056501526121f001526000818161062f015261171e0152600081816107920152610ca40152600081816109b501528181610f92015281816113eb01528181612347015261256f015261526c6000f3fe6080604052600436106200036f5760003560e01c8063802d061611620001c7578063b918ebab11620000ff578063e9d3cdab11620000a1578063efae508a1162000078578063efae508a1462000a92578063f2ed8c531462000ab7578063f2fde38b1462000adc578063f7e83aee1462000b0157600080fd5b8063e9d3cdab1462000a3f578063eab4eaa41462000a56578063ef96bb4b1462000a6d57600080fd5b8063de523cf311620000d6578063de523cf314620009ee578063e36da6431462000a03578063e9198bf91462000a1a57600080fd5b8063b918ebab146200096b578063d5438eae14620009a1578063dd91cc8714620009d757600080fd5b8063940c14dd1162000169578063a5da36111162000140578063a5da361114620008fc578063a69297931462000921578063b49c53a7146200094657600080fd5b8063940c14dd146200089b5780639662e8ac14620008c0578063a53e921014620008e557600080fd5b80638e45f8fc116200019e5780638e45f8fc14620007f75780638f8625aa146200081c57806393c44847146200084157600080fd5b8063802d061614620007675780638d3638f4146200077e5780638da5cb5b14620007ca57600080fd5b8063420c6a2c11620002a75780636465e69f1162000249578063715018a61162000220578063715018a614620006c557806371a15b3814620006dd5780637f18ee9a14620007025780637f5a7c7b146200073857600080fd5b80636465e69f146200065157806367cb7dce146200067b5780636e0a1a6a14620006a057600080fd5b806356d5d475116200027e57806356d5d47514620005d35780635a007b7e14620005ea5780635c60da1b146200061b57600080fd5b8063420c6a2c1462000551578063440df4f4146200058757806347f65ed114620005ae57600080fd5b806315ce45a211620003115780632ead72f611620002e85780632ead72f614620004da578063361522a214620004ff5780633dfd3873146200052c57600080fd5b806315ce45a214620004795780631bbdef97146200049e5780631f3dbe0d14620004c357600080fd5b806309de307d116200034657806309de307d14620003e45780630e258285146200042f5780630e72cc06146200045457600080fd5b8063056294d1146200037c578063061197d514620003a657806309643ff714620003bd57600080fd5b366200037757005b600080fd5b620003936200038d3660046200310e565b62000b37565b6040519081526020015b60405180910390f35b62000393620003b7366004620031ae565b62000b79565b348015620003ca57600080fd5b50620003e2620003dc3660046200321c565b62000ba8565b005b348015620003f157600080fd5b50620004096200040336600462003275565b62000bc4565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016200039d565b3480156200043c57600080fd5b50620004096200044e366004620032cd565b62000d4a565b3480156200046157600080fd5b50620003e26200047336600462003309565b62000d62565b3480156200048657600080fd5b5062000409620004983660046200336e565b62000eb0565b348015620004ab57600080fd5b5062000409620004bd366004620033b4565b6200102d565b62000393620004d436600462003409565b620010c3565b348015620004e757600080fd5b5062000393620004f93660046200348c565b620010fa565b6200051662000510366004620034aa565b6200111b565b604080519283526020830191909152016200039d565b3480156200053957600080fd5b50620003e26200054b36600462003309565b62001226565b3480156200055e57600080fd5b50620003937f000000000000000000000000000000000000000000000000000000000000000081565b3480156200059457600080fd5b506200059f6200136d565b6040516200039d919062003543565b348015620005bb57600080fd5b5062000409620005cd3660046200358f565b62001380565b620003e2620005e4366004620035d3565b620013d3565b348015620005f757600080fd5b5062000393620006093660046200348c565b60ca6020526000908152604090205481565b3480156200062857600080fd5b50620004097f000000000000000000000000000000000000000000000000000000000000000081565b3480156200065e57600080fd5b5062000668600181565b60405160ff90911681526020016200039d565b3480156200068857600080fd5b50620003936200069a36600462003633565b62001647565b348015620006ad57600080fd5b5062000409620006bf366004620033b4565b620016c1565b348015620006d257600080fd5b50620003e2620017d1565b348015620006ea57600080fd5b50620003e2620006fc36600462003660565b620017e9565b3480156200070f57600080fd5b50620004097f000000000000000000000000000000000000000000000000000000000000000081565b3480156200074557600080fd5b50606554620004099073ffffffffffffffffffffffffffffffffffffffff1681565b62000516620007783660046200321c565b6200184b565b3480156200078b57600080fd5b50620007b47f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016200039d565b348015620007d757600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff1662000409565b3480156200080457600080fd5b5062000409620008163660046200369a565b620018d6565b3480156200082957600080fd5b50620003e26200083b366004620036fd565b6200191d565b3480156200084e57600080fd5b506200088c6040518060400160405280600681526020017f372e312e3130000000000000000000000000000000000000000000000000000081525081565b6040516200039d919062003813565b348015620008a857600080fd5b5062000409620008ba36600462003828565b62001a2a565b348015620008cd57600080fd5b5062000409620008df3660046200369a565b62001a3b565b62000516620008f63660046200386a565b62001a77565b3480156200090957600080fd5b50620004096200091b36600462003828565b62001a9c565b3480156200092e57600080fd5b50620003936200094036600462003633565b62001aad565b3480156200095357600080fd5b50620003e26200096536600462003633565b62001acf565b3480156200097857600080fd5b50620003937f000000000000000000000000000000000000000000000000000000000000000081565b348015620009ae57600080fd5b50620004097f000000000000000000000000000000000000000000000000000000000000000081565b62000393620009e8366004620038fa565b62001ae9565b348015620009fb57600080fd5b503062000409565b6200039362000a1436600462003953565b62001b08565b34801562000a2757600080fd5b50620003e262000a39366004620039c9565b62001b2a565b6200039362000a5036600462003a30565b62001c1b565b6200039362000a6736600462003ae6565b62001c99565b34801562000a7a57600080fd5b506200040962000a8c36600462003b7b565b62001cac565b34801562000a9f57600080fd5b50620003e262000ab13660046200348c565b62001cbc565b34801562000ac457600080fd5b506200039362000ad63660046200348c565b62001cd4565b34801562000ae957600080fd5b50620003e262000afb36600462003309565b62001d17565b34801562000b0e57600080fd5b5062000b2662000b2036600462003bcd565b62001dd1565b60405190151581526020016200039d565b600062000b6d88888888888888606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1662001c1b565b98975050505050505050565b600062000b9e8686868686604051806020016040528060008152506000801b62000b37565b9695505050505050565b62000bb262001e65565b62000bbf83838362001ee8565b505050565b600073ffffffffffffffffffffffffffffffffffffffff841662000c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6e6f20726f757465722073706563696669656420666f722064657374696e617460448201527f696f6e000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600062000c8f8162000c818762001fbc565b805190602001208762002074565b9050600062000c9e826200209e565b604080517f000000000000000000000000000000000000000000000000000000000000000060e01b7fffffffff000000000000000000000000000000000000000000000000000000001660208083019190915273ffffffffffffffffffffffffffffffffffffffff8b811660248401523060448401528916606483015260848083018990528351808403909101815260a4909201909252805191012090915062000b6d81838962002074565b600062000d5983838362001380565b90505b92915050565b8073ffffffffffffffffffffffffffffffffffffffff81163b15158062000d9d575073ffffffffffffffffffffffffffffffffffffffff8116155b62000e2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e6700000000000000000000000000000000000000000000000000606482015260840162000c66565b62000e3562001e65565b606680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527fc47cbcc588c67679e52261c45cc315e56562f8d0ccaba16facb9093ff9498799906020015b60405180910390a15050565b600036600062000ec18585620020b9565b91509150600062000ed38383620020d7565b90506000600282600281111562000eee5762000eee62003c34565b0362000f5a5762000f0a62000f0485856200210d565b6200212a565b905073ffffffffffffffffffffffffffffffffffffffff81161562000f30578062000f52565b7f00000000000000000000000000000000000000000000000000000000000000005b905062000b9e565b62000f6a62000f048585620021d5565b905073ffffffffffffffffffffffffffffffffffffffff81161562000f90578062001022565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e5f516e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ffc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001022919062003c63565b979650505050505050565b600062000b9e620010bd87878773ffffffffffffffffffffffffffffffffffffffff88165b6040805160e09590951b7fffffffff000000000000000000000000000000000000000000000000000000001660208087019190915260248601949094526044850192909252606484015260848084018890528151808503909101815260a49093019052815191012090565b620021e7565b600080620010d186620010fa565b63ffffffff8716600090815260ca60205260409020549091506200102287838389898962001c99565b60008062001113609763ffffffff808616906200221516565b949350505050565b600080806200112d338a868862002224565b604080518c8152602081018c9052908101879052909150339063ffffffff8d16907fa82f02bdb198e6cca80598e390600aa519d0f9efca0322efa45096af14fa20879060600160405180910390a360405184907f2a1e0d9efb303f9faca2f4484ea37adc72e0e9bee4e0def3d691e302a831926090600090a2620011f38b8b83620011eb60007f000000000000000000000000000000000000000000000000000000000000000030604051806020016040528060008152506200225b565b8a3462002279565b92506000620012038986620023ce565b9050620012158c8c838b8b4762002279565b925050509850989650505050505050565b8073ffffffffffffffffffffffffffffffffffffffff81163b15158062001261575073ffffffffffffffffffffffffffffffffffffffff8116155b620012ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e6700000000000000000000000000000000000000000000000000606482015260840162000c66565b620012f962001e65565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527f4eab7b127c764308788622363ad3e9532de3dfba7845bd4f84c125a22544255a9060200162000ea4565b60606200137b6097620023ff565b905090565b6000806200139262000f0486620010fa565b63ffffffff8616600090815260ca602052604081205491925090620013b7906200212a565b9050620013c78583838762000bc4565b925050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146200149a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4d61696c626f78436c69656e743a2073656e646572206e6f74206d61696c626f60448201527f7800000000000000000000000000000000000000000000000000000000000000606482015260840162000c66565b6000620014a88383620020d7565b90506002816002811115620014c157620014c162003c34565b03620014ce575062001641565b6000620014dc84846200210d565b90506000620014ec8585620024be565b90506000620014fc8686620021d5565b905060006200151989858a62001512866200212a565b87620016c1565b9050600085600281111562001532576200153262003c34565b03620015bf576000620015468888620024d0565b90508173ffffffffffffffffffffffffffffffffffffffff166365604f8334836040518363ffffffff1660e01b815260040162001584919062003c83565b6000604051808303818588803b1580156200159e57600080fd5b505af1158015620015b3573d6000803e3d6000fd5b5050505050506200163b565b8073ffffffffffffffffffffffffffffffffffffffff1663abe20032620015e78989620024f0565b6040518263ffffffff1660e01b81526004016200160691815260200190565b600060405180830381600087803b1580156200162157600080fd5b505af115801562001636573d6000803e3d6000fd5b505050505b50505050505b50505050565b600062001655838362001aad565b604080516000815260208101909152620016b5908590620016967f000000000000000000000000000000000000000000000000000000000000000062002501565b60655473ffffffffffffffffffffffffffffffffffffffff1662002521565b62000d59919062003d55565b600080620016e887878773ffffffffffffffffffffffffffffffffffffffff881662001052565b90506000620016f782620021e7565b905073ffffffffffffffffffffffffffffffffffffffff81163b62001022576000620017437f0000000000000000000000000000000000000000000000000000000000000000620025f2565b9050620017536000848362002677565b6040805163ffffffff8c168152602081018a90529081018a905273ffffffffffffffffffffffffffffffffffffffff888116606083015260808201889052919350908316907f43c7c79901faab5ae18ac2369d6df969a28064bd40483d341f0dc439cb095d969060a00160405180910390a250979650505050505050565b620017db62001e65565b620017e76000620027dc565b565b620017f362001e65565b8060005b8181101562001641576200183684848381811062001819576200181962003d6b565b90506020020160208101906200183091906200348c565b62002853565b6200184360018262003d55565b9050620017f7565b60008060006200185b86620010fa565b63ffffffff8716600090815260ca6020908152604080832054815192830190915282825292935062001893908290889033906200225b565b606554909150620018c790899085908590600090869073ffffffffffffffffffffffffffffffffffffffff16828e6200111b565b94509450505050935093915050565b6000620019148573ffffffffffffffffffffffffffffffffffffffff861673ffffffffffffffffffffffffffffffffffffffff8616856000620016c1565b95945050505050565b6200192762001e65565b84831480156200193657508481145b6200199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6c656e677468206d69736d617463680000000000000000000000000000000000604482015260640162000c66565b60005b8581101562001a215762001a18878783818110620019c357620019c362003d6b565b9050602002016020810190620019da91906200348c565b868684818110620019ef57620019ef62003d6b565b9050602002013585858581811062001a0b5762001a0b62003d6b565b9050602002013562001ee8565b600101620019a1565b50505050505050565b6000620019148585858585620016c1565b6000620019148573ffffffffffffffffffffffffffffffffffffffff861673ffffffffffffffffffffffffffffffffffffffff86168562001a9c565b60008062001a8c898989848a8a8a8a6200111b565b9150915097509795505050505050565b60006200191485858585856200102d565b6040805160008082526020820190925262000d59908490620016968562002501565b62001ad962001e65565b62001ae58282620028af565b5050565b60006200111384848460405180602001604052806000815250620010c3565b6000620010228787878787604051806020016040528060008152508862000b37565b62001b3462001e65565b82811462001b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f216c656e67746800000000000000000000000000000000000000000000000000604482015260640162000c66565b8260005b8181101562001c135762001bfe86868381811062001bc55762001bc562003d6b565b905060200201602081019062001bdc91906200348c565b85858481811062001bf15762001bf162003d6b565b90506020020135620028af565b62001c0b60018262003d55565b905062001ba3565b505050505050565b6040805188815260208101889052908101839052600090339063ffffffff8b16907fa82f02bdb198e6cca80598e390600aa519d0f9efca0322efa45096af14fa20879060600160405180910390a3600062001c7a3389898988620028bd565b905062001c8b8a8a838887620028e4565b9a9950505050505050505050565b6000620010228787878787878762000b37565b6000620011138484848462000bc4565b62001cc662001e65565b62001cd18162002853565b50565b60408051602080820183526000808352835191820190935282815260655462000d5c928592909173ffffffffffffffffffffffffffffffffffffffff1662002521565b62001d2162001e65565b73ffffffffffffffffffffffffffffffffffffffff811662001dc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840162000c66565b62001cd181620027dc565b600062001ddf838362000eb0565b73ffffffffffffffffffffffffffffffffffffffff1663f7e83aee868686866040518563ffffffff1660e01b815260040162001e1f949392919062003de3565b6020604051808303816000875af115801562001e3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001914919062003e0e565b60335473ffffffffffffffffffffffffffffffffffffffff163314620017e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000c66565b600062001ef584620010fa565b14801562001f16575063ffffffff8316600090815260ca6020526040902054155b62001fa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f726f7574657220616e642049534d2064656661756c74732061726520696d6d7560448201527f7461626c65206f6e636520736574000000000000000000000000000000000000606482015260840162000c66565b62001fb08383620028f6565b62000bbf83826200290e565b60606040518060200162001fd09062002f5c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff8516602083015201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526200205e929160200162003e32565b6040516020818303038152906040529050919050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6000620020ab82620025f2565b805190602001209050919050565b366000620020cb83604d818762003e65565b915091505b9250929050565b600082826000818110620020ef57620020ef62003d6b565b919091013560f81c9050600281111562000d595762000d5962003c34565b60006200211f60216001848662003e65565b62000d599162003e91565b600073ffffffffffffffffffffffffffffffffffffffff821115620021d1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f7700000000000000000000000000000000000000000000000000000000606482015260840162000c66565b5090565b60006200211f60416021848662003e65565b600062000d5c827f000000000000000000000000000000000000000000000000000000000000000062002965565b600080620020cb848462002974565b60606001858584866040516020016200224295949392919062003f0d565b6040516020818303038152906040529050949350505050565b60606001858585856040516020016200224295949392919062003f3b565b6000856200230a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6e6f20726f757465722073706563696669656420666f722064657374696e617460448201527f696f6e0000000000000000000000000000000000000000000000000000000000606482015260840162000c66565b6040517f10b83dc000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906310b83dc090849062002388908b908b908b908b908b9060040162003fc2565b60206040518083038185885af1158015620023a7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062001022919062004026565b606060028383604051602001620023e89392919062004040565b604051602081830303815290604052905092915050565b606060006200240e83620029b3565b9050805167ffffffffffffffff8111156200242d576200242d62002fcc565b60405190808252806020026020018201604052801562002457578160200160208202803683370190505b50915060005b8151811015620024b7578181815181106200247c576200247c62003d6b565b602002602001015183828151811062002499576200249962003d6b565b63ffffffff909216602092830291909101909101526001016200245d565b5050919050565b60006200211f60616041848662003e65565b6060620024e1826061818662003e65565b81019062000d59919062004061565b60006200211f826061818662003e65565b606062000d5c60008333604051806020016040528060008152506200225b565b6000806200252f8662002a51565b6040517f81d2ea9500000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906381d2ea9590620025ae90899085908a908a908a9060040162003fc2565b602060405180830381865afa158015620025cc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b9e919062004026565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000006020820152606082811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660348301527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006048830152906057016200205e565b600083471015620026e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015260640162000c66565b815160000362002752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015260640162000c66565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116620013cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015260640162000c66565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62002869609763ffffffff8084169062002abd16565b620028748262002acb565b9062001ae5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c66919062003813565b62001ae58282600062001ee8565b606062000b9e73ffffffffffffffffffffffffffffffffffffffff87168686868662002af0565b600062000b9e86868686863462002279565b62001ae5609763ffffffff80851690849062002b7716565b63ffffffff8216600081815260ca602052604090819020839055517fba9685b280b1e8f64909e2dfd7465463e6a0eabbaafd732402e7a619699a382190620029599084815260200190565b60405180910390a25050565b600062000d5983833062002074565b6000818152600283016020526040812054819080620029a75762002999858562002b84565b925060009150620020d09050565b600192509050620020d0565b60606000620029c28362002b92565b90508067ffffffffffffffff811115620029e057620029e062002fcc565b60405190808252806020026020018201604052801562002a0a578160200160208202803683370190505b50915060005b81811015620024b75762002a25848262002b9f565b60001c83828151811062002a3d5762002a3d62003d6b565b602090810291909101015260010162002a10565b6000808062002a6b609763ffffffff808716906200221516565b91509150811562002a7d579392505050565b62002a888462002acb565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c66919062003813565b600062000d59838362002bad565b606062002ade8263ffffffff1662002bcc565b6040516020016200205e91906200419c565b606060008087878560405160200162002b0d9493929190620041e3565b60405160208183030381529060405290506000858560405160200162002b359291906200420c565b6040516020818303038152906040529050818160405160200162002b5b92919062003e32565b6040516020818303038152906040529250505095945050505050565b6200164183838362002c91565b600062000d59838362002cb0565b600062000d5c8262002cc9565b600062000d59838362002cd4565b6000818152600283016020526040812081905562000d59838362002d01565b6060600062002bdb8362002d0f565b600101905060008167ffffffffffffffff81111562002bfe5762002bfe62002fcc565b6040519080825280601f01601f19166020018201604052801562002c29576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508462002c3357509392505050565b6000828152600284016020526040812082905562001113848462002df8565b6000818152600183016020526040812054151562000d59565b600062000d5c825490565b600082600001828154811062002cee5762002cee62003d6b565b9060005260206000200154905092915050565b600062000d59838362002e06565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062002d59577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062002d86576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831062002da557662386f26fc10000830492506010015b6305f5e100831062002dbe576305f5e100830492506008015b612710831062002dd357612710830492506004015b6064831062002de6576064830492506002015b600a831062000d5c5760010192915050565b600062000d59838362002f0a565b6000818152600183016020526040812054801562002eff57600062002e2d6001836200432d565b855490915060009062002e43906001906200432d565b905081811462002eaf57600086600001828154811062002e675762002e6762003d6b565b906000526020600020015490508087600001848154811062002e8d5762002e8d62003d6b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062002ec35762002ec362004343565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000d5c565b600091505062000d5c565b600081815260018301602052604081205462002f535750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000d5c565b50600062000d5c565b610ec4806200437383390190565b803563ffffffff8116811462002f7f57600080fd5b919050565b60008083601f84011262002f9757600080fd5b50813567ffffffffffffffff81111562002fb057600080fd5b6020830191508360208260051b8501011115620020d057600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171562003021576200302162002fcc565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562003071576200307162002fcc565b604052919050565b600082601f8301126200308b57600080fd5b813567ffffffffffffffff811115620030a857620030a862002fcc565b620030db60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160162003027565b818152846020838601011115620030f157600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156200312a57600080fd5b620031358862002f6a565b96506020880135955060408801359450606088013567ffffffffffffffff808211156200316157600080fd5b6200316f8b838c0162002f84565b909650945060808a01359150808211156200318957600080fd5b50620031988a828b0162003079565b92505060a0880135905092959891949750929550565b600080600080600060808688031215620031c757600080fd5b620031d28662002f6a565b94506020860135935060408601359250606086013567ffffffffffffffff811115620031fd57600080fd5b6200320b8882890162002f84565b969995985093965092949392505050565b6000806000606084860312156200323257600080fd5b6200323d8462002f6a565b95602085013595506040909401359392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811462001cd157600080fd5b600080600080608085870312156200328c57600080fd5b8435620032998162003252565b93506020850135620032ab8162003252565b92506040850135620032bd8162003252565b9396929550929360600135925050565b60008060408385031215620032e157600080fd5b620032ec8362002f6a565b91506020830135620032fe8162003252565b809150509250929050565b6000602082840312156200331c57600080fd5b8135620013cc8162003252565b60008083601f8401126200333c57600080fd5b50813567ffffffffffffffff8111156200335557600080fd5b602083019150836020828501011115620020d057600080fd5b600080602083850312156200338257600080fd5b823567ffffffffffffffff8111156200339a57600080fd5b620033a88582860162003329565b90969095509350505050565b600080600080600060a08688031215620033cd57600080fd5b620033d88662002f6a565b945060208601359350604086013592506060860135620033f88162003252565b949793965091946080013592915050565b600080600080606085870312156200342057600080fd5b6200342b8562002f6a565b9350602085013567ffffffffffffffff808211156200344957600080fd5b620034578883890162002f84565b909550935060408701359150808211156200347157600080fd5b50620034808782880162003079565b91505092959194509250565b6000602082840312156200349f57600080fd5b62000d598262002f6a565b600080600080600080600080610100898b031215620034c857600080fd5b620034d38962002f6a565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8111156200350557600080fd5b620035138b828c0162003079565b94505060a0890135620035268162003252565b979a969950949793969295929450505060c08201359160e0013590565b6020808252825182820181905260009190848201906040850190845b818110156200358357835163ffffffff16835292840192918401916001016200355f565b50909695505050505050565b600080600060608486031215620035a557600080fd5b620035b08462002f6a565b92506020840135620035c28162003252565b929592945050506040919091013590565b60008060008060608587031215620035ea57600080fd5b620035f58562002f6a565b935060208501359250604085013567ffffffffffffffff8111156200361957600080fd5b620036278782880162003329565b95989497509550505050565b600080604083850312156200364757600080fd5b620036528362002f6a565b946020939093013593505050565b600080602083850312156200367457600080fd5b823567ffffffffffffffff8111156200368c57600080fd5b620033a88582860162002f84565b60008060008060808587031215620036b157600080fd5b620036bc8562002f6a565b93506020850135620036ce8162003252565b92506040850135620036e08162003252565b91506060850135620036f28162003252565b939692955090935050565b600080600080600080606087890312156200371757600080fd5b863567ffffffffffffffff808211156200373057600080fd5b6200373e8a838b0162002f84565b909850965060208901359150808211156200375857600080fd5b620037668a838b0162002f84565b909650945060408901359150808211156200378057600080fd5b506200378f89828a0162002f84565b979a9699509497509295939492505050565b60005b83811015620037be578181015183820152602001620037a4565b50506000910152565b60008151808452620037e1816020860160208601620037a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600062000d596020830184620037c7565b600080600080608085870312156200383f57600080fd5b6200384a8562002f6a565b935060208501359250604085013591506060850135620036f28162003252565b600080600080600080600060e0888a0312156200388657600080fd5b620038918862002f6a565b96506020880135955060408801359450606088013567ffffffffffffffff811115620038bc57600080fd5b620038ca8a828b0162003079565b9450506080880135620038dd8162003252565b9699959850939692959460a0840135945060c09093013592915050565b6000806000604084860312156200391057600080fd5b6200391b8462002f6a565b9250602084013567ffffffffffffffff8111156200393857600080fd5b620039468682870162002f84565b9497909650939450505050565b60008060008060008060a087890312156200396d57600080fd5b620039788762002f6a565b95506020870135945060408701359350606087013567ffffffffffffffff811115620039a357600080fd5b620039b189828a0162002f84565b979a9699509497949695608090950135949350505050565b60008060008060408587031215620039e057600080fd5b843567ffffffffffffffff80821115620039f957600080fd5b62003a078883890162002f84565b9096509450602087013591508082111562003a2157600080fd5b50620036278782880162002f84565b60008060008060008060008060e0898b03121562003a4d57600080fd5b62003a588962002f6a565b97506020890135965060408901359550606089013567ffffffffffffffff8082111562003a8457600080fd5b62003a928c838d0162002f84565b909750955060808b013591508082111562003aac57600080fd5b5062003abb8b828c0162003079565b93505060a0890135915060c089013562003ad58162003252565b809150509295985092959890939650565b60008060008060008060a0878903121562003b0057600080fd5b62003b0b8762002f6a565b95506020870135945060408701359350606087013567ffffffffffffffff8082111562003b3757600080fd5b62003b458a838b0162002f84565b9095509350608089013591508082111562003b5f57600080fd5b5062003b6e89828a0162003079565b9150509295509295509295565b60008060006060848603121562003b9157600080fd5b833562003b9e8162003252565b9250602084013562003bb08162003252565b9150604084013562003bc28162003252565b809150509250925092565b6000806000806040858703121562003be457600080fd5b843567ffffffffffffffff8082111562003bfd57600080fd5b62003c0b8883890162003329565b9096509450602087013591508082111562003c2557600080fd5b50620036278782880162003329565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006020828403121562003c7657600080fd5b8151620013cc8162003252565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101562003d18578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805184528781015188850152860151606087850181905262003d0381860183620037c7565b96890196945050509086019060010162003cac565b509098975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111562000d5c5762000d5c62003d26565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60408152600062003df960408301868862003d9a565b82810360208401526200102281858762003d9a565b60006020828403121562003e2157600080fd5b81518015158114620013cc57600080fd5b6000835162003e46818460208801620037a1565b83519083019062003e5c818360208801620037a1565b01949350505050565b6000808585111562003e7657600080fd5b8386111562003e8457600080fd5b5050820193919092039150565b8035602083101562000d5c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b6003811062003f06577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60f81b9052565b62003f19818762003ece565b6001810194909452602184019290925260418301526061820152608101919050565b7fffff0000000000000000000000000000000000000000000000000000000000008660f01b1681528460028201528360228201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1660428201526000825162003fb1816056850160208701620037a1565b919091016056019695505050505050565b63ffffffff8616815284602082015260a06040820152600062003fe960a0830186620037c7565b828103606084015262003ffd8186620037c7565b91505073ffffffffffffffffffffffffffffffffffffffff831660808301529695505050505050565b6000602082840312156200403957600080fd5b5051919050565b6200404c818562003ece565b60018101929092526021820152604101919050565b600060208083850312156200407557600080fd5b823567ffffffffffffffff808211156200408e57600080fd5b818501915085601f830112620040a357600080fd5b813581811115620040b857620040b862002fcc565b8060051b620040c985820162003027565b9182528381018501918581019089841115620040e457600080fd5b86860192505b838310156200418f57823585811115620041045760008081fd5b86016060818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018113156200413b5760008081fd5b6200414562002ffb565b828a01358152604080840135828c0152918301359188831115620041695760008081fd5b620041798e8c8587010162003079565b90820152845250509186019190860190620040ea565b9998505050505050505050565b7f4e6f20726f7574657220656e726f6c6c656420666f7220646f6d61696e3a2000815260008251620041d681601f850160208701620037a1565b91909101601f0192915050565b620041ef818662003ece565b600181019390935260218301919091526041820152606101919050565b60208082528181018390526000906040808401600586901b8501820187855b8881101562003d18577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b36030181126200428e57600080fd5b8a01803584528681013587850152606086820135368390037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1018112620042d457600080fd5b90910187810191903567ffffffffffffffff811115620042f357600080fd5b8036038313156200430357600080fd5b818887015262004317828701828562003d9a565b968901969550505091860191506001016200422b565b8181038181111562000d5c5762000d5c62003d26565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe60a060405234801561001057600080fd5b50604051610ec4380380610ec483398101604081905261002f9161009a565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c654d756c746963616c6c3a20696e76616c6964206f776e657200604482015260640160405180910390fd5b6001600160a01b03166080526100ca565b6000602082840312156100ac57600080fd5b81516001600160a01b03811681146100c357600080fd5b9392505050565b608051610dd26100f26000396000818160f70152818161017601526103a60152610dd26000f3fe60806040526004361061005e5760003560e01c8063839df94511610043578063839df945146100a55780638da5cb5b146100e5578063abe200321461013e57600080fd5b806365604f831461006a57806374c00f9f1461007f57600080fd5b3661006557005b600080fd5b61007d6100783660046108b0565b61015e565b005b61009261008d3660046108f2565b610218565b6040519081526020015b60405180910390f35b3480156100b157600080fd5b506100d56100c036600461093e565b60006020819052908152604090205460ff1681565b604051901515815260200161009c565b3480156100f157600080fd5b506101197f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161009c565b34801561014a57600080fd5b5061007d61015936600461093e565b61038e565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610202576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61021461020f82846109fe565b61052d565b5050565b60008082858560405160200161022f929190610b34565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261026b9291602001610cb1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152815160209283012060008181529283905291205490915060ff16610319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4943413a20496e76616c69642052657665616c0000000000000000000000000060448201526064016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551919250829182917fd51d38a373f01d7ff784e6983dc84e96dc02bedcf7705b292eebc427255e0ca591a261038661020f85876109fe565b509392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064016101f9565b60008181526020819052604090205460ff16156104cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4943413a2050726576696f757320636f6d6d69746d656e742070656e64696e6760448201527f20657865637574696f6e0000000000000000000000000000000000000000000060648201526084016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f3f09b472466bcbbb9c7336754868e482b43fabaa73806dcbf50079f2a68d0ec591a250565b80516000905b808210156105695761055d83838151811061055057610550610cd7565b602002602001015161056e565b50816001019150610533565b505050565b606061058f6105808360000151610595565b8360400151846020015161063e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82111561063a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f770000000000000000000000000000000000000000000000000000000060648201526084016101f9565b5090565b6060610664848484604051806060016040528060298152602001610d746029913961066c565b949350505050565b6060824710156106fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101f9565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516107279190610d06565b60006040518083038185875af1925050503d8060008114610764576040519150601f19603f3d011682016040523d82523d6000602084013e610769565b606091505b509150915061077a87838387610785565b979650505050505050565b6060831561081b5782516000036108145773ffffffffffffffffffffffffffffffffffffffff85163b610814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f9565b5081610664565b61066483838151156108305781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f99190610d22565b60008083601f84011261087657600080fd5b50813567ffffffffffffffff81111561088e57600080fd5b6020830191508360208260051b85010111156108a957600080fd5b9250929050565b600080602083850312156108c357600080fd5b823567ffffffffffffffff8111156108da57600080fd5b6108e685828601610864565b90969095509350505050565b60008060006040848603121561090757600080fd5b833567ffffffffffffffff81111561091e57600080fd5b61092a86828701610864565b909790965060209590950135949350505050565b60006020828403121561095057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156109a9576109a9610957565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156109f6576109f6610957565b604052919050565b600067ffffffffffffffff80841115610a1957610a19610957565b8360051b6020610a2a8183016109af565b868152918501918181019036841115610a4257600080fd5b865b84811015610b2857803586811115610a5c5760008081fd5b88016060368290031215610a705760008081fd5b610a78610986565b81358152858201358682015260408083013589811115610a985760008081fd5b9290920191601f3681850112610aae5760008081fd5b83358a811115610ac057610ac0610957565b610aef897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084840116016109af565b91508082523689828701011115610b065760008081fd5b808986018a840137600090820189015290820152845250918301918301610a44565b50979650505050505050565b60208082528181018390526000906040808401600586901b8501820187855b88811015610c7f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b3603018112610bb457600080fd5b8a01803584528681013587850152606086820135368390037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1018112610bf957600080fd5b90910187810191903567ffffffffffffffff811115610c1757600080fd5b803603831315610c2657600080fd5b8188870152808287015260809150808383880137600086820183015295880195601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909401909301925090850190600101610b53565b509098975050505050505050565b60005b83811015610ca8578181015183820152602001610c90565b50506000910152565b82815260008251610cc9816020850160208701610c8d565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008251610d18818460208701610c8d565b9190910192915050565b6020815260008251806020840152610d41816040850160208701610c8d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a264697066735822122069b7ef2511abdbdd988d031b0ff798c7dee23caf54428aadf16b214523d516ae64736f6c63430008160033a2646970667358221220f8867c418c12665ad01ffa21edb6f8a532574e3720f958171319d39bb7901ff064736f6c6343000816003360806040523480156200001157600080fd5b50604051620019f9380380620019f9833981016040819052620000349162000318565b6200003f336200005d565b6200004a81620000af565b62000055826200005d565b505062000641565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620000b962000174565b6000815111620001225760405162461bcd60e51b815260206004820152602960248201527f4162737472616374436369705265616449736d3a2075726c732063616e6e6f7460448201526820626520656d70747960b81b60648201526084015b60405180910390fd5b805162000137906065906020840190620001d2565b507f698ec4bf77690368abfaca0b66e51916585a0ca8b23e7925844ea841a4e7a5038160405162000169919062000466565b60405180910390a150565b6033546001600160a01b03163314620001d05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000119565b565b8280548282559060005260206000209081019282156200021d579160200282015b828111156200021d57825182906200020c908262000575565b5091602001919060010190620001f3565b506200022b9291506200022f565b5090565b808211156200022b57600062000246828262000250565b506001016200022f565b5080546200025e90620004e4565b6000825580601f106200026f575050565b601f0160209004906000526020600020908101906200028f919062000292565b50565b5b808211156200022b576000815560010162000293565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620002ea57620002ea620002a9565b604052919050565b60005b838110156200030f578181015183820152602001620002f5565b50506000910152565b60008060408084860312156200032d57600080fd5b83516001600160a01b03811681146200034557600080fd5b602085810151919450906001600160401b03808211156200036557600080fd5b8187019150601f88601f8401126200037c57600080fd5b825182811115620003915762000391620002a9565b8060051b620003a2868201620002bf565b918252848101860191868101908c841115620003bd57600080fd5b87870192505b838310156200045357825186811115620003dd5760008081fd5b8701603f81018e13620003f05760008081fd5b8881015187811115620004075762000407620002a9565b6200041a818801601f19168b01620002bf565b8181528f8c838501011115620004305760008081fd5b62000441828c83018e8601620002f2565b845250509187019190870190620003c3565b8099505050505050505050509250929050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015620004d757878503603f1901845281518051808752620004b7818989018a8501620002f2565b601f01601f1916959095018601945092850192908501906001016200048d565b5092979650505050505050565b600181811c90821680620004f957607f821691505b6020821081036200051a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000570576000816000526020600020601f850160051c810160208610156200054b5750805b601f850160051c820191505b818110156200056c5782815560010162000557565b5050505b505050565b81516001600160401b03811115620005915762000591620002a9565b620005a981620005a28454620004e4565b8462000520565b602080601f831160018114620005e15760008415620005c85750858301515b600019600386901b1c1916600185901b1785556200056c565b600085815260208120601f198616915b828110156200061257888601518255948401946001909101908401620005f1565b5085821015620006315787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6113a880620006516000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80638da5cb5b11610076578063bbac9bc81161005b578063bbac9bc81461016e578063f2fde38b14610181578063f7e83aee1461019457600080fd5b80638da5cb5b146100fd57806393c448471461012557600080fd5b80632c73dc4a146100a85780636465e69f146100c65780636cc895a9146100e0578063715018a6146100f5575b600080fd5b6100b06101b7565b6040516100bd9190610966565b60405180910390f35b6100ce600781565b60405160ff90911681526020016100bd565b6100f36100ee366004610b29565b610290565b005b6100f361037c565b60335460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100bd565b6101616040518060400160405280600681526020017f372e312e3130000000000000000000000000000000000000000000000000000081525081565b6040516100bd9190610bf4565b6100f361017c366004610c49565b610390565b6100f361018f366004610c8b565b6103f8565b6101a76101a2366004610cc1565b6104af565b60405190151581526020016100bd565b60606065805480602002602001604051908101604052809291908181526020016000905b828210156102875783829060005260206000200180546101fa90610d2d565b80601f016020809104026020016040519081016040528092919081815260200182805461022690610d2d565b80156102735780601f1061024857610100808354040283529160200191610273565b820191906000526020600020905b81548152906001019060200180831161025657829003601f168201915b5050505050815260200190600101906101db565b50505050905090565b61029861067d565b600081511161032e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4162737472616374436369705265616449736d3a2075726c732063616e6e6f7460448201527f20626520656d707479000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8051610341906065906020840190610845565b507f698ec4bf77690368abfaca0b66e51916585a0ca8b23e7925844ea841a4e7a503816040516103719190610966565b60405180910390a150565b61038461067d565b61038e60006106fe565b565b30606561039d8484610775565b6040517f556f1830000000000000000000000000000000000000000000000000000000008152610325939291907ff7e83aee000000000000000000000000000000000000000000000000000000009087908790600401610dc9565b61040061067d565b73ffffffffffffffffffffffffffffffffffffffff81166104a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610325565b6104ac816106fe565b50565b6000806104bf8560148189610f4b565b6040516104cd929190610f75565b6040518091039020905060006104eb6104e68686610809565b610825565b905080821461057c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f436f6d6d69746d656e742049534d3a2052657665616c6564204861736820496e60448201527f76616c69640000000000000000000000000000000000000000000000000000006064820152608401610325565b600061058b601482898b610f4b565b61059491610f85565b60601c90508060006105aa603460148b8d610f4b565b6105b391610fcd565b905060006105c48a6034818e610f4b565b8101906105d19190611009565b6040517f74c00f9f00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8416906374c00f9f90610628908490869060040161112c565b6020604051808303816000875af1158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b91906111d2565b5060019b9a5050505050505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff16331461038e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610325565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060828260405160240161078a9291906111eb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f2b4b00ee0000000000000000000000000000000000000000000000000000000017905290505b92915050565b36600061081983604d8187610f4b565b915091505b9250929050565b6000610835604160218486610f4b565b61083e91610fcd565b9392505050565b82805482825590600052602060002090810192821561088b579160200282015b8281111561088b578251829061087b9082611258565b5091602001919060010190610865565b5061089792915061089b565b5090565b808211156108975760006108af82826108b8565b5060010161089b565b5080546108c490610d2d565b6000825580601f106108d4575050565b601f0160209004906000526020600020908101906104ac91905b8082111561089757600081556001016108ee565b6000815180845260005b818110156109285760208185018101518683018201520161090c565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156109db577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526109c9858351610902565b9450928501929085019060010161098f565b5092979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610a3a57610a3a6109e8565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610a8757610a876109e8565b604052919050565b600067ffffffffffffffff821115610aa957610aa96109e8565b5060051b60200190565b600067ffffffffffffffff831115610acd57610acd6109e8565b610afe60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601610a40565b9050828152838383011115610b1257600080fd5b828260208301376000602084830101529392505050565b60006020808385031215610b3c57600080fd5b823567ffffffffffffffff80821115610b5457600080fd5b818501915085601f830112610b6857600080fd5b8135610b7b610b7682610a8f565b610a40565b81815260059190911b83018401908481019088831115610b9a57600080fd5b8585015b83811015610be757803585811115610bb65760008081fd5b8601603f81018b13610bc85760008081fd5b610bd98b8983013560408401610ab3565b845250918601918601610b9e565b5098975050505050505050565b60208152600061083e6020830184610902565b60008083601f840112610c1957600080fd5b50813567ffffffffffffffff811115610c3157600080fd5b60208301915083602082850101111561081e57600080fd5b60008060208385031215610c5c57600080fd5b823567ffffffffffffffff811115610c7357600080fd5b610c7f85828601610c07565b90969095509350505050565b600060208284031215610c9d57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461083e57600080fd5b60008060008060408587031215610cd757600080fd5b843567ffffffffffffffff80821115610cef57600080fd5b610cfb88838901610c07565b90965094506020870135915080821115610d1457600080fd5b50610d2187828801610c07565b95989497509550505050565b600181811c90821680610d4157607f821691505b602082108103610d7a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600060a0820173ffffffffffffffffffffffffffffffffffffffff89168352602060a08185015281895480845260c0860191506005935060c08160051b87010160008c8152848120815b84811015610ee2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408a8503018652828254610e4e81610d2d565b80875260018281168015610e695760018114610ea057610ecb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168c8a01528b8315158e1b8a01019450610ecb565b8688528b8820885b84811015610ec35781548b82018f0152908301908d01610ea8565b8a018d019550505b50988a019892965050509190910190600101610e13565b5050508681036040880152610ef7818c610902565b945050505050610f2b60608401877fffffffff00000000000000000000000000000000000000000000000000000000169052565b8281036080840152610f3e818587610d80565b9998505050505050505050565b60008085851115610f5b57600080fd5b83861115610f6857600080fd5b5050820193919092039150565b8183823760009101908152919050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008135818116916014851015610fc55780818660140360031b1b83161692505b505092915050565b80356020831015610803577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b6000602080838503121561101c57600080fd5b823567ffffffffffffffff8082111561103457600080fd5b818501915085601f83011261104857600080fd5b8135611056610b7682610a8f565b81815260059190911b8301840190848101908883111561107557600080fd5b8585015b83811015610be7578035858111156110915760008081fd5b86016060818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018113156110c75760008081fd5b6110cf610a17565b828a01358152604080840135828c01529183013591888311156110f25760008081fd5b82840193508d603f85011261110957600092508283fd5b6111198e8c860135838701610ab3565b9082015285525050918601918601611079565b60006040808301604084528086518083526060925060608601915060608160051b8701016020808a0160005b848110156111bd578984037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001865281518051855283810151848601528801518885018890526111aa88860182610902565b9684019694505090820190600101611158565b50509690960196909652509295945050505050565b6000602082840312156111e457600080fd5b5051919050565b6020815260006111ff602083018486610d80565b949350505050565b601f821115611253576000816000526020600020601f850160051c810160208610156112305750805b601f850160051c820191505b8181101561124f5782815560010161123c565b5050505b505050565b815167ffffffffffffffff811115611272576112726109e8565b611286816112808454610d2d565b84611207565b602080601f8311600181146112d957600084156112a35750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561124f565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561132657888601518255948401946001909101908401611307565b508582101561136257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122046694512c8841f857084c1d96d8038cf61fcc5a7692d2ad504ea407b7c77fc6e64736f6c6343000816003360a060405234801561001057600080fd5b50604051610ec4380380610ec483398101604081905261002f9161009a565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c654d756c746963616c6c3a20696e76616c6964206f776e657200604482015260640160405180910390fd5b6001600160a01b03166080526100ca565b6000602082840312156100ac57600080fd5b81516001600160a01b03811681146100c357600080fd5b9392505050565b608051610dd26100f26000396000818160f70152818161017601526103a60152610dd26000f3fe60806040526004361061005e5760003560e01c8063839df94511610043578063839df945146100a55780638da5cb5b146100e5578063abe200321461013e57600080fd5b806365604f831461006a57806374c00f9f1461007f57600080fd5b3661006557005b600080fd5b61007d6100783660046108b0565b61015e565b005b61009261008d3660046108f2565b610218565b6040519081526020015b60405180910390f35b3480156100b157600080fd5b506100d56100c036600461093e565b60006020819052908152604090205460ff1681565b604051901515815260200161009c565b3480156100f157600080fd5b506101197f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161009c565b34801561014a57600080fd5b5061007d61015936600461093e565b61038e565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610202576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61021461020f82846109fe565b61052d565b5050565b60008082858560405160200161022f929190610b34565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261026b9291602001610cb1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152815160209283012060008181529283905291205490915060ff16610319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4943413a20496e76616c69642052657665616c0000000000000000000000000060448201526064016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551919250829182917fd51d38a373f01d7ff784e6983dc84e96dc02bedcf7705b292eebc427255e0ca591a261038661020f85876109fe565b509392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064016101f9565b60008181526020819052604090205460ff16156104cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4943413a2050726576696f757320636f6d6d69746d656e742070656e64696e6760448201527f20657865637574696f6e0000000000000000000000000000000000000000000060648201526084016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f3f09b472466bcbbb9c7336754868e482b43fabaa73806dcbf50079f2a68d0ec591a250565b80516000905b808210156105695761055d83838151811061055057610550610cd7565b602002602001015161056e565b50816001019150610533565b505050565b606061058f6105808360000151610595565b8360400151846020015161063e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82111561063a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f770000000000000000000000000000000000000000000000000000000060648201526084016101f9565b5090565b6060610664848484604051806060016040528060298152602001610d746029913961066c565b949350505050565b6060824710156106fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101f9565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516107279190610d06565b60006040518083038185875af1925050503d8060008114610764576040519150601f19603f3d011682016040523d82523d6000602084013e610769565b606091505b509150915061077a87838387610785565b979650505050505050565b6060831561081b5782516000036108145773ffffffffffffffffffffffffffffffffffffffff85163b610814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f9565b5081610664565b61066483838151156108305781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f99190610d22565b60008083601f84011261087657600080fd5b50813567ffffffffffffffff81111561088e57600080fd5b6020830191508360208260051b85010111156108a957600080fd5b9250929050565b600080602083850312156108c357600080fd5b823567ffffffffffffffff8111156108da57600080fd5b6108e685828601610864565b90969095509350505050565b60008060006040848603121561090757600080fd5b833567ffffffffffffffff81111561091e57600080fd5b61092a86828701610864565b909790965060209590950135949350505050565b60006020828403121561095057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156109a9576109a9610957565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156109f6576109f6610957565b604052919050565b600067ffffffffffffffff80841115610a1957610a19610957565b8360051b6020610a2a8183016109af565b868152918501918181019036841115610a4257600080fd5b865b84811015610b2857803586811115610a5c5760008081fd5b88016060368290031215610a705760008081fd5b610a78610986565b81358152858201358682015260408083013589811115610a985760008081fd5b9290920191601f3681850112610aae5760008081fd5b83358a811115610ac057610ac0610957565b610aef897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084840116016109af565b91508082523689828701011115610b065760008081fd5b808986018a840137600090820189015290820152845250918301918301610a44565b50979650505050505050565b60208082528181018390526000906040808401600586901b8501820187855b88811015610c7f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b3603018112610bb457600080fd5b8a01803584528681013587850152606086820135368390037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1018112610bf957600080fd5b90910187810191903567ffffffffffffffff811115610c1757600080fd5b803603831315610c2657600080fd5b8188870152808287015260809150808383880137600086820183015295880195601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909401909301925090850190600101610b53565b509098975050505050505050565b60005b83811015610ca8578181015183820152602001610c90565b50506000910152565b82815260008251610cc9816020850160208701610c8d565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008251610d18818460208701610c8d565b9190910192915050565b6020815260008251806020840152610d41816040850160208701610c8d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a264697066735822122069b7ef2511abdbdd988d031b0ff798c7dee23caf54428aadf16b214523d516ae64736f6c634300081600330000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000000000000000000000000000000000000000c35000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005868747470733a2f2f6f6666636861696e2d6c6f6f6b75702e73657276696365732e68797065726c616e652e78797a2f63616c6c436f6d6d69746d656e74732f67657443616c6c7346726f6d52657665616c4d6573736167650000000000000000
Deployed Bytecode
0x6080604052600436106200036f5760003560e01c8063802d061611620001c7578063b918ebab11620000ff578063e9d3cdab11620000a1578063efae508a1162000078578063efae508a1462000a92578063f2ed8c531462000ab7578063f2fde38b1462000adc578063f7e83aee1462000b0157600080fd5b8063e9d3cdab1462000a3f578063eab4eaa41462000a56578063ef96bb4b1462000a6d57600080fd5b8063de523cf311620000d6578063de523cf314620009ee578063e36da6431462000a03578063e9198bf91462000a1a57600080fd5b8063b918ebab146200096b578063d5438eae14620009a1578063dd91cc8714620009d757600080fd5b8063940c14dd1162000169578063a5da36111162000140578063a5da361114620008fc578063a69297931462000921578063b49c53a7146200094657600080fd5b8063940c14dd146200089b5780639662e8ac14620008c0578063a53e921014620008e557600080fd5b80638e45f8fc116200019e5780638e45f8fc14620007f75780638f8625aa146200081c57806393c44847146200084157600080fd5b8063802d061614620007675780638d3638f4146200077e5780638da5cb5b14620007ca57600080fd5b8063420c6a2c11620002a75780636465e69f1162000249578063715018a61162000220578063715018a614620006c557806371a15b3814620006dd5780637f18ee9a14620007025780637f5a7c7b146200073857600080fd5b80636465e69f146200065157806367cb7dce146200067b5780636e0a1a6a14620006a057600080fd5b806356d5d475116200027e57806356d5d47514620005d35780635a007b7e14620005ea5780635c60da1b146200061b57600080fd5b8063420c6a2c1462000551578063440df4f4146200058757806347f65ed114620005ae57600080fd5b806315ce45a211620003115780632ead72f611620002e85780632ead72f614620004da578063361522a214620004ff5780633dfd3873146200052c57600080fd5b806315ce45a214620004795780631bbdef97146200049e5780631f3dbe0d14620004c357600080fd5b806309de307d116200034657806309de307d14620003e45780630e258285146200042f5780630e72cc06146200045457600080fd5b8063056294d1146200037c578063061197d514620003a657806309643ff714620003bd57600080fd5b366200037757005b600080fd5b620003936200038d3660046200310e565b62000b37565b6040519081526020015b60405180910390f35b62000393620003b7366004620031ae565b62000b79565b348015620003ca57600080fd5b50620003e2620003dc3660046200321c565b62000ba8565b005b348015620003f157600080fd5b50620004096200040336600462003275565b62000bc4565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016200039d565b3480156200043c57600080fd5b50620004096200044e366004620032cd565b62000d4a565b3480156200046157600080fd5b50620003e26200047336600462003309565b62000d62565b3480156200048657600080fd5b5062000409620004983660046200336e565b62000eb0565b348015620004ab57600080fd5b5062000409620004bd366004620033b4565b6200102d565b62000393620004d436600462003409565b620010c3565b348015620004e757600080fd5b5062000393620004f93660046200348c565b620010fa565b6200051662000510366004620034aa565b6200111b565b604080519283526020830191909152016200039d565b3480156200053957600080fd5b50620003e26200054b36600462003309565b62001226565b3480156200055e57600080fd5b50620003937f55dde7004684ce8d441e9bec358c34753a363b36ec3295f0f4f87f290cf715ce81565b3480156200059457600080fd5b506200059f6200136d565b6040516200039d919062003543565b348015620005bb57600080fd5b5062000409620005cd3660046200358f565b62001380565b620003e2620005e4366004620035d3565b620013d3565b348015620005f757600080fd5b5062000393620006093660046200348c565b60ca6020526000908152604090205481565b3480156200062857600080fd5b50620004097f000000000000000000000000758068c0925b9ae16f0f857a88fb34b0f0d3040881565b3480156200065e57600080fd5b5062000668600181565b60405160ff90911681526020016200039d565b3480156200068857600080fd5b50620003936200069a36600462003633565b62001647565b348015620006ad57600080fd5b5062000409620006bf366004620033b4565b620016c1565b348015620006d257600080fd5b50620003e2620017d1565b348015620006ea57600080fd5b50620003e2620006fc36600462003660565b620017e9565b3480156200070f57600080fd5b50620004097f000000000000000000000000e759633fc86703429006004c83226afe11b0ab7d81565b3480156200074557600080fd5b50606554620004099073ffffffffffffffffffffffffffffffffffffffff1681565b62000516620007783660046200321c565b6200184b565b3480156200078b57600080fd5b50620007b47f00000000000000000000000000000000000000000000000000000000000b67d281565b60405163ffffffff90911681526020016200039d565b348015620007d757600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff1662000409565b3480156200080457600080fd5b5062000409620008163660046200369a565b620018d6565b3480156200082957600080fd5b50620003e26200083b366004620036fd565b6200191d565b3480156200084e57600080fd5b506200088c6040518060400160405280600681526020017f372e312e3130000000000000000000000000000000000000000000000000000081525081565b6040516200039d919062003813565b348015620008a857600080fd5b5062000409620008ba36600462003828565b62001a2a565b348015620008cd57600080fd5b5062000409620008df3660046200369a565b62001a3b565b62000516620008f63660046200386a565b62001a77565b3480156200090957600080fd5b50620004096200091b36600462003828565b62001a9c565b3480156200092e57600080fd5b50620003936200094036600462003633565b62001aad565b3480156200095357600080fd5b50620003e26200096536600462003633565b62001acf565b3480156200097857600080fd5b50620003937f000000000000000000000000000000000000000000000000000000000000c35081565b348015620009ae57600080fd5b50620004097f0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e81565b62000393620009e8366004620038fa565b62001ae9565b348015620009fb57600080fd5b503062000409565b6200039362000a1436600462003953565b62001b08565b34801562000a2757600080fd5b50620003e262000a39366004620039c9565b62001b2a565b6200039362000a5036600462003a30565b62001c1b565b6200039362000a6736600462003ae6565b62001c99565b34801562000a7a57600080fd5b506200040962000a8c36600462003b7b565b62001cac565b34801562000a9f57600080fd5b50620003e262000ab13660046200348c565b62001cbc565b34801562000ac457600080fd5b506200039362000ad63660046200348c565b62001cd4565b34801562000ae957600080fd5b50620003e262000afb36600462003309565b62001d17565b34801562000b0e57600080fd5b5062000b2662000b2036600462003bcd565b62001dd1565b60405190151581526020016200039d565b600062000b6d88888888888888606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1662001c1b565b98975050505050505050565b600062000b9e8686868686604051806020016040528060008152506000801b62000b37565b9695505050505050565b62000bb262001e65565b62000bbf83838362001ee8565b505050565b600073ffffffffffffffffffffffffffffffffffffffff841662000c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6e6f20726f757465722073706563696669656420666f722064657374696e617460448201527f696f6e000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600062000c8f8162000c818762001fbc565b805190602001208762002074565b9050600062000c9e826200209e565b604080517f00000000000000000000000000000000000000000000000000000000000b67d260e01b7fffffffff000000000000000000000000000000000000000000000000000000001660208083019190915273ffffffffffffffffffffffffffffffffffffffff8b811660248401523060448401528916606483015260848083018990528351808403909101815260a4909201909252805191012090915062000b6d81838962002074565b600062000d5983838362001380565b90505b92915050565b8073ffffffffffffffffffffffffffffffffffffffff81163b15158062000d9d575073ffffffffffffffffffffffffffffffffffffffff8116155b62000e2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e6700000000000000000000000000000000000000000000000000606482015260840162000c66565b62000e3562001e65565b606680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527fc47cbcc588c67679e52261c45cc315e56562f8d0ccaba16facb9093ff9498799906020015b60405180910390a15050565b600036600062000ec18585620020b9565b91509150600062000ed38383620020d7565b90506000600282600281111562000eee5762000eee62003c34565b0362000f5a5762000f0a62000f0485856200210d565b6200212a565b905073ffffffffffffffffffffffffffffffffffffffff81161562000f30578062000f52565b7f000000000000000000000000e759633fc86703429006004c83226afe11b0ab7d5b905062000b9e565b62000f6a62000f048585620021d5565b905073ffffffffffffffffffffffffffffffffffffffff81161562000f90578062001022565b7f0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e73ffffffffffffffffffffffffffffffffffffffff16636e5f516e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ffc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001022919062003c63565b979650505050505050565b600062000b9e620010bd87878773ffffffffffffffffffffffffffffffffffffffff88165b6040805160e09590951b7fffffffff000000000000000000000000000000000000000000000000000000001660208087019190915260248601949094526044850192909252606484015260848084018890528151808503909101815260a49093019052815191012090565b620021e7565b600080620010d186620010fa565b63ffffffff8716600090815260ca60205260409020549091506200102287838389898962001c99565b60008062001113609763ffffffff808616906200221516565b949350505050565b600080806200112d338a868862002224565b604080518c8152602081018c9052908101879052909150339063ffffffff8d16907fa82f02bdb198e6cca80598e390600aa519d0f9efca0322efa45096af14fa20879060600160405180910390a360405184907f2a1e0d9efb303f9faca2f4484ea37adc72e0e9bee4e0def3d691e302a831926090600090a2620011f38b8b83620011eb60007f000000000000000000000000000000000000000000000000000000000000c35030604051806020016040528060008152506200225b565b8a3462002279565b92506000620012038986620023ce565b9050620012158c8c838b8b4762002279565b925050509850989650505050505050565b8073ffffffffffffffffffffffffffffffffffffffff81163b15158062001261575073ffffffffffffffffffffffffffffffffffffffff8116155b620012ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e6700000000000000000000000000000000000000000000000000606482015260840162000c66565b620012f962001e65565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527f4eab7b127c764308788622363ad3e9532de3dfba7845bd4f84c125a22544255a9060200162000ea4565b60606200137b6097620023ff565b905090565b6000806200139262000f0486620010fa565b63ffffffff8616600090815260ca602052604081205491925090620013b7906200212a565b9050620013c78583838762000bc4565b925050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e16146200149a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4d61696c626f78436c69656e743a2073656e646572206e6f74206d61696c626f60448201527f7800000000000000000000000000000000000000000000000000000000000000606482015260840162000c66565b6000620014a88383620020d7565b90506002816002811115620014c157620014c162003c34565b03620014ce575062001641565b6000620014dc84846200210d565b90506000620014ec8585620024be565b90506000620014fc8686620021d5565b905060006200151989858a62001512866200212a565b87620016c1565b9050600085600281111562001532576200153262003c34565b03620015bf576000620015468888620024d0565b90508173ffffffffffffffffffffffffffffffffffffffff166365604f8334836040518363ffffffff1660e01b815260040162001584919062003c83565b6000604051808303818588803b1580156200159e57600080fd5b505af1158015620015b3573d6000803e3d6000fd5b5050505050506200163b565b8073ffffffffffffffffffffffffffffffffffffffff1663abe20032620015e78989620024f0565b6040518263ffffffff1660e01b81526004016200160691815260200190565b600060405180830381600087803b1580156200162157600080fd5b505af115801562001636573d6000803e3d6000fd5b505050505b50505050505b50505050565b600062001655838362001aad565b604080516000815260208101909152620016b5908590620016967f000000000000000000000000000000000000000000000000000000000000c35062002501565b60655473ffffffffffffffffffffffffffffffffffffffff1662002521565b62000d59919062003d55565b600080620016e887878773ffffffffffffffffffffffffffffffffffffffff881662001052565b90506000620016f782620021e7565b905073ffffffffffffffffffffffffffffffffffffffff81163b62001022576000620017437f000000000000000000000000758068c0925b9ae16f0f857a88fb34b0f0d30408620025f2565b9050620017536000848362002677565b6040805163ffffffff8c168152602081018a90529081018a905273ffffffffffffffffffffffffffffffffffffffff888116606083015260808201889052919350908316907f43c7c79901faab5ae18ac2369d6df969a28064bd40483d341f0dc439cb095d969060a00160405180910390a250979650505050505050565b620017db62001e65565b620017e76000620027dc565b565b620017f362001e65565b8060005b8181101562001641576200183684848381811062001819576200181962003d6b565b90506020020160208101906200183091906200348c565b62002853565b6200184360018262003d55565b9050620017f7565b60008060006200185b86620010fa565b63ffffffff8716600090815260ca6020908152604080832054815192830190915282825292935062001893908290889033906200225b565b606554909150620018c790899085908590600090869073ffffffffffffffffffffffffffffffffffffffff16828e6200111b565b94509450505050935093915050565b6000620019148573ffffffffffffffffffffffffffffffffffffffff861673ffffffffffffffffffffffffffffffffffffffff8616856000620016c1565b95945050505050565b6200192762001e65565b84831480156200193657508481145b6200199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6c656e677468206d69736d617463680000000000000000000000000000000000604482015260640162000c66565b60005b8581101562001a215762001a18878783818110620019c357620019c362003d6b565b9050602002016020810190620019da91906200348c565b868684818110620019ef57620019ef62003d6b565b9050602002013585858581811062001a0b5762001a0b62003d6b565b9050602002013562001ee8565b600101620019a1565b50505050505050565b6000620019148585858585620016c1565b6000620019148573ffffffffffffffffffffffffffffffffffffffff861673ffffffffffffffffffffffffffffffffffffffff86168562001a9c565b60008062001a8c898989848a8a8a8a6200111b565b9150915097509795505050505050565b60006200191485858585856200102d565b6040805160008082526020820190925262000d59908490620016968562002501565b62001ad962001e65565b62001ae58282620028af565b5050565b60006200111384848460405180602001604052806000815250620010c3565b6000620010228787878787604051806020016040528060008152508862000b37565b62001b3462001e65565b82811462001b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f216c656e67746800000000000000000000000000000000000000000000000000604482015260640162000c66565b8260005b8181101562001c135762001bfe86868381811062001bc55762001bc562003d6b565b905060200201602081019062001bdc91906200348c565b85858481811062001bf15762001bf162003d6b565b90506020020135620028af565b62001c0b60018262003d55565b905062001ba3565b505050505050565b6040805188815260208101889052908101839052600090339063ffffffff8b16907fa82f02bdb198e6cca80598e390600aa519d0f9efca0322efa45096af14fa20879060600160405180910390a3600062001c7a3389898988620028bd565b905062001c8b8a8a838887620028e4565b9a9950505050505050505050565b6000620010228787878787878762000b37565b6000620011138484848462000bc4565b62001cc662001e65565b62001cd18162002853565b50565b60408051602080820183526000808352835191820190935282815260655462000d5c928592909173ffffffffffffffffffffffffffffffffffffffff1662002521565b62001d2162001e65565b73ffffffffffffffffffffffffffffffffffffffff811662001dc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840162000c66565b62001cd181620027dc565b600062001ddf838362000eb0565b73ffffffffffffffffffffffffffffffffffffffff1663f7e83aee868686866040518563ffffffff1660e01b815260040162001e1f949392919062003de3565b6020604051808303816000875af115801562001e3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001914919062003e0e565b60335473ffffffffffffffffffffffffffffffffffffffff163314620017e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000c66565b600062001ef584620010fa565b14801562001f16575063ffffffff8316600090815260ca6020526040902054155b62001fa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f726f7574657220616e642049534d2064656661756c74732061726520696d6d7560448201527f7461626c65206f6e636520736574000000000000000000000000000000000000606482015260840162000c66565b62001fb08383620028f6565b62000bbf83826200290e565b60606040518060200162001fd09062002f5c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff8516602083015201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526200205e929160200162003e32565b6040516020818303038152906040529050919050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6000620020ab82620025f2565b805190602001209050919050565b366000620020cb83604d818762003e65565b915091505b9250929050565b600082826000818110620020ef57620020ef62003d6b565b919091013560f81c9050600281111562000d595762000d5962003c34565b60006200211f60216001848662003e65565b62000d599162003e91565b600073ffffffffffffffffffffffffffffffffffffffff821115620021d1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f7700000000000000000000000000000000000000000000000000000000606482015260840162000c66565b5090565b60006200211f60416021848662003e65565b600062000d5c827f55dde7004684ce8d441e9bec358c34753a363b36ec3295f0f4f87f290cf715ce62002965565b600080620020cb848462002974565b60606001858584866040516020016200224295949392919062003f0d565b6040516020818303038152906040529050949350505050565b60606001858585856040516020016200224295949392919062003f3b565b6000856200230a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6e6f20726f757465722073706563696669656420666f722064657374696e617460448201527f696f6e0000000000000000000000000000000000000000000000000000000000606482015260840162000c66565b6040517f10b83dc000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e16906310b83dc090849062002388908b908b908b908b908b9060040162003fc2565b60206040518083038185885af1158015620023a7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062001022919062004026565b606060028383604051602001620023e89392919062004040565b604051602081830303815290604052905092915050565b606060006200240e83620029b3565b9050805167ffffffffffffffff8111156200242d576200242d62002fcc565b60405190808252806020026020018201604052801562002457578160200160208202803683370190505b50915060005b8151811015620024b7578181815181106200247c576200247c62003d6b565b602002602001015183828151811062002499576200249962003d6b565b63ffffffff909216602092830291909101909101526001016200245d565b5050919050565b60006200211f60616041848662003e65565b6060620024e1826061818662003e65565b81019062000d59919062004061565b60006200211f826061818662003e65565b606062000d5c60008333604051806020016040528060008152506200225b565b6000806200252f8662002a51565b6040517f81d2ea9500000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e16906381d2ea9590620025ae90899085908a908a908a9060040162003fc2565b602060405180830381865afa158015620025cc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b9e919062004026565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000006020820152606082811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660348301527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006048830152906057016200205e565b600083471015620026e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015260640162000c66565b815160000362002752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015260640162000c66565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116620013cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015260640162000c66565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62002869609763ffffffff8084169062002abd16565b620028748262002acb565b9062001ae5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c66919062003813565b62001ae58282600062001ee8565b606062000b9e73ffffffffffffffffffffffffffffffffffffffff87168686868662002af0565b600062000b9e86868686863462002279565b62001ae5609763ffffffff80851690849062002b7716565b63ffffffff8216600081815260ca602052604090819020839055517fba9685b280b1e8f64909e2dfd7465463e6a0eabbaafd732402e7a619699a382190620029599084815260200190565b60405180910390a25050565b600062000d5983833062002074565b6000818152600283016020526040812054819080620029a75762002999858562002b84565b925060009150620020d09050565b600192509050620020d0565b60606000620029c28362002b92565b90508067ffffffffffffffff811115620029e057620029e062002fcc565b60405190808252806020026020018201604052801562002a0a578160200160208202803683370190505b50915060005b81811015620024b75762002a25848262002b9f565b60001c83828151811062002a3d5762002a3d62003d6b565b602090810291909101015260010162002a10565b6000808062002a6b609763ffffffff808716906200221516565b91509150811562002a7d579392505050565b62002a888462002acb565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c66919062003813565b600062000d59838362002bad565b606062002ade8263ffffffff1662002bcc565b6040516020016200205e91906200419c565b606060008087878560405160200162002b0d9493929190620041e3565b60405160208183030381529060405290506000858560405160200162002b359291906200420c565b6040516020818303038152906040529050818160405160200162002b5b92919062003e32565b6040516020818303038152906040529250505095945050505050565b6200164183838362002c91565b600062000d59838362002cb0565b600062000d5c8262002cc9565b600062000d59838362002cd4565b6000818152600283016020526040812081905562000d59838362002d01565b6060600062002bdb8362002d0f565b600101905060008167ffffffffffffffff81111562002bfe5762002bfe62002fcc565b6040519080825280601f01601f19166020018201604052801562002c29576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508462002c3357509392505050565b6000828152600284016020526040812082905562001113848462002df8565b6000818152600183016020526040812054151562000d59565b600062000d5c825490565b600082600001828154811062002cee5762002cee62003d6b565b9060005260206000200154905092915050565b600062000d59838362002e06565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062002d59577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062002d86576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831062002da557662386f26fc10000830492506010015b6305f5e100831062002dbe576305f5e100830492506008015b612710831062002dd357612710830492506004015b6064831062002de6576064830492506002015b600a831062000d5c5760010192915050565b600062000d59838362002f0a565b6000818152600183016020526040812054801562002eff57600062002e2d6001836200432d565b855490915060009062002e43906001906200432d565b905081811462002eaf57600086600001828154811062002e675762002e6762003d6b565b906000526020600020015490508087600001848154811062002e8d5762002e8d62003d6b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062002ec35762002ec362004343565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000d5c565b600091505062000d5c565b600081815260018301602052604081205462002f535750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000d5c565b50600062000d5c565b610ec4806200437383390190565b803563ffffffff8116811462002f7f57600080fd5b919050565b60008083601f84011262002f9757600080fd5b50813567ffffffffffffffff81111562002fb057600080fd5b6020830191508360208260051b8501011115620020d057600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171562003021576200302162002fcc565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562003071576200307162002fcc565b604052919050565b600082601f8301126200308b57600080fd5b813567ffffffffffffffff811115620030a857620030a862002fcc565b620030db60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160162003027565b818152846020838601011115620030f157600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156200312a57600080fd5b620031358862002f6a565b96506020880135955060408801359450606088013567ffffffffffffffff808211156200316157600080fd5b6200316f8b838c0162002f84565b909650945060808a01359150808211156200318957600080fd5b50620031988a828b0162003079565b92505060a0880135905092959891949750929550565b600080600080600060808688031215620031c757600080fd5b620031d28662002f6a565b94506020860135935060408601359250606086013567ffffffffffffffff811115620031fd57600080fd5b6200320b8882890162002f84565b969995985093965092949392505050565b6000806000606084860312156200323257600080fd5b6200323d8462002f6a565b95602085013595506040909401359392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811462001cd157600080fd5b600080600080608085870312156200328c57600080fd5b8435620032998162003252565b93506020850135620032ab8162003252565b92506040850135620032bd8162003252565b9396929550929360600135925050565b60008060408385031215620032e157600080fd5b620032ec8362002f6a565b91506020830135620032fe8162003252565b809150509250929050565b6000602082840312156200331c57600080fd5b8135620013cc8162003252565b60008083601f8401126200333c57600080fd5b50813567ffffffffffffffff8111156200335557600080fd5b602083019150836020828501011115620020d057600080fd5b600080602083850312156200338257600080fd5b823567ffffffffffffffff8111156200339a57600080fd5b620033a88582860162003329565b90969095509350505050565b600080600080600060a08688031215620033cd57600080fd5b620033d88662002f6a565b945060208601359350604086013592506060860135620033f88162003252565b949793965091946080013592915050565b600080600080606085870312156200342057600080fd5b6200342b8562002f6a565b9350602085013567ffffffffffffffff808211156200344957600080fd5b620034578883890162002f84565b909550935060408701359150808211156200347157600080fd5b50620034808782880162003079565b91505092959194509250565b6000602082840312156200349f57600080fd5b62000d598262002f6a565b600080600080600080600080610100898b031215620034c857600080fd5b620034d38962002f6a565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8111156200350557600080fd5b620035138b828c0162003079565b94505060a0890135620035268162003252565b979a969950949793969295929450505060c08201359160e0013590565b6020808252825182820181905260009190848201906040850190845b818110156200358357835163ffffffff16835292840192918401916001016200355f565b50909695505050505050565b600080600060608486031215620035a557600080fd5b620035b08462002f6a565b92506020840135620035c28162003252565b929592945050506040919091013590565b60008060008060608587031215620035ea57600080fd5b620035f58562002f6a565b935060208501359250604085013567ffffffffffffffff8111156200361957600080fd5b620036278782880162003329565b95989497509550505050565b600080604083850312156200364757600080fd5b620036528362002f6a565b946020939093013593505050565b600080602083850312156200367457600080fd5b823567ffffffffffffffff8111156200368c57600080fd5b620033a88582860162002f84565b60008060008060808587031215620036b157600080fd5b620036bc8562002f6a565b93506020850135620036ce8162003252565b92506040850135620036e08162003252565b91506060850135620036f28162003252565b939692955090935050565b600080600080600080606087890312156200371757600080fd5b863567ffffffffffffffff808211156200373057600080fd5b6200373e8a838b0162002f84565b909850965060208901359150808211156200375857600080fd5b620037668a838b0162002f84565b909650945060408901359150808211156200378057600080fd5b506200378f89828a0162002f84565b979a9699509497509295939492505050565b60005b83811015620037be578181015183820152602001620037a4565b50506000910152565b60008151808452620037e1816020860160208601620037a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600062000d596020830184620037c7565b600080600080608085870312156200383f57600080fd5b6200384a8562002f6a565b935060208501359250604085013591506060850135620036f28162003252565b600080600080600080600060e0888a0312156200388657600080fd5b620038918862002f6a565b96506020880135955060408801359450606088013567ffffffffffffffff811115620038bc57600080fd5b620038ca8a828b0162003079565b9450506080880135620038dd8162003252565b9699959850939692959460a0840135945060c09093013592915050565b6000806000604084860312156200391057600080fd5b6200391b8462002f6a565b9250602084013567ffffffffffffffff8111156200393857600080fd5b620039468682870162002f84565b9497909650939450505050565b60008060008060008060a087890312156200396d57600080fd5b620039788762002f6a565b95506020870135945060408701359350606087013567ffffffffffffffff811115620039a357600080fd5b620039b189828a0162002f84565b979a9699509497949695608090950135949350505050565b60008060008060408587031215620039e057600080fd5b843567ffffffffffffffff80821115620039f957600080fd5b62003a078883890162002f84565b9096509450602087013591508082111562003a2157600080fd5b50620036278782880162002f84565b60008060008060008060008060e0898b03121562003a4d57600080fd5b62003a588962002f6a565b97506020890135965060408901359550606089013567ffffffffffffffff8082111562003a8457600080fd5b62003a928c838d0162002f84565b909750955060808b013591508082111562003aac57600080fd5b5062003abb8b828c0162003079565b93505060a0890135915060c089013562003ad58162003252565b809150509295985092959890939650565b60008060008060008060a0878903121562003b0057600080fd5b62003b0b8762002f6a565b95506020870135945060408701359350606087013567ffffffffffffffff8082111562003b3757600080fd5b62003b458a838b0162002f84565b9095509350608089013591508082111562003b5f57600080fd5b5062003b6e89828a0162003079565b9150509295509295509295565b60008060006060848603121562003b9157600080fd5b833562003b9e8162003252565b9250602084013562003bb08162003252565b9150604084013562003bc28162003252565b809150509250925092565b6000806000806040858703121562003be457600080fd5b843567ffffffffffffffff8082111562003bfd57600080fd5b62003c0b8883890162003329565b9096509450602087013591508082111562003c2557600080fd5b50620036278782880162003329565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006020828403121562003c7657600080fd5b8151620013cc8162003252565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101562003d18578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805184528781015188850152860151606087850181905262003d0381860183620037c7565b96890196945050509086019060010162003cac565b509098975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111562000d5c5762000d5c62003d26565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60408152600062003df960408301868862003d9a565b82810360208401526200102281858762003d9a565b60006020828403121562003e2157600080fd5b81518015158114620013cc57600080fd5b6000835162003e46818460208801620037a1565b83519083019062003e5c818360208801620037a1565b01949350505050565b6000808585111562003e7657600080fd5b8386111562003e8457600080fd5b5050820193919092039150565b8035602083101562000d5c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b6003811062003f06577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60f81b9052565b62003f19818762003ece565b6001810194909452602184019290925260418301526061820152608101919050565b7fffff0000000000000000000000000000000000000000000000000000000000008660f01b1681528460028201528360228201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1660428201526000825162003fb1816056850160208701620037a1565b919091016056019695505050505050565b63ffffffff8616815284602082015260a06040820152600062003fe960a0830186620037c7565b828103606084015262003ffd8186620037c7565b91505073ffffffffffffffffffffffffffffffffffffffff831660808301529695505050505050565b6000602082840312156200403957600080fd5b5051919050565b6200404c818562003ece565b60018101929092526021820152604101919050565b600060208083850312156200407557600080fd5b823567ffffffffffffffff808211156200408e57600080fd5b818501915085601f830112620040a357600080fd5b813581811115620040b857620040b862002fcc565b8060051b620040c985820162003027565b9182528381018501918581019089841115620040e457600080fd5b86860192505b838310156200418f57823585811115620041045760008081fd5b86016060818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018113156200413b5760008081fd5b6200414562002ffb565b828a01358152604080840135828c0152918301359188831115620041695760008081fd5b620041798e8c8587010162003079565b90820152845250509186019190860190620040ea565b9998505050505050505050565b7f4e6f20726f7574657220656e726f6c6c656420666f7220646f6d61696e3a2000815260008251620041d681601f850160208701620037a1565b91909101601f0192915050565b620041ef818662003ece565b600181019390935260218301919091526041820152606101919050565b60208082528181018390526000906040808401600586901b8501820187855b8881101562003d18577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b36030181126200428e57600080fd5b8a01803584528681013587850152606086820135368390037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1018112620042d457600080fd5b90910187810191903567ffffffffffffffff811115620042f357600080fd5b8036038313156200430357600080fd5b818887015262004317828701828562003d9a565b968901969550505091860191506001016200422b565b8181038181111562000d5c5762000d5c62003d26565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe60a060405234801561001057600080fd5b50604051610ec4380380610ec483398101604081905261002f9161009a565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c654d756c746963616c6c3a20696e76616c6964206f776e657200604482015260640160405180910390fd5b6001600160a01b03166080526100ca565b6000602082840312156100ac57600080fd5b81516001600160a01b03811681146100c357600080fd5b9392505050565b608051610dd26100f26000396000818160f70152818161017601526103a60152610dd26000f3fe60806040526004361061005e5760003560e01c8063839df94511610043578063839df945146100a55780638da5cb5b146100e5578063abe200321461013e57600080fd5b806365604f831461006a57806374c00f9f1461007f57600080fd5b3661006557005b600080fd5b61007d6100783660046108b0565b61015e565b005b61009261008d3660046108f2565b610218565b6040519081526020015b60405180910390f35b3480156100b157600080fd5b506100d56100c036600461093e565b60006020819052908152604090205460ff1681565b604051901515815260200161009c565b3480156100f157600080fd5b506101197f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161009c565b34801561014a57600080fd5b5061007d61015936600461093e565b61038e565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610202576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61021461020f82846109fe565b61052d565b5050565b60008082858560405160200161022f929190610b34565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261026b9291602001610cb1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152815160209283012060008181529283905291205490915060ff16610319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4943413a20496e76616c69642052657665616c0000000000000000000000000060448201526064016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551919250829182917fd51d38a373f01d7ff784e6983dc84e96dc02bedcf7705b292eebc427255e0ca591a261038661020f85876109fe565b509392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e6572000000000000000000000000000000000000000000000000000060448201526064016101f9565b60008181526020819052604090205460ff16156104cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4943413a2050726576696f757320636f6d6d69746d656e742070656e64696e6760448201527f20657865637574696f6e0000000000000000000000000000000000000000000060648201526084016101f9565b60008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f3f09b472466bcbbb9c7336754868e482b43fabaa73806dcbf50079f2a68d0ec591a250565b80516000905b808210156105695761055d83838151811061055057610550610cd7565b602002602001015161056e565b50816001019150610533565b505050565b606061058f6105808360000151610595565b8360400151846020015161063e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82111561063a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f770000000000000000000000000000000000000000000000000000000060648201526084016101f9565b5090565b6060610664848484604051806060016040528060298152602001610d746029913961066c565b949350505050565b6060824710156106fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101f9565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516107279190610d06565b60006040518083038185875af1925050503d8060008114610764576040519150601f19603f3d011682016040523d82523d6000602084013e610769565b606091505b509150915061077a87838387610785565b979650505050505050565b6060831561081b5782516000036108145773ffffffffffffffffffffffffffffffffffffffff85163b610814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f9565b5081610664565b61066483838151156108305781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f99190610d22565b60008083601f84011261087657600080fd5b50813567ffffffffffffffff81111561088e57600080fd5b6020830191508360208260051b85010111156108a957600080fd5b9250929050565b600080602083850312156108c357600080fd5b823567ffffffffffffffff8111156108da57600080fd5b6108e685828601610864565b90969095509350505050565b60008060006040848603121561090757600080fd5b833567ffffffffffffffff81111561091e57600080fd5b61092a86828701610864565b909790965060209590950135949350505050565b60006020828403121561095057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156109a9576109a9610957565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156109f6576109f6610957565b604052919050565b600067ffffffffffffffff80841115610a1957610a19610957565b8360051b6020610a2a8183016109af565b868152918501918181019036841115610a4257600080fd5b865b84811015610b2857803586811115610a5c5760008081fd5b88016060368290031215610a705760008081fd5b610a78610986565b81358152858201358682015260408083013589811115610a985760008081fd5b9290920191601f3681850112610aae5760008081fd5b83358a811115610ac057610ac0610957565b610aef897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084840116016109af565b91508082523689828701011115610b065760008081fd5b808986018a840137600090820189015290820152845250918301918301610a44565b50979650505050505050565b60208082528181018390526000906040808401600586901b8501820187855b88811015610c7f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b3603018112610bb457600080fd5b8a01803584528681013587850152606086820135368390037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1018112610bf957600080fd5b90910187810191903567ffffffffffffffff811115610c1757600080fd5b803603831315610c2657600080fd5b8188870152808287015260809150808383880137600086820183015295880195601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909401909301925090850190600101610b53565b509098975050505050505050565b60005b83811015610ca8578181015183820152602001610c90565b50506000910152565b82815260008251610cc9816020850160208701610c8d565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008251610d18818460208701610c8d565b9190910192915050565b6020815260008251806020840152610d41816040850160208701610c8d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a264697066735822122069b7ef2511abdbdd988d031b0ff798c7dee23caf54428aadf16b214523d516ae64736f6c63430008160033a2646970667358221220f8867c418c12665ad01ffa21edb6f8a532574e3720f958171319d39bb7901ff064736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000000000000000000000000000000000000000c35000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005868747470733a2f2f6f6666636861696e2d6c6f6f6b75702e73657276696365732e68797065726c616e652e78797a2f63616c6c436f6d6d69746d656e74732f67657443616c6c7346726f6d52657665616c4d6573736167650000000000000000
-----Decoded View---------------
Arg [0] : _mailbox (address): 0x3a464f746D23Ab22155710f44dB16dcA53e0775E
Arg [1] : _hook (address): 0x0000000000000000000000000000000000000000
Arg [2] : _owner (address): 0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba
Arg [3] : _commit_tx_gas_usage (uint256): 50000
Arg [4] : _commitment_urls (string[]): https://offchain-lookup.services.hyperlane.xyz/callCommitments/getCallsFromRevealMessage
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba
Arg [3] : 000000000000000000000000000000000000000000000000000000000000c350
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000058
Arg [8] : 68747470733a2f2f6f6666636861696e2d6c6f6f6b75702e7365727669636573
Arg [9] : 2e68797065726c616e652e78797a2f63616c6c436f6d6d69746d656e74732f67
Arg [10] : 657443616c6c7346726f6d52657665616c4d6573736167650000000000000000
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.