Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MainnetBridge
- Optimization enabled
- true
- Compiler version
- v0.8.30+commit.73712a01
- Optimization runs
- 200
- EVM Version
- prague
- Verified at
- 2026-06-24T02:46:37.013072Z
Constructor Arguments
0x000000000000000000000000a20182131658295f37c1a1efdbdc89eff97d9c580000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004779d18931b35540f84b0cd0e9633855b84df7b8
Arg [0] (address) : 0xa20182131658295f37c1a1efdbdc89eff97d9c58
Arg [1] (address) : 0x4e5099105ab4c73cf227abcdd0d5e1802ae936dc
Arg [2] (address) : 0x0000000000000000000000000000000000000000
Arg [3] (address) : 0x4779d18931b35540f84b0cd0e9633855b84df7b8
contracts/layer1/mainnet/MainnetBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "src/layer1/mainnet/LibFasterReentryLock.sol";
import "src/shared/bridge/Bridge.sol";
import "./MainnetBridge_Layout.sol"; // DO NOT DELETE
/// @title MainnetBridge
/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko
/// mainnet to reduce gas cost. In theory, the contract can also be deployed on Taiko L2 but this is
/// not well testee nor necessary.
/// @notice At genesis, this contract's initial balance is 999,999,600 Ether. Additionally, two
/// other addresses have non-zero balances:
/// - 0x69AA0361Dbb0527d4F1e5312403Bd41788fe61Fe holds 199 Ether
/// - 0x00000968bfe78aa27cd380d629d61c89bd6b03e8 holds 1 Ether
/// Together, these three accounts have a total premint Ether balance of 999,999,800 on Taiko
/// Alethia layer 2. Initially, the plan was to mint 1,000,000,000 Ether, but a minor error
/// occurred.
/// The combined balance of the L1 and L2 bridges must be no less than 999,999,800 Ether.
/// @notice See the documentation in {Bridge}.
/// @custom:security-contact security@taiko.xyz
contract MainnetBridge is Bridge {
/// @dev The slot in transient storage of the call context. This is the keccak256 hash
/// of "bridge.ctx_slot"
bytes32 private constant _CTX_SLOT =
0xe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2b9;
/// @notice Initializes the mainnet bridge's immutable state.
/// @param _resolver The address of the resolver contract.
/// @param _signalService The address of the signal service contract.
/// @param _quotaManager The address of the quota manager contract. Optional (may be zero).
/// @param _pauser Address authorized to pause/unpause alongside the owner, and to fund the
/// bridge via plain Ether transfers. Optional (may be zero, which disables direct funding).
constructor(
address _resolver,
address _signalService,
address _quotaManager,
address _pauser
)
Bridge(_resolver, _signalService, _quotaManager, _pauser)
{ }
function _storeReentryLock(uint8 _reentry) internal override {
LibFasterReentryLock.storeReentryLock(_reentry);
}
function _loadReentryLock() internal view override returns (uint8) {
return LibFasterReentryLock.loadReentryLock();
}
/// @inheritdoc Bridge
function _storeContext(
bytes32 _msgHash,
address _from,
uint64 _srcChainId
)
internal
override
{
assembly {
tstore(_CTX_SLOT, _msgHash)
tstore(add(_CTX_SLOT, 1), _from)
tstore(add(_CTX_SLOT, 2), _srcChainId)
}
}
/// @inheritdoc Bridge
function _loadContext() internal view override returns (Context memory) {
bytes32 msgHash;
address from;
uint64 srcChainId;
assembly {
msgHash := tload(_CTX_SLOT)
from := tload(add(_CTX_SLOT, 1))
srcChainId := tload(add(_CTX_SLOT, 2))
}
return Context(msgHash, from, srcChainId);
}
}
contracts/shared/common/IResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title IResolver
/// @notice This contract acts as a bridge for name-to-address resolution.
/// @custom:security-contact security@taiko.xyz
interface IResolver {
error RESOLVED_TO_ZERO_ADDRESS();
/// @notice Resolves a name to its address deployed on a specified chain.
/// @param _chainId The chainId of interest.
/// @param _name Name whose address is to be resolved.
/// @param _allowZeroAddress If set to true, does not throw if the resolved
/// address is `address(0)`.
/// @return Address associated with the given name on the specified
/// chain.
function resolve(
uint256 _chainId,
bytes32 _name,
bool _allowZeroAddress
)
external
view
returns (address);
}
contracts/layer1/mainnet/LibFasterReentryLock.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title LibFasterReentryLock
/// @custom:security-contact security@taiko.xyz
library LibFasterReentryLock {
/// @dev The slot in transient storage of the reentry lock.
/// This is the result of keccak256("ownerUUPS.reentry_slot") plus 1. The addition aims to
/// prevent hash collisions with slots defined in EIP-1967, where slots are derived by
/// keccak256("something") - 1, and with slots in SignalService, calculated directly with
/// keccak256("something").
bytes32 private constant _REENTRY_SLOT =
0xa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b;
function storeReentryLock(uint8 _reentry) internal {
assembly {
tstore(_REENTRY_SLOT, _reentry)
}
}
function loadReentryLock() internal view returns (uint8 reentry_) {
assembly {
reentry_ := tload(_REENTRY_SLOT)
}
}
}
contracts/layer1/mainnet/MainnetBridge_Layout.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
/// @title MainnetBridgeLayout
/// @notice Storage layout documentation for MainnetBridge
/// @dev This file is auto-generated by gen-layouts.sh. DO NOT EDIT MANUALLY.
/// @custom:security-contact security@taiko.xyz
// solhint-disable max-line-length
// _initialized | uint8 | Slot: 0 | Offset: 0 | Bytes: 1
// _initializing | bool | Slot: 0 | Offset: 1 | Bytes: 1
// __gap | uint256[50] | Slot: 1 | Offset: 0 | Bytes: 1600
// _owner | address | Slot: 51 | Offset: 0 | Bytes: 20
// __gap | uint256[49] | Slot: 52 | Offset: 0 | Bytes: 1568
// _pendingOwner | address | Slot: 101 | Offset: 0 | Bytes: 20
// __gap | uint256[49] | Slot: 102 | Offset: 0 | Bytes: 1568
// __gapFromOldAddressResolver | uint256[50] | Slot: 151 | Offset: 0 | Bytes: 1600
// __reentry | uint8 | Slot: 201 | Offset: 0 | Bytes: 1
// __paused | uint8 | Slot: 201 | Offset: 1 | Bytes: 1
// __gap | uint256[49] | Slot: 202 | Offset: 0 | Bytes: 1568
// __reserved1 | uint64 | Slot: 251 | Offset: 0 | Bytes: 8
// nextMessageId | uint64 | Slot: 251 | Offset: 8 | Bytes: 8
// messageStatus | mapping(bytes32 => enum IBridge.Status) | Slot: 252 | Offset: 0 | Bytes: 32
// __ctx | struct IBridge.Context | Slot: 253 | Offset: 0 | Bytes: 64
// __reserved2 | uint256 | Slot: 255 | Offset: 0 | Bytes: 32
// __reserved3 | uint256 | Slot: 256 | Offset: 0 | Bytes: 32
// __gap | uint256[44] | Slot: 257 | Offset: 0 | Bytes: 1408
contracts/shared/bridge/Bridge.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../common/EssentialResolverContract.sol";
import "../libs/LibAddress.sol";
import "../libs/LibMath.sol";
import "../libs/LibNames.sol";
import "../libs/LibNetwork.sol";
import "../signal/ISignalService.sol";
import "./IBridge.sol";
import "./IQuotaManager.sol";
import "./Bridge_Layout.sol"; // DO NOT DELETE
/// @title Bridge
/// @notice See the documentation for {IBridge}.
/// @dev Labeled in address resolver as "bridge". Additionally, the code hash for the same address
/// on L1 and L2 may be different.
/// @custom:security-contact security@taiko.xyz
contract Bridge is EssentialResolverContract, IBridge {
using LibMath for uint256;
using LibAddress for address;
struct ProcessingStats {
uint32 gasUsedInFeeCalc;
uint32 proofSize;
uint32 numCacheOps;
bool processedByRelayer;
}
/// @dev A debug event for fine-tuning gas related constants in the future.
event MessageProcessed(bytes32 indexed msgHash, Message message, ProcessingStats stats);
/// @dev The amount of gas that will be deducted from message.gasLimit before calculating the
/// invocation gas limit. This value should be fine-tuned with production data.
uint32 public constant GAS_RESERVE = 800_000;
/// @dev The gas overhead for both receiving and invoking a message, as well as the proof
/// calldata cost.
/// This value should be fine-tuned with production data.
uint32 public constant GAS_OVERHEAD = 120_000;
///@dev The max proof size for a message to be processable by a relayer.
uint256 public constant RELAYER_MAX_PROOF_BYTES = 200_000;
/// @dev The amount of gas not to charge fee per cache operation.
uint256 private constant _GAS_REFUND_PER_CACHE_OPERATION = 20_000;
/// @dev Gas limit for sending Ether.
// - EOA gas used is < 21000
// - For Loopring smart wallet, gas used is about 23000
// - For Argent smart wallet on Ethereum, gas used is about 24000
// - For Gnosis Safe wallet, gas used is about 28000
uint256 private constant _SEND_ETHER_GAS_LIMIT = 35_000;
/// @dev Place holder value when not using transient storage
uint256 private constant _PLACEHOLDER = type(uint256).max;
ISignalService public immutable signalService;
IQuotaManager public immutable quotaManager;
/// @dev Address authorized to pause/unpause alongside the owner, and to fund the bridge with
/// plain Ether transfers via `receive`. Optional (may be zero, which disables direct funding).
address public immutable pauser;
/// @notice The next message ID.
/// @dev Slot 1.
uint64 private __reserved1;
uint64 public nextMessageId;
/// @notice Mapping to store the status of a message from its hash.
/// @dev Slot 2.
mapping(bytes32 msgHash => Status status) public messageStatus;
/// @dev Slots 3 and 4
Context private __ctx;
/// @dev Slot 5.
uint256 private __reserved2;
/// @dev Slot 6.
uint256 private __reserved3;
uint256[44] private __gap;
// ---------------------------------------------------------------
// Modifiers
// ---------------------------------------------------------------
modifier sameChain(uint64 _chainId) {
_checkSameChain(_chainId);
_;
}
modifier diffChain(uint64 _chainId) {
_checkDiffChain(_chainId);
_;
}
/// @notice Initializes the bridge's immutable state.
/// @param _resolver The address of the resolver contract.
/// @param _signalService The address of the signal service contract.
/// @param _quotaManager The address of the quota manager contract. Optional (may be zero).
/// @param _pauser Address authorized to pause/unpause alongside the owner, and to fund the
/// bridge via plain Ether transfers. Optional (may be zero, which disables direct funding).
constructor(
address _resolver,
address _signalService,
address _quotaManager,
address _pauser
)
EssentialResolverContract(_resolver)
{
signalService = ISignalService(_signalService);
quotaManager = IQuotaManager(_quotaManager);
pauser = _pauser;
}
// ---------------------------------------------------------------
// External & Public Functions
// ---------------------------------------------------------------
/// @notice Accepts plain Ether transfers from the pauser to fund the bridge.
/// @dev Reverts for any sender other than `pauser`, preventing arbitrary Ether deposits. The
/// bridge is deployed behind a proxy, so the pauser must use `call` (which forwards all gas);
/// the 2300-gas stipend of `transfer`/`send` is insufficient for the proxy's delegatecall.
receive() external payable {
require(msg.sender == pauser, B_PERMISSION_DENIED());
}
/// @notice Initializes the contract.
/// @param _owner The owner of this contract. msg.sender will be used if this value is zero.
function init(address _owner) external initializer {
__Essential_init(_owner);
}
/// @notice This function shall be called by previously deployed contracts.
function init2() external onlyOwner reinitializer(2) {
// reset some previously used slots for future reuse
__reserved1 = 0;
__reserved2 = 0;
__reserved3 = 0;
}
/// @notice Invalidates stale bridge messages by marking them done.
/// @dev Intended for one-time recovery on already deployed contracts. Each listed message hash
/// is force-marked as `DONE`, preventing retries and later processing as a new message.
/// @param _msgHashes The hashes of the messages to invalidate.
function init3(bytes32[] calldata _msgHashes) external onlyOwner reinitializer(3) {
if (_msgHashes.length == 0) revert B_INVALID_VALUE();
for (uint256 i; i < _msgHashes.length; ++i) {
messageStatus[_msgHashes[i]] = Status.DONE;
emit MessageStatusChanged(_msgHashes[i], Status.DONE);
}
}
/// @inheritdoc IBridge
function sendMessage(Message calldata _message)
external
payable
override
nonZeroAddr(_message.srcOwner)
nonZeroAddr(_message.destOwner)
nonZeroAddr(_message.to)
diffChain(_message.destChainId)
whenNotPaused
nonReentrant
returns (bytes32 msgHash_, Message memory message_)
{
if (_message.gasLimit == 0) {
if (_message.fee != 0) revert B_INVALID_FEE();
} else if (_invocationGasLimit(_message) == 0) {
revert B_INVALID_GAS_LIMIT();
}
// Check if the destination chain is enabled.
(bool destChainEnabled,) = isDestChainEnabled(_message.destChainId);
// Verify destination chain.
if (!destChainEnabled) revert B_INVALID_CHAINID();
// Ensure the sent value matches the expected amount.
if (_message.value + _message.fee != msg.value) revert B_INVALID_VALUE();
message_ = _message;
// Configure message details and send signal to indicate message sending.
message_.id = nextMessageId++;
message_.from = msg.sender;
message_.srcChainId = uint64(block.chainid);
msgHash_ = hashMessage(message_);
emit MessageSent(msgHash_, message_);
signalService.sendSignal(msgHash_);
}
/// @inheritdoc IBridge
function recallMessage(
Message calldata _message,
bytes calldata _proof
)
external
sameChain(_message.srcChainId)
diffChain(_message.destChainId)
whenNotPaused
nonReentrant
{
bytes32 msgHash = hashMessage(_message);
_checkStatus(msgHash, Status.NEW);
if (!signalService.isSignalSent(address(this), msgHash)) {
revert B_MESSAGE_NOT_SENT();
}
_proveSignalReceived(
signalService, signalForFailedMessage(msgHash), _message.destChainId, _proof
);
_updateMessageStatus(msgHash, Status.RECALLED);
// A recall always releases `_message.value` back to the source owner, so debit its quota.
_consumeEtherQuota(_message.value);
// Execute the recall logic based on the contract's support for the
// IRecallableSender interface
if (_message.from.supportsInterface(type(IRecallableSender).interfaceId)) {
_storeContext(msgHash, address(this), _message.srcChainId);
// Perform recall
IRecallableSender(_message.from)
.onMessageRecalled{ value: _message.value }(_message, msgHash);
// Must reset the context after the message call
_storeContext(
bytes32(_PLACEHOLDER), address(uint160(_PLACEHOLDER)), uint64(_PLACEHOLDER)
);
} else {
_message.srcOwner.sendEtherAndVerify(_message.value, _SEND_ETHER_GAS_LIMIT);
}
}
/// @inheritdoc IBridge
/// @dev To ensure successful execution, we recommend this transaction's gas limit not to be
/// smaller than:
/// `(message.gasLimit - GAS_RESERVE) * 64 / 63 + GAS_RESERVE`,
/// Or we can use a simplified rule: `tx.gaslimit = message.gaslimit * 102%`.
function processMessage(
Message calldata _message,
bytes calldata _proof
)
external
whenNotPaused
nonReentrant
returns (Status status_, StatusReason reason_)
{
uint256 gasStart = gasleft();
// same as `sameChain(_message.destChainId)` but without stack-too-deep
if (_message.destChainId != block.chainid) revert B_INVALID_CHAINID();
// same as `diffChain(_message.srcChainId)` but without stack-too-deep
if (_message.srcChainId == 0 || _message.srcChainId == block.chainid) {
revert B_INVALID_CHAINID();
}
ProcessingStats memory stats;
stats.processedByRelayer = msg.sender != _message.destOwner;
// If the gas limit is set to zero, only the owner can process the message.
if (stats.processedByRelayer) {
if (_message.gasLimit == 0) revert B_PERMISSION_DENIED();
if (_proof.length > RELAYER_MAX_PROOF_BYTES) revert B_PROOF_TOO_LARGE();
}
bytes32 msgHash = hashMessage(_message);
_checkStatus(msgHash, Status.NEW);
stats.proofSize = uint32(_proof.length);
stats.numCacheOps =
_proveSignalReceived(signalService, msgHash, _message.srcChainId, _proof);
uint256 refundAmount;
if (_unableToInvokeMessageCall(_message, signalService)) {
// Handle special addresses and message.data encoded function calldata that don't
// require or cannot proceed with actual invocation and mark message as DONE
refundAmount = _message.value;
status_ = Status.DONE;
reason_ = StatusReason.INVOCATION_PROHIBITED;
} else {
uint256 gasLimit = stats.processedByRelayer ? _invocationGasLimit(_message) : gasleft();
if (_invokeMessageCall(_message, msgHash, gasLimit, stats.processedByRelayer)) {
status_ = Status.DONE;
reason_ = StatusReason.INVOCATION_OK;
} else {
status_ = Status.RETRIABLE;
reason_ = StatusReason.INVOCATION_FAILED;
}
}
// Debit the Ether quota only for funds actually leaving the bridge: the fee is always
// released here, while the value is released only when the message reaches DONE. When the
// message stays RETRIABLE, its value remains in the bridge and is debited by retryMessage.
_consumeEtherQuota(status_ == Status.DONE ? _message.value + _message.fee : _message.fee);
if (_message.fee != 0) {
refundAmount += _message.fee;
if (stats.processedByRelayer && _message.gasLimit != 0) {
unchecked {
// The relayer (=message processor) needs to get paid from the fee, and below it
// the calculation mechanism of that.
// The high level overview is: "gasCharged * block.basefee" with some caveat.
// Sometimes over or under estimated and it has different reasons:
// - a rational relayer shall simulate transactions off-chain so he/she would
// exactly know if the txn is profitable or not.
// - need to have a buffer/small revenue to the realyer since it consumes
// maintenance and infra costs to operate
uint256 refund = stats.numCacheOps * _GAS_REFUND_PER_CACHE_OPERATION;
// Taking into account the encoded message calldata cost, and can count with 16
// gas per bytes (vs. checking each and every byte if zero or non-zero)
stats.gasUsedInFeeCalc = uint32(
GAS_OVERHEAD + gasStart + _messageCalldataCost(_message.data.length)
- gasleft()
);
uint256 gasCharged = refund.max(stats.gasUsedInFeeCalc) - refund;
uint256 maxFee = gasCharged * _message.fee / _message.gasLimit;
uint256 baseFee = gasCharged * block.basefee;
uint256 fee =
(baseFee >= maxFee ? maxFee : (maxFee + baseFee) >> 1).min(_message.fee);
refundAmount -= fee;
msg.sender.sendEtherAndVerify(fee, _SEND_ETHER_GAS_LIMIT);
}
}
}
_message.destOwner.sendEtherAndVerify(refundAmount, _SEND_ETHER_GAS_LIMIT);
_updateMessageStatus(msgHash, status_);
emit MessageProcessed(msgHash, _message, stats);
}
/// @inheritdoc IBridge
function retryMessage(
Message calldata _message,
bool _isLastAttempt
)
external
sameChain(_message.destChainId)
diffChain(_message.srcChainId)
whenNotPaused
nonReentrant
{
bytes32 msgHash = hashMessage(_message);
_checkStatus(msgHash, Status.RETRIABLE);
bool succeeded;
if (_unableToInvokeMessageCall(_message, signalService)) {
succeeded = _message.destOwner.sendEther(_message.value, _SEND_ETHER_GAS_LIMIT, "");
} else {
if ((_message.gasLimit == 0 || _isLastAttempt) && msg.sender != _message.destOwner) {
revert B_PERMISSION_DENIED();
}
// Attempt to invoke the messageCall.
succeeded = _invokeMessageCall(_message, msgHash, gasleft(), false);
}
if (succeeded) {
// The value is released to the recipient only on a successful retry, so debit its
// quota here. A failed retry leaves the message RETRIABLE/FAILED with the value still
// in the bridge, consuming no quota.
_consumeEtherQuota(_message.value);
_updateMessageStatus(msgHash, Status.DONE);
} else if (_isLastAttempt) {
_updateMessageStatus(msgHash, Status.FAILED);
signalService.sendSignal(signalForFailedMessage(msgHash));
} else {
revert B_RETRY_FAILED();
}
}
/// @inheritdoc IBridge
function failMessage(Message calldata _message)
external
sameChain(_message.destChainId)
diffChain(_message.srcChainId)
whenNotPaused
nonReentrant
{
if (msg.sender != _message.destOwner) {
revert B_PERMISSION_DENIED();
}
bytes32 msgHash = hashMessage(_message);
_checkStatus(msgHash, Status.RETRIABLE);
_updateMessageStatus(msgHash, Status.FAILED);
signalService.sendSignal(signalForFailedMessage(msgHash));
}
/// @notice Checks if a msgHash has failed on its destination chain.
/// This is the 'readonly' version of proveMessageFailed.
/// @param _message The message.
/// @param _proof The merkle inclusion proof.
/// @return true if the message has failed, false otherwise.
function isMessageFailed(
Message calldata _message,
bytes calldata _proof
)
external
view
returns (bool)
{
if (_message.srcChainId != block.chainid) return false;
return _isSignalReceived(
signalService,
signalForFailedMessage(hashMessage(_message)),
_message.destChainId,
_proof
);
}
/// @notice Checks if a msgHash has been received on its source chain.
/// This is the 'readonly' version of proveMessageReceived.
/// @param _message The message.
/// @param _proof The merkle inclusion proof.
/// @return true if the message has been received, false otherwise.
function isMessageReceived(
Message calldata _message,
bytes calldata _proof
)
external
view
returns (bool)
{
if (_message.destChainId != block.chainid) return false;
return _isSignalReceived(signalService, hashMessage(_message), _message.srcChainId, _proof);
}
/// @inheritdoc IBridge
function isMessageSent(Message calldata _message) external view returns (bool) {
if (_message.srcChainId != block.chainid) return false;
return signalService.isSignalSent({ _app: address(this), _signal: hashMessage(_message) });
}
/// @notice Checks if the destination chain is enabled.
/// @param _chainId The destination chain ID.
/// @return enabled_ True if the destination chain is enabled.
/// @return destBridge_ The bridge of the destination chain.
function isDestChainEnabled(uint64 _chainId)
public
view
returns (bool enabled_, address destBridge_)
{
destBridge_ = resolve(_chainId, LibNames.B_BRIDGE, true);
enabled_ = destBridge_ != address(0);
}
/// @notice Gets the current context.
/// @inheritdoc IBridge
function context() external view returns (Context memory ctx_) {
ctx_ = _loadContext();
if (ctx_.msgHash == 0 || ctx_.msgHash == bytes32(_PLACEHOLDER)) {
revert B_INVALID_CONTEXT();
}
}
/// @inheritdoc IBridge
function hashMessage(Message memory _message) public pure returns (bytes32) {
/// forge-lint: disable-next-line(asm-keccak256)
return keccak256(abi.encode("TAIKO_MESSAGE", _message));
}
/// @notice Returns a signal representing a failed/recalled message.
/// @param _msgHash The message hash.
/// @return The failed representation of it as bytes32.
function signalForFailedMessage(bytes32 _msgHash) public pure returns (bytes32) {
return _msgHash ^ bytes32(uint256(Status.FAILED));
}
/// @notice Returns the minimal gas limit required for sending a given message.
/// @param dataLength The length of message.data.
/// @return The minimal gas limit required for sending this message.
function getMessageMinGasLimit(uint256 dataLength) public pure returns (uint32) {
return _messageCalldataCost(dataLength) + GAS_RESERVE;
}
/// @dev Authorizes the owner or the designated immutable pauser to pause/unpause.
function _authorizePause(address, bool) internal view override onlyFromOwnerOr(pauser) { }
/// @notice Invokes a call message on the Bridge.
/// @param _message The call message to be invoked.
/// @param _msgHash The hash of the message.
/// @param _shouldCheckForwardedGas True to check gasleft is sufficient for target function
/// invocation.
/// @return success_ A boolean value indicating whether the message call was successful.
/// @dev This function updates the context in the state before and after the
/// message call.
function _invokeMessageCall(
Message calldata _message,
bytes32 _msgHash,
uint256 _gasLimit,
bool _shouldCheckForwardedGas
)
private
returns (bool success_)
{
assert(_message.from != address(this));
if (_message.value == 0 && _message.data.length == 0) return true;
if (_gasLimit == 0) return false;
_storeContext(_msgHash, _message.from, _message.srcChainId);
address to = _message.to;
uint256 value = _message.value;
bytes memory data = _message.data;
uint256 gasLeft;
assembly {
success_ := call(_gasLimit, to, value, add(data, 0x20), mload(data), 0, 0)
gasLeft := gas()
}
if (_shouldCheckForwardedGas) {
_checkForwardedGas(gasLeft, _gasLimit);
}
_storeContext(bytes32(_PLACEHOLDER), address(uint160(_PLACEHOLDER)), uint64(_PLACEHOLDER));
}
/// @notice Updates the status of a bridge message.
/// @dev If the new status is different from the current status in the
/// mapping, the status is updated and an event is emitted.
/// @param _msgHash The hash of the message.
/// @param _status The new status of the message.
function _updateMessageStatus(bytes32 _msgHash, Status _status) private {
if (messageStatus[_msgHash] == _status) revert B_INVALID_STATUS();
messageStatus[_msgHash] = _status;
emit MessageStatusChanged(_msgHash, _status);
}
/// @notice Stores the call context
/// @param _msgHash The message hash.
/// @param _from The sender's address.
/// @param _srcChainId The source chain ID.
function _storeContext(bytes32 _msgHash, address _from, uint64 _srcChainId) internal virtual {
__ctx = Context(_msgHash, _from, _srcChainId);
}
/// @notice Checks if the signal was received and caches cross-chain data if requested.
/// @param _signalService The signal service address.
/// @param _signal The signal.
/// @param _chainId The ID of the chain the signal is stored on.
/// @param _proof The merkle inclusion proof.
/// @return numCacheOps_ Num of cached items
function _proveSignalReceived(
ISignalService _signalService,
bytes32 _signal,
uint64 _chainId,
bytes calldata _proof
)
private
returns (uint32 numCacheOps_)
{
try _signalService.proveSignalReceived(
_chainId, resolve(_chainId, LibNames.B_BRIDGE, false), _signal, _proof
) returns (
uint256 numCacheOps
) {
numCacheOps_ = uint32(numCacheOps);
} catch {
revert B_SIGNAL_NOT_RECEIVED();
}
}
/// @dev Consumes a given amount of Ether from the quota manager; reverts if quota is
/// insufficient. Skips the external call when nothing is released (`_amount == 0`).
/// @param _amount The amount of Ether to consume.
function _consumeEtherQuota(uint256 _amount) private {
if (_amount != 0 && address(quotaManager) != address(0)) {
quotaManager.consumeQuota(address(0), _amount);
}
}
/// @notice Loads and returns the call context.
/// @return ctx_ The call context.
function _loadContext() internal view virtual returns (Context memory) {
return __ctx;
}
/// @notice Checks if the signal was received.
/// This is the 'readonly' version of _proveSignalReceived.
/// @param _signalService The signal service address.
/// @param _signal The signal.
/// @param _chainId The ID of the chain the signal is stored on.
/// @param _proof The merkle inclusion proof.
/// @return true if the message was received.
function _isSignalReceived(
ISignalService _signalService,
bytes32 _signal,
uint64 _chainId,
bytes calldata _proof
)
private
view
returns (bool)
{
try _signalService.verifySignalReceived(
_chainId, resolve(_chainId, LibNames.B_BRIDGE, false), _signal, _proof
) {
return true;
} catch {
return false;
}
}
function _checkStatus(bytes32 _msgHash, Status _expectedStatus) private view {
if (messageStatus[_msgHash] != _expectedStatus) revert B_INVALID_STATUS();
}
function _unableToInvokeMessageCall(
Message calldata _message,
ISignalService _signalService
)
private
view
returns (bool)
{
if (_message.to == address(0)) return true;
if (_message.to == address(this)) return true;
if (_message.to == address(_signalService)) return true;
return _message.data.length >= 4
&& bytes4(_message.data) != IMessageInvocable.onMessageInvocation.selector;
}
function _invocationGasLimit(Message calldata _message) private pure returns (uint256) {
uint256 minGasRequired = getMessageMinGasLimit(_message.data.length);
unchecked {
return minGasRequired.max(_message.gasLimit) - minGasRequired;
}
}
function _messageCalldataCost(uint256 dataLength) private pure returns (uint32) {
// The abi encoding of A = (Message calldata msg) is 10 * 32 bytes
// + 32 bytes (A is a dynamic tuple, offset to first elements)
// + 32 bytes (offset to last bytes element of Message)
// + 32 bytes (padded encoding of length of Message.data + dataLength
// (padded to 32 // bytes) = 13 * 32 + ((dataLength + 31) / 32 * 32).
// Non-zero calldata cost per byte is 16.
unchecked {
return uint32(((dataLength + 31) / 32 * 32 + 416) << 4);
}
}
// ---------------------------------------------------------------
// Private Functions
// ---------------------------------------------------------------
/// @dev Suggested by OpenZeppelin and copied from
/// https://github.com/OpenZeppelin/openzeppelin-contracts/
/// blob/83c7e45092dac350b070c421cd2bf7105616cf1a/contracts/
/// metatx/ERC2771Forwarder.sol#L327C1-L370C6
///
/// @dev Checks if the requested gas was correctly forwarded to the callee.
/// As a consequence of https://eips.ethereum.org/EIPS/eip-150[EIP-150]:
/// - At most `gasleft() - floor(gasleft() / 64)` is forwarded to the callee.
/// - At least `floor(gasleft() / 64)` is kept in the caller.
///
/// It reverts consuming all the available gas if the forwarded gas is not the requested gas.
///
/// IMPORTANT: The `gasLeft` parameter should be measured exactly at the end of the forwarded
/// call.
/// Any gas consumed in between will make room for bypassing this check.
function _checkForwardedGas(uint256 _gasLeft, uint256 _gasRequested) private pure {
// To avoid insufficient gas griefing attacks, as referenced in
// https://ronan.eth.limo/blog/ethereum-gas-dangers/
//
// A malicious relayer can attempt to shrink the gas forwarded so that the underlying call
// reverts out-of-gas
// but the forwarding itself still succeeds. In order to make sure that the subcall received
// sufficient gas,
// we will inspect gasleft() after the forwarding.
//
// Let X be the gas available before the subcall, such that the subcall gets at most X * 63
// / 64.
// We can't know X after CALL dynamic costs, but we want it to be such that X * 63 / 64 >=
// req.gas.
// Let Y be the gas used in the subcall. gasleft() measured immediately after the subcall
// will be gasleft() = X - Y.
// If the subcall ran out of gas, then Y = X * 63 / 64 and gasleft() = X - Y = X / 64.
// Under this assumption req.gas / 63 > gasleft() is true is true if and only if
// req.gas / 63 > X / 64, or equivalently req.gas > X * 63 / 64.
// This means that if the subcall runs out of gas we are able to detect that insufficient
// gas was passed.
//
// We will now also see that req.gas / 63 > gasleft() implies that req.gas >= X * 63 / 64.
// The contract guarantees Y <= req.gas, thus gasleft() = X - Y >= X - req.gas.
// - req.gas / 63 > gasleft()
// - req.gas / 63 >= X - req.gas
// - req.gas >= X * 63 / 64
// In other words if req.gas < X * 63 / 64 then req.gas / 63 <= gasleft(), thus if the
// relayer behaves honestly
// the forwarding does not revert.
if (_gasLeft < _gasRequested / 63) {
// We explicitly trigger invalid opcode to consume all gas and bubble-up the effects,
// since
// neither revert or assert consume all gas since Solidity 0.8.20
// https://docs.soliditylang.org/en/v0.8.20/control-structures.html#panic-via-assert-and-error-via-require
// / @solidity memory-safe-assembly
assembly {
invalid()
}
}
}
function _checkSameChain(uint64 _chainId) internal view {
if (_chainId != block.chainid) revert B_INVALID_CHAINID();
}
function _checkDiffChain(uint64 _chainId) internal view {
if (_chainId == 0 || _chainId == block.chainid) revert B_INVALID_CHAINID();
}
// ---------------------------------------------------------------
// Custom Errors
// ---------------------------------------------------------------
error B_INVALID_CHAINID();
error B_INVALID_CONTEXT();
error B_INVALID_FEE();
error B_INVALID_GAS_LIMIT();
error B_INVALID_STATUS();
error B_INVALID_VALUE();
error B_MESSAGE_NOT_SENT();
error B_PERMISSION_DENIED();
error B_PROOF_TOO_LARGE();
error B_RETRY_FAILED();
error B_SIGNAL_NOT_RECEIVED();
}
contracts/shared/bridge/Bridge_Layout.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
/// @title BridgeLayout
/// @notice Storage layout documentation for Bridge
/// @dev This file is auto-generated by gen-layouts.sh. DO NOT EDIT MANUALLY.
/// @custom:security-contact security@taiko.xyz
// solhint-disable max-line-length
// _initialized | uint8 | Slot: 0 | Offset: 0 | Bytes: 1
// _initializing | bool | Slot: 0 | Offset: 1 | Bytes: 1
// __gap | uint256[50] | Slot: 1 | Offset: 0 | Bytes: 1600
// _owner | address | Slot: 51 | Offset: 0 | Bytes: 20
// __gap | uint256[49] | Slot: 52 | Offset: 0 | Bytes: 1568
// _pendingOwner | address | Slot: 101 | Offset: 0 | Bytes: 20
// __gap | uint256[49] | Slot: 102 | Offset: 0 | Bytes: 1568
// __gapFromOldAddressResolver | uint256[50] | Slot: 151 | Offset: 0 | Bytes: 1600
// __reentry | uint8 | Slot: 201 | Offset: 0 | Bytes: 1
// __paused | uint8 | Slot: 201 | Offset: 1 | Bytes: 1
// __gap | uint256[49] | Slot: 202 | Offset: 0 | Bytes: 1568
// __reserved1 | uint64 | Slot: 251 | Offset: 0 | Bytes: 8
// nextMessageId | uint64 | Slot: 251 | Offset: 8 | Bytes: 8
// messageStatus | mapping(bytes32 => enum IBridge.Status) | Slot: 252 | Offset: 0 | Bytes: 32
// __ctx | struct IBridge.Context | Slot: 253 | Offset: 0 | Bytes: 64
// __reserved2 | uint256 | Slot: 255 | Offset: 0 | Bytes: 32
// __reserved3 | uint256 | Slot: 256 | Offset: 0 | Bytes: 32
// __gap | uint256[44] | Slot: 257 | Offset: 0 | Bytes: 1408
contracts/shared/bridge/IBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title IBridge
/// @notice The bridge used in conjunction with the {ISignalService}.
/// @dev Ether is held by Bridges on L1 and L2s.
/// @custom:security-contact security@taiko.xyz
interface IBridge {
enum Status {
NEW,
RETRIABLE,
DONE,
FAILED,
RECALLED
}
enum StatusReason {
INVOCATION_OK,
INVOCATION_PROHIBITED,
INVOCATION_FAILED,
OUT_OF_ETH_QUOTA
}
struct Message {
// Message ID whose value is automatically assigned.
uint64 id;
// The max processing fee for the relayer. This fee has 3 parts:
// - the fee for message calldata.
// - the minimal fee reserve for general processing, excluding function call.
// - the invocation fee for the function call.
// Any unpaid fee will be refunded to the destOwner on the destination chain.
// Note that fee must be 0 if gasLimit is 0, or large enough to make the invocation fee
// non-zero.
uint64 fee;
// gasLimit that the processMessage call must have.
uint32 gasLimit;
// The address, EOA or contract, that interacts with this bridge.
// The value is automatically assigned.
address from;
// Source chain ID whose value is automatically assigned.
uint64 srcChainId;
// The owner of the message on the source chain.
address srcOwner;
// Destination chain ID where the `to` address lives.
uint64 destChainId;
// The owner of the message on the destination chain.
address destOwner;
// The destination address on the destination chain.
address to;
// value to invoke on the destination chain.
uint256 value;
// callData to invoke on the destination chain.
bytes data;
}
// Struct representing the context of a bridge operation.
// 2 slots
struct Context {
bytes32 msgHash; // Message hash.
address from; // Sender's address.
uint64 srcChainId; // Source chain ID.
}
/// @notice Emitted when a message is sent.
/// @param msgHash The hash of the message.
/// @param message The message.
event MessageSent(bytes32 indexed msgHash, Message message);
/// @notice Emitted when the status of a message changes.
/// @param msgHash The hash of the message.
/// @param status The new status of the message.
event MessageStatusChanged(bytes32 indexed msgHash, Status status);
/// @notice Sends a message to the destination chain and takes custody
/// of Ether required in this contract.
/// @param _message The message to be sent.
/// @return msgHash_ The hash of the sent message.
/// @return message_ The updated message sent.
function sendMessage(Message calldata _message)
external
payable
returns (bytes32 msgHash_, Message memory message_);
/// @notice Recalls a message on its source chain after it has failed on the
/// destination chain, releasing associated assets on the source chain.
/// @dev Verifies via proof that the message was marked FAILED on the
/// destination chain's Bridge, then releases the associated Ether or tokens
/// on the source chain.
/// @param _message The message whose associated Ether should be released.
/// @param _proof The merkle inclusion proof.
function recallMessage(Message calldata _message, bytes calldata _proof) external;
/// @notice Processes a bridge message on the destination chain. This
/// function is callable by any address, including the `message.destOwner`.
/// @dev The process begins by hashing the message and checking the message
/// status in the bridge If the status is "NEW", the message is invoked. The
/// status is updated accordingly, and processing fees are refunded as
/// needed.
/// @param _message The message to be processed.
/// @param _proof The merkle inclusion proof.
/// @return The message's status after processing and the reason for the change.
function processMessage(
Message calldata _message,
bytes calldata _proof
)
external
returns (Status, StatusReason);
/// @notice Retries to invoke the messageCall after releasing associated
/// Ether and tokens.
/// @dev This function can be called by any address, including the
/// `message.destOwner`.
/// It attempts to invoke the messageCall and updates the message status
/// accordingly.
/// @param _message The message to retry.
/// @param _isLastAttempt Specifies if this is the last attempt to retry the
/// message.
function retryMessage(Message calldata _message, bool _isLastAttempt) external;
/// @notice Mark a message as failed if the message is currently retriable.
/// @dev This function can only be called by `message.destOwner`.
/// @param _message The message to fail.
/// message.
function failMessage(Message calldata _message) external;
/// @notice Returns the bridge state context.
/// @return ctx_ The context of the current bridge operation.
function context() external view returns (Context memory ctx_);
/// @notice Checks if the message was sent.
/// @param _message The message.
/// @return true if the message was sent.
function isMessageSent(Message calldata _message) external view returns (bool);
/// @notice Returns the unique id of the next bridge message
/// @return A unique id
function nextMessageId() external view returns (uint64);
/// @notice Hash the message
/// @param _message The message struct variable to be hashed.
/// @return The message's hash.
function hashMessage(Message memory _message) external pure returns (bytes32);
}
/// @title IRecallableSender
/// @notice An interface that all recallable message senders shall implement.
interface IRecallableSender {
/// @notice Called when a message is recalled.
/// @param _message The recalled message.
/// @param _msgHash The hash of the recalled message.
function onMessageRecalled(
IBridge.Message calldata _message,
bytes32 _msgHash
)
external
payable;
}
/// @title IMessageInvocable
/// @notice An interface that all bridge message receiver shall implement
interface IMessageInvocable {
/// @notice Called when this contract is the bridge target.
/// @param _data The data for this contract to interpret.
/// @dev This method should be guarded with `onlyFromNamed("bridge")`.
function onMessageInvocation(bytes calldata _data) external payable;
}
contracts/shared/bridge/IQuotaManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title IQuotaManager
/// @custom:security-contact security@taiko.xyz
interface IQuotaManager {
/// @notice Consumes a specific amount of quota for a given address.
/// This function must revert if available quota is smaller than the given amount of quota.
/// A token with no configured quota is treated as "unlimited" and its consumption is never
/// restricted (implementations may signal this with a sentinel such as
/// `QuotaManager.UNLIMITED_QUOTA`).
///
/// @dev Note that IQuotaManager is used by vaults and bridge, and should be registered in a
/// shared address manager on the L1, therefore, a registered IQuotaManager and its per-token
/// quota settings will be shared by all Taiko L2s. To enable a per-L2 quota, we need to modify
/// this function to:
/// `function consumeQuota(uint256 _srcChainId, address _token, uint256 _amount) `
///
/// @param _token The token address. Ether is represented with address(0).
/// @param _amount The amount of quota to consume.
function consumeQuota(address _token, uint256 _amount) external;
}
contracts/shared/common/EssentialContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "./IResolver.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
/// @title EssentialContract
/// @custom:security-contact security@taiko.xyz
abstract contract EssentialContract is UUPSUpgradeable, Ownable2StepUpgradeable {
// ---------------------------------------------------------------
// Constants and Immutable Variables
// ---------------------------------------------------------------
uint8 internal constant _FALSE = 1;
uint8 internal constant _TRUE = 2;
address internal immutable __resolver;
// ---------------------------------------------------------------
// State Variables
// ---------------------------------------------------------------
uint256[50] private __gapFromOldAddressResolver;
/// @dev Slot 1.
uint8 internal __reentry;
uint8 internal __paused;
uint256[49] private __gap;
// ---------------------------------------------------------------
// Events
// ---------------------------------------------------------------
/// @notice Emitted when the contract is paused.
/// @param account The account that paused the contract.
event Paused(address account);
/// @notice Emitted when the contract is unpaused.
/// @param account The account that unpaused the contract.
event Unpaused(address account);
error INVALID_PAUSE_STATUS();
error FUNC_NOT_IMPLEMENTED();
error REENTRANT_CALL();
error ACCESS_DENIED();
error ZERO_ADDRESS();
error ZERO_VALUE();
// ---------------------------------------------------------------
// Modifiers
// ---------------------------------------------------------------
/// @dev Modifier that ensures the caller is either the owner or a specified address.
/// @param _addr The address to check against.
modifier onlyFromOwnerOr(address _addr) {
_checkOwnerOr(_addr);
_;
}
/// @dev Modifier that reverts the function call, indicating it is not implemented.
modifier notImplemented() {
revert FUNC_NOT_IMPLEMENTED();
_;
}
/// @dev Modifier that prevents reentrant calls to a function.
modifier nonReentrant() {
_checkReentrancy();
_storeReentryLock(_TRUE);
_;
_storeReentryLock(_FALSE);
}
/// @dev Modifier that allows function execution only when the contract is paused.
modifier whenPaused() {
_checkPaused();
_;
}
/// @dev Modifier that allows function execution only when the contract is not paused.
modifier whenNotPaused() {
_checkNotPaused();
_;
}
/// @dev Modifier that ensures the provided address is not the zero address.
/// @param _addr The address to check.
modifier nonZeroAddr(address _addr) {
_checkNonZeroAddr(_addr);
_;
}
/// @dev Modifier that ensures the provided value is not zero.
/// @param _value The value to check.
modifier nonZeroValue(uint256 _value) {
_checkNonZeroValue(_value);
_;
}
/// @dev Modifier that ensures the provided bytes32 value is not zero.
/// @param _value The bytes32 value to check.
modifier nonZeroBytes32(bytes32 _value) {
_checkNonZeroBytes32(_value);
_;
}
/// @dev Modifier that ensures the caller is either of the two specified addresses.
/// @param _addr1 The first address to check against.
/// @param _addr2 The second address to check against.
modifier onlyFromEither(address _addr1, address _addr2) {
_checkFromEither(_addr1, _addr2);
_;
}
/// @dev Modifier that ensures the caller is the specified address.
/// @param _addr The address to check against.
modifier onlyFrom(address _addr) {
_checkFrom(_addr);
_;
}
/// @dev Modifier that ensures the caller is the specified address.
/// @param _addr The address to check against.
modifier onlyFromOptional(address _addr) {
_checkFromOptional(_addr);
_;
}
// ---------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------
constructor() {
_disableInitializers();
}
// ---------------------------------------------------------------
// External & Public Functions
// ---------------------------------------------------------------
/// @notice Pauses the contract.
function pause() public whenNotPaused {
_pause();
emit Paused(msg.sender);
// We call the authorize function here to avoid:
// Warning (5740): Unreachable code.
_authorizePause(msg.sender, true);
}
/// @notice Unpauses the contract.
function unpause() public whenPaused {
_unpause();
emit Unpaused(msg.sender);
// We call the authorize function here to avoid:
// Warning (5740): Unreachable code.
_authorizePause(msg.sender, false);
}
function impl() public view returns (address) {
return _getImplementation();
}
/// @notice Returns true if the contract is paused, and false otherwise.
/// @return true if paused, false otherwise.
function paused() public view virtual returns (bool) {
return __paused == _TRUE;
}
function inNonReentrant() public view returns (bool) {
return _loadReentryLock() == _TRUE;
}
/// @notice Returns the address of this contract.
/// @return The address of this contract.
function resolver() public view virtual returns (address) {
return __resolver;
}
// ---------------------------------------------------------------
// Internal Functions
// ---------------------------------------------------------------
/// @notice Initializes the contract.
/// @param _owner The owner of this contract. msg.sender will be used if this value is zero.
function __Essential_init(address _owner) internal virtual onlyInitializing {
__Context_init();
_transferOwnership(_owner == address(0) ? msg.sender : _owner);
__paused = _FALSE;
}
function _pause() internal virtual {
__paused = _TRUE;
}
function _unpause() internal virtual {
__paused = _FALSE;
}
function _authorizeUpgrade(address) internal virtual override onlyOwner { }
function _authorizePause(address, bool) internal virtual onlyOwner { }
// Stores the reentry lock
function _storeReentryLock(uint8 _reentry) internal virtual {
__reentry = _reentry;
}
// Loads the reentry lock
function _loadReentryLock() internal view virtual returns (uint8 reentry_) {
reentry_ = __reentry;
}
// ---------------------------------------------------------------
// Private Functions
// ---------------------------------------------------------------
function _checkOwnerOr(address _addr) private view {
require(msg.sender == owner() || msg.sender == _addr, ACCESS_DENIED());
}
function _checkReentrancy() private view {
require(_loadReentryLock() != _TRUE, REENTRANT_CALL());
}
function _checkPaused() private view {
require(paused(), INVALID_PAUSE_STATUS());
}
function _checkNotPaused() private view {
require(!paused(), INVALID_PAUSE_STATUS());
}
function _checkNonZeroAddr(address _addr) private pure {
require(_addr != address(0), ZERO_ADDRESS());
}
function _checkNonZeroValue(uint256 _value) private pure {
require(_value != 0, ZERO_VALUE());
}
function _checkNonZeroBytes32(bytes32 _value) private pure {
require(_value != 0, ZERO_VALUE());
}
function _checkFromEither(address _addr1, address _addr2) private view {
require(msg.sender == _addr1 || msg.sender == _addr2, ACCESS_DENIED());
}
function _checkFrom(address _addr) private view {
require(msg.sender == _addr, ACCESS_DENIED());
}
function _checkFromOptional(address _addr) private view {
require(_addr == address(0) || msg.sender == _addr, ACCESS_DENIED());
}
}
contracts/shared/common/EssentialResolverContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "./EssentialContract.sol";
import "./IResolver.sol";
abstract contract EssentialResolverContract is EssentialContract {
// ---------------------------------------------------------------
// Modifiers
// ---------------------------------------------------------------
/// @dev Modifier that ensures the caller is the owner or resolved address of a given name.
/// @param _name The name to check against.
modifier onlyFromOwnerOrNamed(bytes32 _name) {
_checkOwnerOrNamed(_name);
_;
}
/// @dev Modifier that ensures the caller is the resolved address of a given
/// name.
/// @param _name The name to check against.
modifier onlyFromNamed(bytes32 _name) {
_checkFromNamed(_name);
_;
}
/// @dev Modifier that ensures the caller is a resolved address to either _name1 or _name2
/// name.
/// @param _address1 The first name to check against.
/// @param _address2 The second name to check against.
modifier onlyFromNamedEither(address _address1, address _address2) {
_checkFromNamedEither(_address1, _address2);
_;
}
/// @dev Modifier that ensures the caller is the resolved address of a given
/// name, if the name is set.
/// @param _name The name to check against.
modifier onlyFromOptionalNamed(bytes32 _name) {
_checkFromOptionalNamed(_name);
_;
}
// ---------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------
constructor(address _resolver) {
require(_resolver != address(0), RESOLVER_NOT_FOUND());
__resolver = _resolver;
}
// ---------------------------------------------------------------
// Internal Functions
// ---------------------------------------------------------------
/// @notice Resolves a name to an address on a specific chain
/// @param _chainId The chain ID to resolve the name on
/// @param _name The name to resolve
/// @param _allowZeroAddress Whether to allow resolving to the zero address
/// @return The resolved address
function resolve(
uint64 _chainId,
bytes32 _name,
bool _allowZeroAddress
)
internal
view
returns (address)
{
return IResolver(resolver()).resolve(_chainId, _name, _allowZeroAddress);
}
/// @notice Resolves a name to an address on the current chain
/// @param _name The name to resolve
/// @param _allowZeroAddress Whether to allow resolving to the zero address
/// @return The resolved address
function resolve(bytes32 _name, bool _allowZeroAddress) internal view returns (address) {
return IResolver(resolver()).resolve(block.chainid, _name, _allowZeroAddress);
}
// ---------------------------------------------------------------
// Private Functions
// ---------------------------------------------------------------
function _checkOwnerOrNamed(bytes32 _name) private view {
require(msg.sender == owner() || msg.sender == resolve(_name, true), ACCESS_DENIED());
}
function _checkFromNamed(bytes32 _name) private view {
require(msg.sender == resolve(_name, true), ACCESS_DENIED());
}
function _checkFromNamedEither(address _address1, address _address2) private view {
require(msg.sender == _address1 || msg.sender == _address2, ACCESS_DENIED());
}
function _checkFromOptionalNamed(bytes32 _name) private view {
address addr = resolve(_name, true);
require(addr == address(0) || msg.sender == addr, ACCESS_DENIED());
}
// ---------------------------------------------------------------
// Custom Errors
// ---------------------------------------------------------------
error RESOLVER_NOT_FOUND();
}
contracts/shared/libs/LibAddress.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/// @title LibAddress
/// @dev Provides utilities for address-related operations.
/// @custom:security-contact security@taiko.xyz
library LibAddress {
error ETH_TRANSFER_FAILED();
/// @dev Sends Ether to the specified address. This method will not revert even if sending ether
/// fails.
/// This function is inspired by
/// https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol
/// @param _to The recipient address.
/// @param _amount The amount of Ether to send in wei.
/// @param _gasLimit The max amount gas to pay for this transaction.
/// @return success_ true if the call is successful, false otherwise.
function sendEther(
address _to,
uint256 _amount,
uint256 _gasLimit,
bytes memory _calldata
)
internal
returns (bool success_)
{
// Check for zero-address transactions
require(_to != address(0), ETH_TRANSFER_FAILED());
// dispatch message to recipient
// by assembly calling "handle" function
// we call via assembly to avoid memcopying a very large returndata
// returned by a malicious contract
assembly ("memory-safe") {
success_ := call(
_gasLimit, // gas
_to, // recipient
_amount, // ether value
add(_calldata, 0x20), // inloc
mload(_calldata), // inlen
0, // outloc
0 // outlen
)
}
}
/// @dev Sends Ether to the specified address. This method will revert if sending ether fails.
/// @param _to The recipient address.
/// @param _amount The amount of Ether to send in wei.
/// @param _gasLimit The max amount gas to pay for this transaction.
function sendEtherAndVerify(address _to, uint256 _amount, uint256 _gasLimit) internal {
if (_amount == 0) return;
require(sendEther(_to, _amount, _gasLimit, ""), ETH_TRANSFER_FAILED());
}
/// @dev Sends Ether to the specified address. This method will revert if sending ether fails.
/// @param _to The recipient address.
/// @param _amount The amount of Ether to send in wei.
function sendEtherAndVerify(address _to, uint256 _amount) internal {
sendEtherAndVerify(_to, _amount, gasleft());
}
function supportsInterface(
address _addr,
bytes4 _interfaceId
)
internal
view
returns (bool result_)
{
(bool success, bytes memory data) =
_addr.staticcall(abi.encodeCall(IERC165.supportsInterface, (_interfaceId)));
if (success && data.length == 32) {
result_ = abi.decode(data, (bool));
}
}
}
contracts/shared/libs/LibMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title LibMath
/// @dev This library offers additional math functions for uint256.
/// @custom:security-contact security@taiko.xyz
library LibMath {
/// @dev Returns the smaller of the two given values.
/// @param _a The first number to compare.
/// @param _b The second number to compare.
/// @return The smaller of the two numbers.
function min(uint256 _a, uint256 _b) internal pure returns (uint256) {
return _a > _b ? _b : _a;
}
/// @dev Returns the larger of the two given values.
/// @param _a The first number to compare.
/// @param _b The second number to compare.
/// @return The larger of the two numbers.
function max(uint256 _a, uint256 _b) internal pure returns (uint256) {
return _a > _b ? _a : _b;
}
function capToUint64(uint256 _value) internal pure returns (uint64) {
return uint64(min(_value, type(uint64).max));
}
}
contracts/shared/libs/LibNames.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title LibNames
/// @custom:security-contact security@taiko.xyz
library LibNames {
bytes32 internal constant B_BRIDGE = bytes32("bridge");
bytes32 internal constant B_BRIDGED_ERC1155 = bytes32("bridged_erc1155");
bytes32 internal constant B_BRIDGED_ERC20 = bytes32("bridged_erc20");
bytes32 internal constant B_BRIDGED_ERC721 = bytes32("bridged_erc721");
bytes32 internal constant B_ERC1155_VAULT = bytes32("erc1155_vault");
bytes32 internal constant B_ERC20_VAULT = bytes32("erc20_vault");
bytes32 internal constant B_ERC721_VAULT = bytes32("erc721_vault");
bytes32 internal constant B_SIGNAL_SERVICE = bytes32("signal_service");
bytes32 internal constant B_TAIKO = bytes32("taiko");
}
contracts/shared/libs/LibNetwork.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title LibNetwork
library LibNetwork {
uint256 internal constant ETHEREUM_MAINNET = 1;
uint256 internal constant ETHEREUM_ROPSTEN = 3;
uint256 internal constant ETHEREUM_RINKEBY = 4;
uint256 internal constant ETHEREUM_GOERLI = 5;
uint256 internal constant ETHEREUM_KOVAN = 42;
uint256 internal constant ETHEREUM_HOLESKY = 17_000;
uint256 internal constant ETHEREUM_SEPOLIA = 11_155_111;
uint256 internal constant ETHEREUM_HELDER = 7_014_190_335;
uint256 internal constant ETHEREUM_HOODI = 560_048;
uint64 internal constant TAIKO_MAINNET = 167_000;
uint64 internal constant TAIKO_HEKLA = 167_009;
uint64 internal constant TAIKO_DEVNET = 167_001;
uint64 internal constant TAIKO_PRECONF = 167_010;
uint64 internal constant TAIKO_HOODI = 167_013;
uint256 internal constant ETHEREUM_BLOCK_TIME = 12 seconds;
/// @dev Checks if the chain ID represents an Ethereum testnet.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents an Ethereum testnet, false otherwise.
function isEthereumTestnet(uint256 _chainId) internal pure returns (bool) {
return _chainId == LibNetwork.ETHEREUM_ROPSTEN || _chainId == LibNetwork.ETHEREUM_RINKEBY
|| _chainId == LibNetwork.ETHEREUM_GOERLI || _chainId == LibNetwork.ETHEREUM_KOVAN
|| _chainId == LibNetwork.ETHEREUM_HOLESKY || _chainId == LibNetwork.ETHEREUM_SEPOLIA
|| _chainId == LibNetwork.ETHEREUM_HELDER || _chainId == LibNetwork.ETHEREUM_HOODI;
}
/// @dev Checks if the chain ID represents an Ethereum testnet or the Etheruem mainnet.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents an Ethereum testnet or the Etheruem mainnet, false
/// otherwise.
function isEthereumMainnetOrTestnet(uint256 _chainId) internal pure returns (bool) {
return _chainId == LibNetwork.ETHEREUM_MAINNET || isEthereumTestnet(_chainId);
}
/// @dev Checks if the chain ID represents the Taiko L2 mainnet.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents the Taiko L2 mainnet.
function isTaikoMainnet(uint256 _chainId) internal pure returns (bool) {
return _chainId == TAIKO_MAINNET;
}
/// @dev Checks if the chain ID represents an internal Taiko devnet's base layer.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents an internal Taiko devnet's base layer, false
/// otherwise.
function isTaikoDevnet(uint256 _chainId) internal pure returns (bool) {
return _chainId >= 32_300 && _chainId <= 32_400;
}
/// @dev Checks if the chain supports Dencun hardfork. Note that this check doesn't need to be
/// exhaustive.
/// @param _chainId The chain ID.
/// @return true if the chain supports Dencun hardfork, false otherwise.
function isDencunSupported(uint256 _chainId) internal pure returns (bool) {
return _chainId == LibNetwork.ETHEREUM_MAINNET || _chainId == LibNetwork.ETHEREUM_HOLESKY
|| _chainId == LibNetwork.ETHEREUM_SEPOLIA || _chainId == LibNetwork.ETHEREUM_HELDER
|| _chainId == LibNetwork.ETHEREUM_HOODI || isTaikoDevnet(_chainId);
}
}
contracts/shared/signal/ICheckpointStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title ICheckpointStore
/// @notice Interface for storing and retrieving checkpoints
/// @custom:security-contact security@taiko.xyz
interface ICheckpointStore {
// ---------------------------------------------------------------
// Structs
// ---------------------------------------------------------------
/// @notice Represents a synced checkpoint
struct Checkpoint {
/// @notice The block number associated with the checkpoint.
uint48 blockNumber;
/// @notice The block hash for the referenced block.
bytes32 blockHash;
/// @notice The state root for the referenced block.
bytes32 stateRoot;
}
// ---------------------------------------------------------------
// Events
// ---------------------------------------------------------------
/// @notice Emitted when a checkpoint is saved
/// @param blockNumber The block number
/// @param blockHash The block hash
/// @param stateRoot The state root
event CheckpointSaved(uint48 indexed blockNumber, bytes32 blockHash, bytes32 stateRoot);
// ---------------------------------------------------------------
// External Functions
// ---------------------------------------------------------------
/// @notice Saves a checkpoint
/// @param _checkpoint The checkpoint data to persist
function saveCheckpoint(Checkpoint calldata _checkpoint) external;
/// @notice Gets a checkpoint by its block number
/// @param _blockNumber The block number associated with the checkpoint
/// @return _ The checkpoint
function getCheckpoint(uint48 _blockNumber) external view returns (Checkpoint memory);
}
contracts/shared/signal/ISignalService.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./ICheckpointStore.sol";
/// @title ISignalService
/// @notice The SignalService contract serves as a secure cross-chain message
/// passing system. It defines methods for sending and verifying signals with
/// merkle proofs. The trust assumption is that the target chain has secure
/// access to the merkle root (such as Taiko injects it in the anchor
/// transaction). With this, verifying a signal is reduced to simply verifying
/// a merkle proof.
/// @custom:security-contact security@taiko.xyz
interface ISignalService is ICheckpointStore {
/// @dev DEPRECATED
/// @dev Caching is no longer supported
enum CacheOption {
CACHE_NOTHING,
CACHE_SIGNAL_ROOT,
CACHE_STATE_ROOT,
CACHE_BOTH
}
struct HopProof {
/// @notice This hop's destination chain ID. If there is a next hop, this ID is the next
/// hop's source chain ID.
uint64 chainId;
/// @notice The ID of a source chain block whose state root has been synced to the hop's
/// destination chain.
/// Note that this block ID must be greater than or equal to the block ID where the signal
/// was sent on the source chain.
uint64 blockId;
/// @notice The state root or signal root of the source chain at the above blockId. This
/// value has been synced to the destination chain.
/// @dev To get both the blockId and the rootHash, apps should subscribe to the
/// ChainDataSynced event or query `topBlockId` first using the source chain's ID and
/// LibStrings.H_STATE_ROOT to get the most recent block ID synced, then call
/// `getSyncedChainData` to read the synchronized data.
bytes32 rootHash;
/// @notice Options to cache either the state roots or signal roots of middle-hops to the
/// current chain.
/// @dev DEPRECATED - this value will be ignored
CacheOption cacheOption;
/// @notice The signal service's account proof. If this value is empty, then `rootHash` will
/// be used as the signal root, otherwise, `rootHash` will be used as the state root.
bytes[] accountProof;
/// @notice The signal service's storage proof.
bytes[] storageProof;
}
/// @notice Emitted when a signal is sent.
/// @param app The address that initiated the signal.
/// @param signal The signal (message) that was sent.
/// @param slot The location in storage where this signal is stored.
/// @param value The value of the signal.
event SignalSent(address app, bytes32 signal, bytes32 slot, bytes32 value);
/// @notice Send a signal (message) by setting the storage slot to the same value as the signal
/// itself.
/// @param _signal The signal (message) to send.
/// @return slot_ The location in storage where this signal is stored.
function sendSignal(bytes32 _signal) external returns (bytes32 slot_);
/// @notice Checks whether a signal has been received on the target chain and caches the result if successful.
/// @param _chainId The identifier for the source chain from which the
/// signal originated.
/// @param _app The address that initiated the signal.
/// @param _signal The signal (message) to send.
/// @param _proof Merkle proof that the signal was persisted on the
/// source chain. If this proof is empty, then we check if this signal has been marked as
/// received by TaikoL2.
/// @return numCacheOps_ The number of newly cached items.
function proveSignalReceived(
uint64 _chainId,
address _app,
bytes32 _signal,
bytes calldata _proof
)
external
returns (uint256 numCacheOps_);
/// @notice Verifies if a signal has been received on the target chain.
/// This is the "readonly" version of proveSignalReceived.
/// @param _chainId The identifier for the source chain from which the
/// signal originated.
/// @param _app The address that initiated the signal.
/// @param _signal The signal (message) to send.
/// @param _proof Merkle proof that the signal was persisted on the
/// source chain. If this proof is empty, then we check if this signal has been marked as
/// received by TaikoL2.
function verifySignalReceived(
uint64 _chainId,
address _app,
bytes32 _signal,
bytes calldata _proof
)
external
view;
/// @notice Verifies if a particular signal has already been sent.
/// @param _app The address that initiated the signal.
/// @param _signal The signal (message) that was sent.
/// @return true if the signal has been sent, otherwise false.
function isSignalSent(address _app, bytes32 _signal) external view returns (bool);
/// @notice Verifies if a particular signal has already been sent.
/// @param _signalSlot The location in storage where this signal is stored.
function isSignalSent(bytes32 _signalSlot) external view returns (bool);
}
node_modules/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
/**
* @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;
}
node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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;
}
node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// 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;
}
}
node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// 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);
}
}
}
node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @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;
}
node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.8.3._
*/
interface IERC1967 {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}
node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}
node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeacon.sol";
import "../../interfaces/IERC1967.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*/
abstract contract ERC1967Upgrade is IERC1967 {
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
Address.functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
Address.isContract(IBeacon(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
}
}
}
node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}
node_modules/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822.sol";
import "../ERC1967/ERC1967Upgrade.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeTo(address newImplementation) public virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
}
node_modules/@openzeppelin/contracts/utils/Address.sol
// 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);
}
}
}
node_modules/@openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}
node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
Compiler Settings
{"viaIR":false,"remappings":["openzeppelin/=node_modules/@openzeppelin/","@openzeppelin/=node_modules/@openzeppelin/","@openzeppelin-upgrades/contracts/=node_modules/@openzeppelin/contracts-upgradeable/","@risc0/contracts/=node_modules/risc0-ethereum/contracts/src/","@solady/=node_modules/solady/","solady/src/=node_modules/solady/src/","solady/utils/=node_modules/solady/src/utils/","@optimism/=node_modules/optimism/","@sp1-contracts/=node_modules/sp1-contracts/contracts/","forge-std/=node_modules/forge-std/","@p256-verifier/contracts/=node_modules/p256-verifier/src/","@eth-fabric/urc/=node_modules/urc/src/","ds-test/=node_modules/ds-test/","src/=contracts/","test/=test/","script/=script/","optimism/=node_modules/optimism/","p256-verifier/=node_modules/p256-verifier/","risc0-ethereum/=node_modules/risc0-ethereum/","sp1-contracts/=node_modules/sp1-contracts/","urc/=node_modules/urc/"],"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"prague"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_resolver","internalType":"address"},{"type":"address","name":"_signalService","internalType":"address"},{"type":"address","name":"_quotaManager","internalType":"address"},{"type":"address","name":"_pauser","internalType":"address"}]},{"type":"error","name":"ACCESS_DENIED","inputs":[]},{"type":"error","name":"B_INVALID_CHAINID","inputs":[]},{"type":"error","name":"B_INVALID_CONTEXT","inputs":[]},{"type":"error","name":"B_INVALID_FEE","inputs":[]},{"type":"error","name":"B_INVALID_GAS_LIMIT","inputs":[]},{"type":"error","name":"B_INVALID_STATUS","inputs":[]},{"type":"error","name":"B_INVALID_VALUE","inputs":[]},{"type":"error","name":"B_MESSAGE_NOT_SENT","inputs":[]},{"type":"error","name":"B_PERMISSION_DENIED","inputs":[]},{"type":"error","name":"B_PROOF_TOO_LARGE","inputs":[]},{"type":"error","name":"B_RETRY_FAILED","inputs":[]},{"type":"error","name":"B_SIGNAL_NOT_RECEIVED","inputs":[]},{"type":"error","name":"ETH_TRANSFER_FAILED","inputs":[]},{"type":"error","name":"FUNC_NOT_IMPLEMENTED","inputs":[]},{"type":"error","name":"INVALID_PAUSE_STATUS","inputs":[]},{"type":"error","name":"REENTRANT_CALL","inputs":[]},{"type":"error","name":"RESOLVER_NOT_FOUND","inputs":[]},{"type":"error","name":"ZERO_ADDRESS","inputs":[]},{"type":"error","name":"ZERO_VALUE","inputs":[]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"MessageProcessed","inputs":[{"type":"bytes32","name":"msgHash","internalType":"bytes32","indexed":true},{"type":"tuple","name":"message","internalType":"struct IBridge.Message","indexed":false,"components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"tuple","name":"stats","internalType":"struct Bridge.ProcessingStats","indexed":false,"components":[{"type":"uint32","name":"gasUsedInFeeCalc","internalType":"uint32"},{"type":"uint32","name":"proofSize","internalType":"uint32"},{"type":"uint32","name":"numCacheOps","internalType":"uint32"},{"type":"bool","name":"processedByRelayer","internalType":"bool"}]}],"anonymous":false},{"type":"event","name":"MessageSent","inputs":[{"type":"bytes32","name":"msgHash","internalType":"bytes32","indexed":true},{"type":"tuple","name":"message","internalType":"struct IBridge.Message","indexed":false,"components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}],"anonymous":false},{"type":"event","name":"MessageStatusChanged","inputs":[{"type":"bytes32","name":"msgHash","internalType":"bytes32","indexed":true},{"type":"uint8","name":"status","internalType":"enum IBridge.Status","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferStarted","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"GAS_OVERHEAD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"GAS_RESERVE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"RELAYER_MAX_PROOF_BYTES","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"acceptOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"ctx_","internalType":"struct IBridge.Context","components":[{"type":"bytes32","name":"msgHash","internalType":"bytes32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"}]}],"name":"context","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"failMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"getMessageMinGasLimit","inputs":[{"type":"uint256","name":"dataLength","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"hashMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"impl","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"inNonReentrant","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"init","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"init2","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"init3","inputs":[{"type":"bytes32[]","name":"_msgHashes","internalType":"bytes32[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"enabled_","internalType":"bool"},{"type":"address","name":"destBridge_","internalType":"address"}],"name":"isDestChainEnabled","inputs":[{"type":"uint64","name":"_chainId","internalType":"uint64"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMessageFailed","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"bytes","name":"_proof","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMessageReceived","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"bytes","name":"_proof","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMessageSent","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"status","internalType":"enum IBridge.Status"}],"name":"messageStatus","inputs":[{"type":"bytes32","name":"msgHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"nextMessageId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pauser","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingOwner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint8","name":"status_","internalType":"enum IBridge.Status"},{"type":"uint8","name":"reason_","internalType":"enum IBridge.StatusReason"}],"name":"processMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"bytes","name":"_proof","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IQuotaManager"}],"name":"quotaManager","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recallMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"bytes","name":"_proof","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"resolver","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"retryMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"bool","name":"_isLastAttempt","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"bytes32","name":"msgHash_","internalType":"bytes32"},{"type":"tuple","name":"message_","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}],"name":"sendMessage","inputs":[{"type":"tuple","name":"_message","internalType":"struct IBridge.Message","components":[{"type":"uint64","name":"id","internalType":"uint64"},{"type":"uint64","name":"fee","internalType":"uint64"},{"type":"uint32","name":"gasLimit","internalType":"uint32"},{"type":"address","name":"from","internalType":"address"},{"type":"uint64","name":"srcChainId","internalType":"uint64"},{"type":"address","name":"srcOwner","internalType":"address"},{"type":"uint64","name":"destChainId","internalType":"uint64"},{"type":"address","name":"destOwner","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"signalForFailedMessage","inputs":[{"type":"bytes32","name":"_msgHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ISignalService"}],"name":"signalService","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x61012060405230608052348015610014575f5ffd5b50604051613cc8380380613cc883398101604081905261003391610168565b8383838383610040610091565b6001600160a01b03811661006757604051634b6f57f560e01b815260040160405180910390fd5b6001600160a01b0390811660a05292831660c05290821660e0521661010052506101b99350505050565b5f54610100900460ff16156100fc5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161461014b575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b0381168114610163575f5ffd5b919050565b5f5f5f5f6080858703121561017b575f5ffd5b6101848561014d565b93506101926020860161014d565b92506101a06040860161014d565b91506101ae6060860161014d565b905092959194509250565b60805160a05160c05160e05161010051613a466102825f395f81816102300152818161066e015261285501525f818161051e015281816122e8015261233401525f81816104eb015281816108490152818161097f01528181610e2a0152818161119e015281816111e701528181611777015281816117f701528181611a9a01528181611b9e01528181611c310152611dac01525f81816102a1015261291b01525f81816114cc0152818161150c015281816115ee0152818161162e01526116a50152613a465ff3fe608060405260043610610220575f3560e01c8063715018a61161011e5780639fd0506d116100a8578063d0496d6a1161006d578063d0496d6a146106fa578063d1aaa5df14610742578063e30c397814610762578063eefbf17e1461077f578063f2fde38b146107bd575f5ffd5b80639fd0506d1461065d578063a730cdfb14610690578063b8acae0e146106a6578063be880c81146106c5578063c012fa77146106db575f5ffd5b80638abf6077116100ee5780638abf6077146105b05780638da5cb5b146105c45780638e3881a9146105e1578063913b16cb1461061f5780639efc7a2e1461063e575f5ffd5b8063715018a61461054057806379ba5097146105545780637cbadfaa146105685780638456cb591461059c575f5ffd5b80633c6cf473116101aa5780635862f6e11161016f5780635862f6e11461047c5780635c975abb1461049b57806360620c6b146104bb57806362d09453146104da57806364d391b41461050d575f5ffd5b80633c6cf473146103e25780633f4ba83a1461041d578063422770fa146104315780634f1ef2861461045557806352d1902d14610468575f5ffd5b80631bdb0037116101f05780631bdb0037146103115780631ea044bd146103325780632035065e146103515780633075db561461037e5780633659cfe6146103c3575f5ffd5b80630432873c1461027457806304f3bcec14610293578063069489a2146102de57806319ab453c146102f2575f5ffd5b3661027057336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461026e576040516372b6e1c360e11b815260040160405180910390fd5b005b5f5ffd5b34801561027f575f5ffd5b5061026e61028e366004612e34565b6107dc565b34801561029e575f5ffd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102e9575f5ffd5b5061026e610a22565b3480156102fd575f5ffd5b5061026e61030c366004612ea6565b610ad9565b61032461031f366004612ec1565b610b9f565b6040516102d592919061302e565b34801561033d575f5ffd5b5061026e61034c366004613046565b610eb1565b34801561035c575f5ffd5b5061037061036b3660046130b5565b61101f565b6040516102d5929190613172565b348015610389575f5ffd5b5060027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16145b60405190151581526020016102d5565b3480156103ce575f5ffd5b5061026e6103dd366004612ea6565b6114c2565b3480156103ed575f5ffd5b506104106103fc36600461319d565b60fc6020525f908152604090205460ff1681565b6040516102d591906131b4565b348015610428575f5ffd5b5061026e611589565b34801561043c575f5ffd5b5061044762030d4081565b6040519081526020016102d5565b61026e610463366004613288565b6115e4565b348015610473575f5ffd5b50610447611699565b348015610487575f5ffd5b506103b36104963660046130b5565b61174b565b3480156104a6575f5ffd5b506103b360c954610100900460ff1660021490565b3480156104c6575f5ffd5b506103b36104d5366004612ec1565b6117c6565b3480156104e5575f5ffd5b506102c17f000000000000000000000000000000000000000000000000000000000000000081565b348015610518575f5ffd5b506102c17f000000000000000000000000000000000000000000000000000000000000000081565b34801561054b575f5ffd5b5061026e61189a565b34801561055f575f5ffd5b5061026e6118ab565b348015610573575f5ffd5b5061058761058236600461319d565b611922565b60405163ffffffff90911681526020016102d5565b3480156105a7575f5ffd5b5061026e611940565b3480156105bb575f5ffd5b506102c1611995565b3480156105cf575f5ffd5b506033546001600160a01b03166102c1565b3480156105ec575f5ffd5b506106006105fb3660046132ea565b6119a3565b6040805192151583526001600160a01b039091166020830152016102d5565b34801561062a575f5ffd5b5061026e610639366004612ec1565b6119cf565b348015610649575f5ffd5b5061026e6106583660046130b5565b611b1d565b348015610668575f5ffd5b506102c17f000000000000000000000000000000000000000000000000000000000000000081565b34801561069b575f5ffd5b506105876201d4c081565b3480156106b1575f5ffd5b506103b36106c03660046130b5565b611d80565b3480156106d0575f5ffd5b50610587620c350081565b3480156106e6575f5ffd5b506104476106f5366004613403565b611de7565b348015610705575f5ffd5b5061070e611e16565b60408051825181526020808401516001600160a01b031690820152918101516001600160401b0316908201526060016102d5565b34801561074d575f5ffd5b5061044761075c36600461319d565b60031890565b34801561076d575f5ffd5b506065546001600160a01b03166102c1565b34801561078a575f5ffd5b5060fb546107a590600160401b90046001600160401b031681565b6040516001600160401b0390911681526020016102d5565b3480156107c8575f5ffd5b5061026e6107d7366004612ea6565b611f01565b6107ec60e0830160c084016132ea565b6107f581611f72565b61080560a08401608085016132ea565b61080e81611f9b565b610816611fd7565b61081e612009565b610828600261204e565b5f6108356106f586613434565b9050610842816001612057565b5f61086d867f00000000000000000000000000000000000000000000000000000000000000006120a9565b156108b8576108b18661012001356188b860405180602001604052805f8152508960e00160208101906108a09190612ea6565b6001600160a01b031692919061217b565b9050610932565b6108c8606087016040880161343f565b63ffffffff1615806108d75750845b801561090557506108ef610100870160e08801612ea6565b6001600160a01b0316336001600160a01b031614155b15610923576040516372b6e1c360e11b815260040160405180910390fd5b61092f86835a5f6121b8565b90505b8015610956576109468661012001356122dc565b61095182600261238f565b610a10565b84156109f75761096782600361238f565b60405163019b28af60e61b81526003831860048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906366ca2bc0906024016020604051808303815f875af11580156109cd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f19190613458565b50610a10565b60405163161e3ead60e01b815260040160405180910390fd5b5050610a1c600161204e565b50505050565b610a2a61244c565b5f54600290610100900460ff16158015610a4a57505f5460ff8083169116105b610a6f5760405162461bcd60e51b8152600401610a669061346f565b60405180910390fd5b5f805460fb805467ffffffffffffffff1916905560ff82815561010083815561ff001991851661ffff19909316831717169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b5f54610100900460ff1615808015610af757505f54600160ff909116105b80610b105750303b158015610b1057505f5460ff166001145b610b2c5760405162461bcd60e51b8152600401610a669061346f565b5f805460ff191660011790558015610b4d575f805461ff0019166101001790555b610b56826124a6565b8015610b9b575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60408051610160810182525f8082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820183905261010082018390526101208201839052610140820152610c0560c0840160a08501612ea6565b610c0e81612504565b610c1f610100850160e08601612ea6565b610c2881612504565b610c3a61012086016101008701612ea6565b610c4381612504565b610c5360e0870160c088016132ea565b610c5c81611f9b565b610c64611fd7565b610c6c612009565b610c76600261204e565b610c86606088016040890161343f565b63ffffffff165f03610cce57610ca260408801602089016132ea565b6001600160401b031615610cc95760405163c9f5178760e01b815260040160405180910390fd5b610cf6565b610cd78761252b565b5f03610cf6576040516308c2ad5360e01b815260040160405180910390fd5b5f610d0a6105fb60e08a0160c08b016132ea565b50905080610d2b57604051631c6c777560e31b815260040160405180910390fd5b34610d3c60408a0160208b016132ea565b610d54906001600160401b03166101208b01356134d1565b14610d7257604051634ac2abdf60e11b815260040160405180910390fd5b610d7b88613434565b60fb8054919750600160401b9091046001600160401b0316906008610d9f836134e4565b82546101009290920a6001600160401b03818102199093169183160217909155908116875233606088015246166080870152610dda86611de7565b9650867fe33fd33b4f45b95b1c196242240c5b5233129d724b578f95b66ce8d8aae9351787604051610e0c919061350e565b60405180910390a260405163019b28af60e61b8152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906366ca2bc0906024016020604051808303815f875af1158015610e78573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e9c9190613458565b5050610ea8600161204e565b50505050915091565b610eb961244c565b5f54600390610100900460ff16158015610ed957505f5460ff8083169116105b610ef55760405162461bcd60e51b8152600401610a669061346f565b5f805461ffff191660ff831617610100178155829003610f2857604051634ac2abdf60e11b815260040160405180910390fd5b5f5b82811015610fd957600260fc5f868685818110610f4957610f49613520565b602090810292909201358352508101919091526040015f20805460ff19166001836004811115610f7b57610f7b61314a565b0217905550838382818110610f9257610f92613520565b905060200201357f6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b25756346002604051610fc991906131b4565b60405180910390a2600101610f2a565b505f805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b5f5f611029611fd7565b611031612009565b61103b600261204e565b5f5a90504661105060e0880160c089016132ea565b6001600160401b03161461107757604051631c6c777560e31b815260040160405180910390fd5b61108760a08701608088016132ea565b6001600160401b031615806110b35750466110a860a08801608089016132ea565b6001600160401b0316145b156110d157604051631c6c777560e31b815260040160405180910390fd5b604080516080810182525f808252602082018190529181018290526060810191909152611105610100880160e08901612ea6565b6001600160a01b03163314801560608301526111745761112b606088016040890161343f565b63ffffffff165f03611150576040516372b6e1c360e11b815260040160405180910390fd5b62030d4085111561117457604051631e3b03c960e01b815260040160405180910390fd5b5f6111816106f589613434565b905061118d815f612057565b63ffffffff861660208301526111d57f0000000000000000000000000000000000000000000000000000000000000000826111ce60a08c0160808d016132ea565b8a8a61257e565b63ffffffff1660408301525f61120b897f00000000000000000000000000000000000000000000000000000000000000006120a9565b156112245750600294506001935061012088013561126b565b5f8360600151611234575a61123d565b61123d8a61252b565b905061124f8a848387606001516121b8565b1561126057600296505f9550611269565b60019650600295505b505b6112d260028760048111156112825761128261314a565b146112a55761129760408b0160208c016132ea565b6001600160401b03166122dc565b6112b560408b0160208c016132ea565b6112cd906001600160401b03166101208c01356134d1565b6122dc565b6112e260408a0160208b016132ea565b6001600160401b0316156114405761130060408a0160208b016132ea565b611313906001600160401b0316826134d1565b90508260600151801561133a575061133160608a0160408b0161343f565b63ffffffff1615155b1561144057604083015163ffffffff16614e20025a6113776113606101408d018d613534565b6020601f909101819004026101a00160041b919050565b63ffffffff9081168701919091036201d4c00181168086525f9183916113a09183919061262916565b0390505f6113b460608d0160408e0161343f565b63ffffffff166113ca60408e0160208f016132ea565b6001600160401b03168302816113e2576113e261357d565b0490505f48830290505f6114268e602001602081019061140291906132ea565b6001600160401b03168484101561141e5784840160011c611420565b845b9061263e565b9586900395905061143a33826188b8612652565b50505050505b611468816188b86114586101008d0160e08e01612ea6565b6001600160a01b03169190612652565b611472828761238f565b817f8580f507761043ecdd2bdca084d6fb0109150b3d9842d854d34e3dea6d69387d8a856040516114a4929190613715565b60405180910390a2505050506114ba600161204e565b935093915050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361150a5760405162461bcd60e51b8152600401610a6690613769565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661153c612695565b6001600160a01b0316146115625760405162461bcd60e51b8152600401610a66906137b5565b61156b816126b0565b604080515f80825260208201909252611586918391906126b8565b50565b611591612822565b6115a560c9805461ff001916610100179055565b6040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9060200160405180910390a16115e2335f612853565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361162c5760405162461bcd60e51b8152600401610a6690613769565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661165e612695565b6001600160a01b0316146116845760405162461bcd60e51b8152600401610a66906137b5565b61168d826126b0565b610b9b828260016126b8565b5f306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117385760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610a66565b505f5160206139ca5f395f51905f525b90565b5f4661175d60a08601608087016132ea565b6001600160401b03161461177257505f6117bf565b6117bc7f00000000000000000000000000000000000000000000000000000000000000006117a561075c6106f588613434565b6117b560e0880160c089016132ea565b868661287d565b90505b9392505050565b5f466117d860a08401608085016132ea565b6001600160401b0316146117ed57505f919050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166332676bc6306118296106f586613434565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015611870573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118949190613801565b92915050565b6118a261244c565b6115e25f6128ff565b60655433906001600160a01b031681146119195760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a66565b611586816128ff565b5f611894620c35006101a06020601f8601819004020160041b61381c565b611948611fd7565b60c9805461ff0019166102001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589060200160405180910390a16115e2336001612853565b5f61199e612695565b905090565b5f5f6119ba836562726964676560d01b6001612918565b6001600160a01b038116151594909350915050565b6119df60e0820160c083016132ea565b6119e881611f72565b6119f860a08301608084016132ea565b611a0181611f9b565b611a09611fd7565b611a11612009565b611a1b600261204e565b611a2c610100840160e08501612ea6565b6001600160a01b0316336001600160a01b031614611a5d576040516372b6e1c360e11b815260040160405180910390fd5b5f611a6a6106f585613434565b9050611a77816001612057565b611a8281600361238f565b60405163019b28af60e61b81526003821860048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906366ca2bc0906024016020604051808303815f875af1158015611ae8573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b0c9190613458565b5050611b18600161204e565b505050565b611b2d60a08401608085016132ea565b611b3681611f72565b611b4660e0850160c086016132ea565b611b4f81611f9b565b611b57611fd7565b611b5f612009565b611b69600261204e565b5f611b766106f587613434565b9050611b82815f612057565b604051631933b5e360e11b8152306004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906332676bc690604401602060405180830381865afa158015611beb573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c0f9190613801565b611c2c5760405163ab035ad560e01b815260040160405180910390fd5b611c6b7f000000000000000000000000000000000000000000000000000000000000000060038318611c6460e08a0160c08b016132ea565b888861257e565b50611c7781600461238f565b611c858661012001356122dc565b611cae62bc399d60e11b611c9f6080890160608a01612ea6565b6001600160a01b0316906129ba565b15611d5257611ccd8130611cc860a08a0160808b016132ea565b612a8a565b611cdd6080870160608801612ea6565b6001600160a01b0316630178733a87610120013588846040518463ffffffff1660e01b8152600401611d10929190613838565b5f604051808303818588803b158015611d27575f5ffd5b505af1158015611d39573d5f5f3e3d5ffd5b5050505050611d4d5f195f1b5f1980612a8a565b611d6e565b611d6e6101208701356188b861145860c08a0160a08b01612ea6565b50611d79600161204e565b5050505050565b5f46611d9260e0860160c087016132ea565b6001600160401b031614611da757505f6117bf565b6117bc7f0000000000000000000000000000000000000000000000000000000000000000611dd76106f587613434565b6117b560a08801608089016132ea565b5f81604051602001611df99190613859565b604051602081830303815290604052805190602001209050919050565b60408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2b95c8082526001600160a01b037fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2ba5c16928201929092526001600160401b037fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2bb5c16928101929092521580611ee3575080515f19145b1561174857604051635ceed17360e01b815260040160405180910390fd5b611f0961244c565b606580546001600160a01b0383166001600160a01b03199091168117909155611f3a6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b46816001600160401b03161461158657604051631c6c777560e31b815260040160405180910390fd5b6001600160401b0381161580611fb9575046816001600160401b0316145b1561158657604051631c6c777560e31b815260040160405180910390fd5b611feb60c954610100900460ff1660021490565b156115e25760405163bae6e2a960e01b815260040160405180910390fd5b60027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16036115e25760405163dfc60d8560e01b815260040160405180910390fd5b61158681612af8565b8060048111156120695761206961314a565b5f83815260fc602052604090205460ff16600481111561208b5761208b61314a565b14610b9b576040516319d893ad60e21b815260040160405180910390fd5b5f806120bd61012085016101008601612ea6565b6001600160a01b0316036120d357506001611894565b306120e661012085016101008601612ea6565b6001600160a01b0316036120fc57506001611894565b6001600160a01b03821661211861012085016101008601612ea6565b6001600160a01b03160361212e57506001611894565b600461213e610140850185613534565b9050101580156117bf5750637f07c94760e01b61215f610140850185613534565b6121689161388f565b6001600160e01b03191614159392505050565b5f6001600160a01b0385166121a357604051634c67134d60e11b815260040160405180910390fd5b5f5f835160208501878988f195945050505050565b5f306121ca6080870160608801612ea6565b6001600160a01b0316036121e0576121e06138c7565b61012085013515801561220057506121fc610140860186613534565b1590505b1561220d575060016122d4565b825f0361221b57505f6122d4565b61223f8461222f6080880160608901612ea6565b611cc860a0890160808a016132ea565b5f61225261012087016101008801612ea6565b90506101208601355f612269610140890189613534565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525084519495509384935083925090506020850186888cf194505a905085156122c3576122c38188612b1e565b6122cf5f198080612a8a565b505050505b949350505050565b801580159061231357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15611586576040516315c638fb60e31b81525f6004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ae31c7d8906044015f604051808303815f87803b15801561237d575f5ffd5b505af1158015611d79573d5f5f3e3d5ffd5b8060048111156123a1576123a161314a565b5f83815260fc602052604090205460ff1660048111156123c3576123c361314a565b036123e1576040516319d893ad60e21b815260040160405180910390fd5b5f82815260fc60205260409020805482919060ff1916600183600481111561240b5761240b61314a565b0217905550817f6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b25756348260405161244091906131b4565b60405180910390a25050565b6033546001600160a01b031633146115e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a66565b5f54610100900460ff166124cc5760405162461bcd60e51b8152600401610a66906138db565b6124d4612b32565b6124f26001600160a01b038216156124ec57816128ff565b336128ff565b5060c9805461ff001916610100179055565b6001600160a01b0381166115865760405163538ba4f960e01b815260040160405180910390fd5b5f8061254561253e610140850185613534565b9050611922565b63ffffffff16905080612576612561606086016040870161343f565b63ffffffff168361262990919063ffffffff16565b039392505050565b5f856001600160a01b031663910af6ed856125a3876562726964676560d01b5f612918565b8887876040518663ffffffff1660e01b81526004016125c6959493929190613926565b6020604051808303815f875af1925050508015612600575060408051601f3d908101601f191682019092526125fd91810190613458565b60015b61261d576040516314504c7360e31b815260040160405180910390fd5b90505b95945050505050565b5f81831161263757816117bf565b5090919050565b5f81831161264c57826117bf565b50919050565b815f0361265e57505050565b61267883838360405180602001604052805f81525061217b565b611b1857604051634c67134d60e11b815260040160405180910390fd5b5f5160206139ca5f395f51905f52546001600160a01b031690565b61158661244c565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126eb57611b1883612b58565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612745575060408051601f3d908101601f1916820190925261274291810190613458565b60015b6127a85760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610a66565b5f5160206139ca5f395f51905f5281146128165760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610a66565b50611b18838383612bf3565b61283660c954610100900460ff1660021490565b6115e25760405163bae6e2a960e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000611b1881612c17565b5f856001600160a01b031663ce9d0820856128a2876562726964676560d01b5f612918565b8887876040518663ffffffff1660e01b81526004016128c5959493929190613926565b5f6040518083038186803b1580156128db575f5ffd5b505afa9250505080156128ec575060015b6128f757505f612620565b506001612620565b606580546001600160a01b031916905561158681612c55565b5f7f0000000000000000000000000000000000000000000000000000000000000000604051633632b1fb60e11b81526001600160401b03861660048201526024810185905283151560448201526001600160a01b039190911690636c6563f690606401602060405180830381865afa158015612996573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117bc9190613967565b6040516001600160e01b0319821660248201525f90819081906001600160a01b0386169060440160408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b17905251612a169190613982565b5f60405180830381855afa9150503d805f8114612a4e576040519150601f19603f3d011682016040523d82523d5f602084013e612a53565b606091505b5091509150818015612a66575080516020145b15612a825780806020019051810190612a7f9190613801565b92505b505092915050565b827fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2b95d817fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2ba5d807fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2bb5d505050565b807fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5d50565b612b29603f82613998565b821015610b9b57fe5b5f54610100900460ff166115e25760405162461bcd60e51b8152600401610a66906138db565b6001600160a01b0381163b612bc55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610a66565b5f5160206139ca5f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b612bfc83612ca6565b5f82511180612c085750805b15611b1857610a1c8383612ce5565b6033546001600160a01b0316331480612c385750336001600160a01b038216145b611586576040516395383ea160e01b815260040160405180910390fd5b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b612caf81612b58565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b60606117bf83836040518060600160405280602781526020016139ea6027913960605f5f856001600160a01b031685604051612d219190613982565b5f60405180830381855af49150503d805f8114612d59576040519150601f19603f3d011682016040523d82523d5f602084013e612d5e565b606091505b5091509150612d6f86838387612d79565b9695505050505050565b60608315612de75782515f03612de0576001600160a01b0385163b612de05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a66565b50816122d4565b6122d48383815115612dfc5781518083602001fd5b8060405162461bcd60e51b8152600401610a6691906139b7565b5f610160828403121561264c575f5ffd5b8015158114611586575f5ffd5b5f5f60408385031215612e45575f5ffd5b82356001600160401b03811115612e5a575f5ffd5b612e6685828601612e16565b9250506020830135612e7781612e27565b809150509250929050565b6001600160a01b0381168114611586575f5ffd5b8035612ea181612e82565b919050565b5f60208284031215612eb6575f5ffd5b81356117bf81612e82565b5f60208284031215612ed1575f5ffd5b81356001600160401b03811115612ee6575f5ffd5b6122d484828501612e16565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b80516001600160401b031682525f6020820151612f4860208501826001600160401b03169052565b506040820151612f60604085018263ffffffff169052565b506060820151612f7b60608501826001600160a01b03169052565b506080820151612f9660808501826001600160401b03169052565b5060a0820151612fb160a08501826001600160a01b03169052565b5060c0820151612fcc60c08501826001600160401b03169052565b5060e0820151612fe760e08501826001600160a01b03169052565b506101008201516130046101008501826001600160a01b03169052565b506101208201516101208401526101408201516101606101408501526122d4610160850182612ef2565b828152604060208201525f6117bc6040830184612f20565b5f5f60208385031215613057575f5ffd5b82356001600160401b0381111561306c575f5ffd5b8301601f8101851361307c575f5ffd5b80356001600160401b03811115613091575f5ffd5b8560208260051b84010111156130a5575f5ffd5b6020919091019590945092505050565b5f5f5f604084860312156130c7575f5ffd5b83356001600160401b038111156130dc575f5ffd5b6130e886828701612e16565b93505060208401356001600160401b03811115613103575f5ffd5b8401601f81018613613113575f5ffd5b80356001600160401b03811115613128575f5ffd5b866020828401011115613139575f5ffd5b939660209190910195509293505050565b634e487b7160e01b5f52602160045260245ffd5b6005811061316e5761316e61314a565b9052565b60408101613180828561315e565b600483106131905761319061314a565b8260208301529392505050565b5f602082840312156131ad575f5ffd5b5035919050565b60208101611894828461315e565b634e487b7160e01b5f52604160045260245ffd5b60405161016081016001600160401b03811182821017156131f9576131f96131c2565b60405290565b5f82601f83011261320e575f5ffd5b81356001600160401b03811115613227576132276131c2565b604051601f8201601f19908116603f011681016001600160401b0381118282101715613255576132556131c2565b60405281815283820160200185101561326c575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f60408385031215613299575f5ffd5b82356132a481612e82565b915060208301356001600160401b038111156132be575f5ffd5b6132ca858286016131ff565b9150509250929050565b80356001600160401b0381168114612ea1575f5ffd5b5f602082840312156132fa575f5ffd5b6117bf826132d4565b803563ffffffff81168114612ea1575f5ffd5b5f6101608284031215613327575f5ffd5b61332f6131d6565b905061333a826132d4565b8152613348602083016132d4565b602082015261335960408301613303565b604082015261336a60608301612e96565b606082015261337b608083016132d4565b608082015261338c60a08301612e96565b60a082015261339d60c083016132d4565b60c08201526133ae60e08301612e96565b60e08201526133c06101008301612e96565b61010082015261012082810135908201526101408201356001600160401b038111156133ea575f5ffd5b6133f6848285016131ff565b6101408301525092915050565b5f60208284031215613413575f5ffd5b81356001600160401b03811115613428575f5ffd5b6122d484828501613316565b5f6118943683613316565b5f6020828403121561344f575f5ffd5b6117bf82613303565b5f60208284031215613468575f5ffd5b5051919050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611894576118946134bd565b5f6001600160401b0382166001600160401b038103613505576135056134bd565b60010192915050565b602081525f6117bf6020830184612f20565b634e487b7160e01b5f52603260045260245ffd5b5f5f8335601e19843603018112613549575f5ffd5b8301803591506001600160401b03821115613562575f5ffd5b602001915036819003821315613576575f5ffd5b9250929050565b634e487b7160e01b5f52601260045260245ffd5b5f5f8335601e198436030181126135a6575f5ffd5b83016020810192503590506001600160401b038111156135c4575f5ffd5b803603821315613576575f5ffd5b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b61361482613607836132d4565b6001600160401b03169052565b5f613621602083016132d4565b6001600160401b0316602084015261363b60408301613303565b63ffffffff16604084015261365260608301612e96565b6001600160a01b0316606084015261366c608083016132d4565b6001600160401b0316608084015261368660a08301612e96565b6001600160a01b031660a08401526136a060c083016132d4565b6001600160401b031660c08401526136ba60e08301612e96565b6001600160a01b031660e08401526136d56101008301612e96565b6001600160a01b031661010084015261012082810135908401526136fd610140830183613591565b610160610140860152612a7f610160860182846135d2565b60a081525f61372760a08301856135fa565b905063ffffffff835116602083015263ffffffff602084015116604083015263ffffffff60408401511660608301526060830151151560808301529392505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b5f60208284031215613811575f5ffd5b81516117bf81612e27565b63ffffffff8181168382160190811115611894576118946134bd565b604081525f61384a60408301856135fa565b90508260208301529392505050565b60408152600d60408201526c5441494b4f5f4d45535341474560981b6060820152608060208201525f6117bf6080830184612f20565b80356001600160e01b031981169060048410156138c0576001600160e01b0319600485900360031b81901b82161691505b5092915050565b634e487b7160e01b5f52600160045260245ffd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160401b038616815260018060a01b0385166020820152836040820152608060608201525f61395c6080830184866135d2565b979650505050505050565b5f60208284031215613977575f5ffd5b81516117bf81612e82565b5f82518060208501845e5f920191825250919050565b5f826139b257634e487b7160e01b5f52601260045260245ffd5b500490565b602081525f6117bf6020830184612ef256fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122067b7f250eaf18a6887bcacd1cdb910b16ebf50961a787535f39677c1746811f564736f6c634300081e0033000000000000000000000000a20182131658295f37c1a1efdbdc89eff97d9c580000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004779d18931b35540f84b0cd0e9633855b84df7b8
Deployed ByteCode
0x608060405260043610610220575f3560e01c8063715018a61161011e5780639fd0506d116100a8578063d0496d6a1161006d578063d0496d6a146106fa578063d1aaa5df14610742578063e30c397814610762578063eefbf17e1461077f578063f2fde38b146107bd575f5ffd5b80639fd0506d1461065d578063a730cdfb14610690578063b8acae0e146106a6578063be880c81146106c5578063c012fa77146106db575f5ffd5b80638abf6077116100ee5780638abf6077146105b05780638da5cb5b146105c45780638e3881a9146105e1578063913b16cb1461061f5780639efc7a2e1461063e575f5ffd5b8063715018a61461054057806379ba5097146105545780637cbadfaa146105685780638456cb591461059c575f5ffd5b80633c6cf473116101aa5780635862f6e11161016f5780635862f6e11461047c5780635c975abb1461049b57806360620c6b146104bb57806362d09453146104da57806364d391b41461050d575f5ffd5b80633c6cf473146103e25780633f4ba83a1461041d578063422770fa146104315780634f1ef2861461045557806352d1902d14610468575f5ffd5b80631bdb0037116101f05780631bdb0037146103115780631ea044bd146103325780632035065e146103515780633075db561461037e5780633659cfe6146103c3575f5ffd5b80630432873c1461027457806304f3bcec14610293578063069489a2146102de57806319ab453c146102f2575f5ffd5b3661027057336001600160a01b037f0000000000000000000000004779d18931b35540f84b0cd0e9633855b84df7b8161461026e576040516372b6e1c360e11b815260040160405180910390fd5b005b5f5ffd5b34801561027f575f5ffd5b5061026e61028e366004612e34565b6107dc565b34801561029e575f5ffd5b507f000000000000000000000000a20182131658295f37c1a1efdbdc89eff97d9c585b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102e9575f5ffd5b5061026e610a22565b3480156102fd575f5ffd5b5061026e61030c366004612ea6565b610ad9565b61032461031f366004612ec1565b610b9f565b6040516102d592919061302e565b34801561033d575f5ffd5b5061026e61034c366004613046565b610eb1565b34801561035c575f5ffd5b5061037061036b3660046130b5565b61101f565b6040516102d5929190613172565b348015610389575f5ffd5b5060027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16145b60405190151581526020016102d5565b3480156103ce575f5ffd5b5061026e6103dd366004612ea6565b6114c2565b3480156103ed575f5ffd5b506104106103fc36600461319d565b60fc6020525f908152604090205460ff1681565b6040516102d591906131b4565b348015610428575f5ffd5b5061026e611589565b34801561043c575f5ffd5b5061044762030d4081565b6040519081526020016102d5565b61026e610463366004613288565b6115e4565b348015610473575f5ffd5b50610447611699565b348015610487575f5ffd5b506103b36104963660046130b5565b61174b565b3480156104a6575f5ffd5b506103b360c954610100900460ff1660021490565b3480156104c6575f5ffd5b506103b36104d5366004612ec1565b6117c6565b3480156104e5575f5ffd5b506102c17f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc81565b348015610518575f5ffd5b506102c17f000000000000000000000000000000000000000000000000000000000000000081565b34801561054b575f5ffd5b5061026e61189a565b34801561055f575f5ffd5b5061026e6118ab565b348015610573575f5ffd5b5061058761058236600461319d565b611922565b60405163ffffffff90911681526020016102d5565b3480156105a7575f5ffd5b5061026e611940565b3480156105bb575f5ffd5b506102c1611995565b3480156105cf575f5ffd5b506033546001600160a01b03166102c1565b3480156105ec575f5ffd5b506106006105fb3660046132ea565b6119a3565b6040805192151583526001600160a01b039091166020830152016102d5565b34801561062a575f5ffd5b5061026e610639366004612ec1565b6119cf565b348015610649575f5ffd5b5061026e6106583660046130b5565b611b1d565b348015610668575f5ffd5b506102c17f0000000000000000000000004779d18931b35540f84b0cd0e9633855b84df7b881565b34801561069b575f5ffd5b506105876201d4c081565b3480156106b1575f5ffd5b506103b36106c03660046130b5565b611d80565b3480156106d0575f5ffd5b50610587620c350081565b3480156106e6575f5ffd5b506104476106f5366004613403565b611de7565b348015610705575f5ffd5b5061070e611e16565b60408051825181526020808401516001600160a01b031690820152918101516001600160401b0316908201526060016102d5565b34801561074d575f5ffd5b5061044761075c36600461319d565b60031890565b34801561076d575f5ffd5b506065546001600160a01b03166102c1565b34801561078a575f5ffd5b5060fb546107a590600160401b90046001600160401b031681565b6040516001600160401b0390911681526020016102d5565b3480156107c8575f5ffd5b5061026e6107d7366004612ea6565b611f01565b6107ec60e0830160c084016132ea565b6107f581611f72565b61080560a08401608085016132ea565b61080e81611f9b565b610816611fd7565b61081e612009565b610828600261204e565b5f6108356106f586613434565b9050610842816001612057565b5f61086d867f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6120a9565b156108b8576108b18661012001356188b860405180602001604052805f8152508960e00160208101906108a09190612ea6565b6001600160a01b031692919061217b565b9050610932565b6108c8606087016040880161343f565b63ffffffff1615806108d75750845b801561090557506108ef610100870160e08801612ea6565b6001600160a01b0316336001600160a01b031614155b15610923576040516372b6e1c360e11b815260040160405180910390fd5b61092f86835a5f6121b8565b90505b8015610956576109468661012001356122dc565b61095182600261238f565b610a10565b84156109f75761096782600361238f565b60405163019b28af60e61b81526003831860048201527f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6001600160a01b0316906366ca2bc0906024016020604051808303815f875af11580156109cd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f19190613458565b50610a10565b60405163161e3ead60e01b815260040160405180910390fd5b5050610a1c600161204e565b50505050565b610a2a61244c565b5f54600290610100900460ff16158015610a4a57505f5460ff8083169116105b610a6f5760405162461bcd60e51b8152600401610a669061346f565b60405180910390fd5b5f805460fb805467ffffffffffffffff1916905560ff82815561010083815561ff001991851661ffff19909316831717169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b5f54610100900460ff1615808015610af757505f54600160ff909116105b80610b105750303b158015610b1057505f5460ff166001145b610b2c5760405162461bcd60e51b8152600401610a669061346f565b5f805460ff191660011790558015610b4d575f805461ff0019166101001790555b610b56826124a6565b8015610b9b575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60408051610160810182525f8082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820183905261010082018390526101208201839052610140820152610c0560c0840160a08501612ea6565b610c0e81612504565b610c1f610100850160e08601612ea6565b610c2881612504565b610c3a61012086016101008701612ea6565b610c4381612504565b610c5360e0870160c088016132ea565b610c5c81611f9b565b610c64611fd7565b610c6c612009565b610c76600261204e565b610c86606088016040890161343f565b63ffffffff165f03610cce57610ca260408801602089016132ea565b6001600160401b031615610cc95760405163c9f5178760e01b815260040160405180910390fd5b610cf6565b610cd78761252b565b5f03610cf6576040516308c2ad5360e01b815260040160405180910390fd5b5f610d0a6105fb60e08a0160c08b016132ea565b50905080610d2b57604051631c6c777560e31b815260040160405180910390fd5b34610d3c60408a0160208b016132ea565b610d54906001600160401b03166101208b01356134d1565b14610d7257604051634ac2abdf60e11b815260040160405180910390fd5b610d7b88613434565b60fb8054919750600160401b9091046001600160401b0316906008610d9f836134e4565b82546101009290920a6001600160401b03818102199093169183160217909155908116875233606088015246166080870152610dda86611de7565b9650867fe33fd33b4f45b95b1c196242240c5b5233129d724b578f95b66ce8d8aae9351787604051610e0c919061350e565b60405180910390a260405163019b28af60e61b8152600481018890527f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6001600160a01b0316906366ca2bc0906024016020604051808303815f875af1158015610e78573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e9c9190613458565b5050610ea8600161204e565b50505050915091565b610eb961244c565b5f54600390610100900460ff16158015610ed957505f5460ff8083169116105b610ef55760405162461bcd60e51b8152600401610a669061346f565b5f805461ffff191660ff831617610100178155829003610f2857604051634ac2abdf60e11b815260040160405180910390fd5b5f5b82811015610fd957600260fc5f868685818110610f4957610f49613520565b602090810292909201358352508101919091526040015f20805460ff19166001836004811115610f7b57610f7b61314a565b0217905550838382818110610f9257610f92613520565b905060200201357f6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b25756346002604051610fc991906131b4565b60405180910390a2600101610f2a565b505f805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b5f5f611029611fd7565b611031612009565b61103b600261204e565b5f5a90504661105060e0880160c089016132ea565b6001600160401b03161461107757604051631c6c777560e31b815260040160405180910390fd5b61108760a08701608088016132ea565b6001600160401b031615806110b35750466110a860a08801608089016132ea565b6001600160401b0316145b156110d157604051631c6c777560e31b815260040160405180910390fd5b604080516080810182525f808252602082018190529181018290526060810191909152611105610100880160e08901612ea6565b6001600160a01b03163314801560608301526111745761112b606088016040890161343f565b63ffffffff165f03611150576040516372b6e1c360e11b815260040160405180910390fd5b62030d4085111561117457604051631e3b03c960e01b815260040160405180910390fd5b5f6111816106f589613434565b905061118d815f612057565b63ffffffff861660208301526111d57f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc826111ce60a08c0160808d016132ea565b8a8a61257e565b63ffffffff1660408301525f61120b897f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6120a9565b156112245750600294506001935061012088013561126b565b5f8360600151611234575a61123d565b61123d8a61252b565b905061124f8a848387606001516121b8565b1561126057600296505f9550611269565b60019650600295505b505b6112d260028760048111156112825761128261314a565b146112a55761129760408b0160208c016132ea565b6001600160401b03166122dc565b6112b560408b0160208c016132ea565b6112cd906001600160401b03166101208c01356134d1565b6122dc565b6112e260408a0160208b016132ea565b6001600160401b0316156114405761130060408a0160208b016132ea565b611313906001600160401b0316826134d1565b90508260600151801561133a575061133160608a0160408b0161343f565b63ffffffff1615155b1561144057604083015163ffffffff16614e20025a6113776113606101408d018d613534565b6020601f909101819004026101a00160041b919050565b63ffffffff9081168701919091036201d4c00181168086525f9183916113a09183919061262916565b0390505f6113b460608d0160408e0161343f565b63ffffffff166113ca60408e0160208f016132ea565b6001600160401b03168302816113e2576113e261357d565b0490505f48830290505f6114268e602001602081019061140291906132ea565b6001600160401b03168484101561141e5784840160011c611420565b845b9061263e565b9586900395905061143a33826188b8612652565b50505050505b611468816188b86114586101008d0160e08e01612ea6565b6001600160a01b03169190612652565b611472828761238f565b817f8580f507761043ecdd2bdca084d6fb0109150b3d9842d854d34e3dea6d69387d8a856040516114a4929190613715565b60405180910390a2505050506114ba600161204e565b935093915050565b6001600160a01b037f000000000000000000000000aa22e95f5bf27e07c02e6cc41a700597832fa30d16300361150a5760405162461bcd60e51b8152600401610a6690613769565b7f000000000000000000000000aa22e95f5bf27e07c02e6cc41a700597832fa30d6001600160a01b031661153c612695565b6001600160a01b0316146115625760405162461bcd60e51b8152600401610a66906137b5565b61156b816126b0565b604080515f80825260208201909252611586918391906126b8565b50565b611591612822565b6115a560c9805461ff001916610100179055565b6040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9060200160405180910390a16115e2335f612853565b565b6001600160a01b037f000000000000000000000000aa22e95f5bf27e07c02e6cc41a700597832fa30d16300361162c5760405162461bcd60e51b8152600401610a6690613769565b7f000000000000000000000000aa22e95f5bf27e07c02e6cc41a700597832fa30d6001600160a01b031661165e612695565b6001600160a01b0316146116845760405162461bcd60e51b8152600401610a66906137b5565b61168d826126b0565b610b9b828260016126b8565b5f306001600160a01b037f000000000000000000000000aa22e95f5bf27e07c02e6cc41a700597832fa30d16146117385760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610a66565b505f5160206139ca5f395f51905f525b90565b5f4661175d60a08601608087016132ea565b6001600160401b03161461177257505f6117bf565b6117bc7f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6117a561075c6106f588613434565b6117b560e0880160c089016132ea565b868661287d565b90505b9392505050565b5f466117d860a08401608085016132ea565b6001600160401b0316146117ed57505f919050565b6001600160a01b037f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc166332676bc6306118296106f586613434565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015611870573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118949190613801565b92915050565b6118a261244c565b6115e25f6128ff565b60655433906001600160a01b031681146119195760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a66565b611586816128ff565b5f611894620c35006101a06020601f8601819004020160041b61381c565b611948611fd7565b60c9805461ff0019166102001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589060200160405180910390a16115e2336001612853565b5f61199e612695565b905090565b5f5f6119ba836562726964676560d01b6001612918565b6001600160a01b038116151594909350915050565b6119df60e0820160c083016132ea565b6119e881611f72565b6119f860a08301608084016132ea565b611a0181611f9b565b611a09611fd7565b611a11612009565b611a1b600261204e565b611a2c610100840160e08501612ea6565b6001600160a01b0316336001600160a01b031614611a5d576040516372b6e1c360e11b815260040160405180910390fd5b5f611a6a6106f585613434565b9050611a77816001612057565b611a8281600361238f565b60405163019b28af60e61b81526003821860048201527f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6001600160a01b0316906366ca2bc0906024016020604051808303815f875af1158015611ae8573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b0c9190613458565b5050611b18600161204e565b505050565b611b2d60a08401608085016132ea565b611b3681611f72565b611b4660e0850160c086016132ea565b611b4f81611f9b565b611b57611fd7565b611b5f612009565b611b69600261204e565b5f611b766106f587613434565b9050611b82815f612057565b604051631933b5e360e11b8152306004820152602481018290527f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc6001600160a01b0316906332676bc690604401602060405180830381865afa158015611beb573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c0f9190613801565b611c2c5760405163ab035ad560e01b815260040160405180910390fd5b611c6b7f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc60038318611c6460e08a0160c08b016132ea565b888861257e565b50611c7781600461238f565b611c858661012001356122dc565b611cae62bc399d60e11b611c9f6080890160608a01612ea6565b6001600160a01b0316906129ba565b15611d5257611ccd8130611cc860a08a0160808b016132ea565b612a8a565b611cdd6080870160608801612ea6565b6001600160a01b0316630178733a87610120013588846040518463ffffffff1660e01b8152600401611d10929190613838565b5f604051808303818588803b158015611d27575f5ffd5b505af1158015611d39573d5f5f3e3d5ffd5b5050505050611d4d5f195f1b5f1980612a8a565b611d6e565b611d6e6101208701356188b861145860c08a0160a08b01612ea6565b50611d79600161204e565b5050505050565b5f46611d9260e0860160c087016132ea565b6001600160401b031614611da757505f6117bf565b6117bc7f0000000000000000000000004e5099105ab4c73cf227abcdd0d5e1802ae936dc611dd76106f587613434565b6117b560a08801608089016132ea565b5f81604051602001611df99190613859565b604051602081830303815290604052805190602001209050919050565b60408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2b95c8082526001600160a01b037fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2ba5c16928201929092526001600160401b037fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2bb5c16928101929092521580611ee3575080515f19145b1561174857604051635ceed17360e01b815260040160405180910390fd5b611f0961244c565b606580546001600160a01b0383166001600160a01b03199091168117909155611f3a6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b46816001600160401b03161461158657604051631c6c777560e31b815260040160405180910390fd5b6001600160401b0381161580611fb9575046816001600160401b0316145b1561158657604051631c6c777560e31b815260040160405180910390fd5b611feb60c954610100900460ff1660021490565b156115e25760405163bae6e2a960e01b815260040160405180910390fd5b60027fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5c60ff16036115e25760405163dfc60d8560e01b815260040160405180910390fd5b61158681612af8565b8060048111156120695761206961314a565b5f83815260fc602052604090205460ff16600481111561208b5761208b61314a565b14610b9b576040516319d893ad60e21b815260040160405180910390fd5b5f806120bd61012085016101008601612ea6565b6001600160a01b0316036120d357506001611894565b306120e661012085016101008601612ea6565b6001600160a01b0316036120fc57506001611894565b6001600160a01b03821661211861012085016101008601612ea6565b6001600160a01b03160361212e57506001611894565b600461213e610140850185613534565b9050101580156117bf5750637f07c94760e01b61215f610140850185613534565b6121689161388f565b6001600160e01b03191614159392505050565b5f6001600160a01b0385166121a357604051634c67134d60e11b815260040160405180910390fd5b5f5f835160208501878988f195945050505050565b5f306121ca6080870160608801612ea6565b6001600160a01b0316036121e0576121e06138c7565b61012085013515801561220057506121fc610140860186613534565b1590505b1561220d575060016122d4565b825f0361221b57505f6122d4565b61223f8461222f6080880160608901612ea6565b611cc860a0890160808a016132ea565b5f61225261012087016101008801612ea6565b90506101208601355f612269610140890189613534565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525084519495509384935083925090506020850186888cf194505a905085156122c3576122c38188612b1e565b6122cf5f198080612a8a565b505050505b949350505050565b801580159061231357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15611586576040516315c638fb60e31b81525f6004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ae31c7d8906044015f604051808303815f87803b15801561237d575f5ffd5b505af1158015611d79573d5f5f3e3d5ffd5b8060048111156123a1576123a161314a565b5f83815260fc602052604090205460ff1660048111156123c3576123c361314a565b036123e1576040516319d893ad60e21b815260040160405180910390fd5b5f82815260fc60205260409020805482919060ff1916600183600481111561240b5761240b61314a565b0217905550817f6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b25756348260405161244091906131b4565b60405180910390a25050565b6033546001600160a01b031633146115e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a66565b5f54610100900460ff166124cc5760405162461bcd60e51b8152600401610a66906138db565b6124d4612b32565b6124f26001600160a01b038216156124ec57816128ff565b336128ff565b5060c9805461ff001916610100179055565b6001600160a01b0381166115865760405163538ba4f960e01b815260040160405180910390fd5b5f8061254561253e610140850185613534565b9050611922565b63ffffffff16905080612576612561606086016040870161343f565b63ffffffff168361262990919063ffffffff16565b039392505050565b5f856001600160a01b031663910af6ed856125a3876562726964676560d01b5f612918565b8887876040518663ffffffff1660e01b81526004016125c6959493929190613926565b6020604051808303815f875af1925050508015612600575060408051601f3d908101601f191682019092526125fd91810190613458565b60015b61261d576040516314504c7360e31b815260040160405180910390fd5b90505b95945050505050565b5f81831161263757816117bf565b5090919050565b5f81831161264c57826117bf565b50919050565b815f0361265e57505050565b61267883838360405180602001604052805f81525061217b565b611b1857604051634c67134d60e11b815260040160405180910390fd5b5f5160206139ca5f395f51905f52546001600160a01b031690565b61158661244c565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126eb57611b1883612b58565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612745575060408051601f3d908101601f1916820190925261274291810190613458565b60015b6127a85760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610a66565b5f5160206139ca5f395f51905f5281146128165760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610a66565b50611b18838383612bf3565b61283660c954610100900460ff1660021490565b6115e25760405163bae6e2a960e01b815260040160405180910390fd5b7f0000000000000000000000004779d18931b35540f84b0cd0e9633855b84df7b8611b1881612c17565b5f856001600160a01b031663ce9d0820856128a2876562726964676560d01b5f612918565b8887876040518663ffffffff1660e01b81526004016128c5959493929190613926565b5f6040518083038186803b1580156128db575f5ffd5b505afa9250505080156128ec575060015b6128f757505f612620565b506001612620565b606580546001600160a01b031916905561158681612c55565b5f7f000000000000000000000000a20182131658295f37c1a1efdbdc89eff97d9c58604051633632b1fb60e11b81526001600160401b03861660048201526024810185905283151560448201526001600160a01b039190911690636c6563f690606401602060405180830381865afa158015612996573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117bc9190613967565b6040516001600160e01b0319821660248201525f90819081906001600160a01b0386169060440160408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b17905251612a169190613982565b5f60405180830381855afa9150503d805f8114612a4e576040519150601f19603f3d011682016040523d82523d5f602084013e612a53565b606091505b5091509150818015612a66575080516020145b15612a825780806020019051810190612a7f9190613801565b92505b505092915050565b827fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2b95d817fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2ba5d807fe4ece82196de19aabe639620d7f716c433d1348f96ce727c9989a982dbadc2bb5d505050565b807fa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b5d50565b612b29603f82613998565b821015610b9b57fe5b5f54610100900460ff166115e25760405162461bcd60e51b8152600401610a66906138db565b6001600160a01b0381163b612bc55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610a66565b5f5160206139ca5f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b612bfc83612ca6565b5f82511180612c085750805b15611b1857610a1c8383612ce5565b6033546001600160a01b0316331480612c385750336001600160a01b038216145b611586576040516395383ea160e01b815260040160405180910390fd5b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b612caf81612b58565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b60606117bf83836040518060600160405280602781526020016139ea6027913960605f5f856001600160a01b031685604051612d219190613982565b5f60405180830381855af49150503d805f8114612d59576040519150601f19603f3d011682016040523d82523d5f602084013e612d5e565b606091505b5091509150612d6f86838387612d79565b9695505050505050565b60608315612de75782515f03612de0576001600160a01b0385163b612de05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a66565b50816122d4565b6122d48383815115612dfc5781518083602001fd5b8060405162461bcd60e51b8152600401610a6691906139b7565b5f610160828403121561264c575f5ffd5b8015158114611586575f5ffd5b5f5f60408385031215612e45575f5ffd5b82356001600160401b03811115612e5a575f5ffd5b612e6685828601612e16565b9250506020830135612e7781612e27565b809150509250929050565b6001600160a01b0381168114611586575f5ffd5b8035612ea181612e82565b919050565b5f60208284031215612eb6575f5ffd5b81356117bf81612e82565b5f60208284031215612ed1575f5ffd5b81356001600160401b03811115612ee6575f5ffd5b6122d484828501612e16565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b80516001600160401b031682525f6020820151612f4860208501826001600160401b03169052565b506040820151612f60604085018263ffffffff169052565b506060820151612f7b60608501826001600160a01b03169052565b506080820151612f9660808501826001600160401b03169052565b5060a0820151612fb160a08501826001600160a01b03169052565b5060c0820151612fcc60c08501826001600160401b03169052565b5060e0820151612fe760e08501826001600160a01b03169052565b506101008201516130046101008501826001600160a01b03169052565b506101208201516101208401526101408201516101606101408501526122d4610160850182612ef2565b828152604060208201525f6117bc6040830184612f20565b5f5f60208385031215613057575f5ffd5b82356001600160401b0381111561306c575f5ffd5b8301601f8101851361307c575f5ffd5b80356001600160401b03811115613091575f5ffd5b8560208260051b84010111156130a5575f5ffd5b6020919091019590945092505050565b5f5f5f604084860312156130c7575f5ffd5b83356001600160401b038111156130dc575f5ffd5b6130e886828701612e16565b93505060208401356001600160401b03811115613103575f5ffd5b8401601f81018613613113575f5ffd5b80356001600160401b03811115613128575f5ffd5b866020828401011115613139575f5ffd5b939660209190910195509293505050565b634e487b7160e01b5f52602160045260245ffd5b6005811061316e5761316e61314a565b9052565b60408101613180828561315e565b600483106131905761319061314a565b8260208301529392505050565b5f602082840312156131ad575f5ffd5b5035919050565b60208101611894828461315e565b634e487b7160e01b5f52604160045260245ffd5b60405161016081016001600160401b03811182821017156131f9576131f96131c2565b60405290565b5f82601f83011261320e575f5ffd5b81356001600160401b03811115613227576132276131c2565b604051601f8201601f19908116603f011681016001600160401b0381118282101715613255576132556131c2565b60405281815283820160200185101561326c575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f60408385031215613299575f5ffd5b82356132a481612e82565b915060208301356001600160401b038111156132be575f5ffd5b6132ca858286016131ff565b9150509250929050565b80356001600160401b0381168114612ea1575f5ffd5b5f602082840312156132fa575f5ffd5b6117bf826132d4565b803563ffffffff81168114612ea1575f5ffd5b5f6101608284031215613327575f5ffd5b61332f6131d6565b905061333a826132d4565b8152613348602083016132d4565b602082015261335960408301613303565b604082015261336a60608301612e96565b606082015261337b608083016132d4565b608082015261338c60a08301612e96565b60a082015261339d60c083016132d4565b60c08201526133ae60e08301612e96565b60e08201526133c06101008301612e96565b61010082015261012082810135908201526101408201356001600160401b038111156133ea575f5ffd5b6133f6848285016131ff565b6101408301525092915050565b5f60208284031215613413575f5ffd5b81356001600160401b03811115613428575f5ffd5b6122d484828501613316565b5f6118943683613316565b5f6020828403121561344f575f5ffd5b6117bf82613303565b5f60208284031215613468575f5ffd5b5051919050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611894576118946134bd565b5f6001600160401b0382166001600160401b038103613505576135056134bd565b60010192915050565b602081525f6117bf6020830184612f20565b634e487b7160e01b5f52603260045260245ffd5b5f5f8335601e19843603018112613549575f5ffd5b8301803591506001600160401b03821115613562575f5ffd5b602001915036819003821315613576575f5ffd5b9250929050565b634e487b7160e01b5f52601260045260245ffd5b5f5f8335601e198436030181126135a6575f5ffd5b83016020810192503590506001600160401b038111156135c4575f5ffd5b803603821315613576575f5ffd5b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b61361482613607836132d4565b6001600160401b03169052565b5f613621602083016132d4565b6001600160401b0316602084015261363b60408301613303565b63ffffffff16604084015261365260608301612e96565b6001600160a01b0316606084015261366c608083016132d4565b6001600160401b0316608084015261368660a08301612e96565b6001600160a01b031660a08401526136a060c083016132d4565b6001600160401b031660c08401526136ba60e08301612e96565b6001600160a01b031660e08401526136d56101008301612e96565b6001600160a01b031661010084015261012082810135908401526136fd610140830183613591565b610160610140860152612a7f610160860182846135d2565b60a081525f61372760a08301856135fa565b905063ffffffff835116602083015263ffffffff602084015116604083015263ffffffff60408401511660608301526060830151151560808301529392505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b5f60208284031215613811575f5ffd5b81516117bf81612e27565b63ffffffff8181168382160190811115611894576118946134bd565b604081525f61384a60408301856135fa565b90508260208301529392505050565b60408152600d60408201526c5441494b4f5f4d45535341474560981b6060820152608060208201525f6117bf6080830184612f20565b80356001600160e01b031981169060048410156138c0576001600160e01b0319600485900360031b81901b82161691505b5092915050565b634e487b7160e01b5f52600160045260245ffd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160401b038616815260018060a01b0385166020820152836040820152608060608201525f61395c6080830184866135d2565b979650505050505050565b5f60208284031215613977575f5ffd5b81516117bf81612e82565b5f82518060208501845e5f920191825250919050565b5f826139b257634e487b7160e01b5f52601260045260245ffd5b500490565b602081525f6117bf6020830184612ef256fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122067b7f250eaf18a6887bcacd1cdb910b16ebf50961a787535f39677c1746811f564736f6c634300081e0033