Note: Our ether balance display is temporarily unavailable. Please check back later.
Source Code
Overview
ETH Balance
Ether balance is temporarily unavailable. Please check back later.
More Info
ContractCreator
Multichain Info
N/A
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
L1MessageQueue
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.16; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {BitMapsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/BitMapsUpgradeable.sol"; import {IL2GasPriceOracle} from "./IL2GasPriceOracle.sol"; import {IL1MessageQueue} from "./IL1MessageQueue.sol"; import {AddressAliasHelper} from "../../libraries/common/AddressAliasHelper.sol"; // solhint-disable no-empty-blocks // solhint-disable no-inline-assembly // solhint-disable reason-string /// @title L1MessageQueue /// @notice This contract will hold all L1 to L2 messages. /// Each appended message is assigned with a unique and increasing `uint256` index. contract L1MessageQueue is OwnableUpgradeable, IL1MessageQueue { using BitMapsUpgradeable for BitMapsUpgradeable.BitMap; /********** * Events * **********/ /// @notice Emitted when owner updates gas oracle contract. /// @param _oldGasOracle The address of old gas oracle contract. /// @param _newGasOracle The address of new gas oracle contract. event UpdateGasOracle(address indexed _oldGasOracle, address indexed _newGasOracle); /// @notice Emitted when owner updates EnforcedTxGateway contract. /// @param _oldGateway The address of old EnforcedTxGateway contract. /// @param _newGateway The address of new EnforcedTxGateway contract. event UpdateEnforcedTxGateway(address indexed _oldGateway, address indexed _newGateway); /// @notice Emitted when owner updates max gas limit. /// @param _oldMaxGasLimit The old max gas limit. /// @param _newMaxGasLimit The new max gas limit. event UpdateMaxGasLimit(uint256 _oldMaxGasLimit, uint256 _newMaxGasLimit); /************* * Variables * *************/ /// @notice The address of L1ScrollMessenger contract. address public messenger; /// @notice The address of ScrollChain contract. address public scrollChain; /// @notice The address EnforcedTxGateway contract. address public enforcedTxGateway; /// @notice The address of GasOracle contract. address public gasOracle; /// @notice The list of queued cross domain messages. bytes32[] public messageQueue; /// @inheritdoc IL1MessageQueue uint256 public pendingQueueIndex; /// @notice The max gas limit of L1 transactions. uint256 public maxGasLimit; /// @dev The bitmap for skipped messages. BitMapsUpgradeable.BitMap private droppedMessageBitmap; /// @dev The bitmap for skipped messages, where `skippedMessageBitmap[i]` keeps the bits from `[i*256, (i+1)*256)`. mapping(uint256 => uint256) private skippedMessageBitmap; /********************** * Function Modifiers * **********************/ modifier onlyMessenger() { require(msg.sender == messenger, "Only callable by the L1ScrollMessenger"); _; } /*************** * Constructor * ***************/ constructor() { _disableInitializers(); } function initialize( address _messenger, address _scrollChain, address _enforcedTxGateway, address _gasOracle, uint256 _maxGasLimit ) external initializer { OwnableUpgradeable.__Ownable_init(); messenger = _messenger; scrollChain = _scrollChain; enforcedTxGateway = _enforcedTxGateway; gasOracle = _gasOracle; maxGasLimit = _maxGasLimit; } /************************* * Public View Functions * *************************/ /// @inheritdoc IL1MessageQueue function nextCrossDomainMessageIndex() external view returns (uint256) { return messageQueue.length; } /// @inheritdoc IL1MessageQueue function getCrossDomainMessage(uint256 _queueIndex) external view returns (bytes32) { return messageQueue[_queueIndex]; } /// @inheritdoc IL1MessageQueue function estimateCrossDomainMessageFee(uint256 _gasLimit) external view override returns (uint256) { address _oracle = gasOracle; if (_oracle == address(0)) return 0; return IL2GasPriceOracle(_oracle).estimateCrossDomainMessageFee(_gasLimit); } /// @inheritdoc IL1MessageQueue function calculateIntrinsicGasFee(bytes memory _calldata) public view override returns (uint256) { address _oracle = gasOracle; if (_oracle == address(0)) return 0; return IL2GasPriceOracle(_oracle).calculateIntrinsicGasFee(_calldata); } /// @inheritdoc IL1MessageQueue function computeTransactionHash( address _sender, uint256 _queueIndex, uint256 _value, address _target, uint256 _gasLimit, bytes calldata _data ) public pure override returns (bytes32) { // We use EIP-2718 to encode the L1 message, and the encoding of the message is // `TransactionType || TransactionPayload` // where // 1. `TransactionType` is 0x7E // 2. `TransactionPayload` is `rlp([queueIndex, gasLimit, to, value, data, sender])` // // The spec of rlp: https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/ uint256 transactionType = 0x7E; bytes32 hash; assembly { function get_uint_bytes(v) -> len { if eq(v, 0) { len := 1 leave } for { } gt(v, 0) { } { len := add(len, 1) v := shr(8, v) } } // This is used for both store uint and single byte. // Integer zero is special handled by geth to encode as `0x80` function store_uint_or_byte(_ptr, v, is_uint) -> ptr { ptr := _ptr switch lt(v, 128) case 1 { switch and(iszero(v), is_uint) case 1 { // integer 0 mstore8(ptr, 0x80) } default { // single byte in the [0x00, 0x7f] mstore8(ptr, v) } ptr := add(ptr, 1) } default { // 1-32 bytes long let len := get_uint_bytes(v) mstore8(ptr, add(len, 0x80)) ptr := add(ptr, 1) mstore(ptr, shl(mul(8, sub(32, len)), v)) ptr := add(ptr, len) } } function store_address(_ptr, v) -> ptr { ptr := _ptr // 20 bytes long mstore8(ptr, 0x94) // 0x80 + 0x14 ptr := add(ptr, 1) mstore(ptr, shl(96, v)) ptr := add(ptr, 0x14) } // 1 byte for TransactionType // 4 byte for list payload length let start_ptr := add(mload(0x40), 5) let ptr := start_ptr ptr := store_uint_or_byte(ptr, _queueIndex, 1) ptr := store_uint_or_byte(ptr, _gasLimit, 1) ptr := store_address(ptr, _target) ptr := store_uint_or_byte(ptr, _value, 1) switch eq(_data.length, 1) case 1 { // single byte ptr := store_uint_or_byte(ptr, byte(0, calldataload(_data.offset)), 0) } default { switch lt(_data.length, 56) case 1 { // a string is 0-55 bytes long mstore8(ptr, add(0x80, _data.length)) ptr := add(ptr, 1) calldatacopy(ptr, _data.offset, _data.length) ptr := add(ptr, _data.length) } default { // a string is more than 55 bytes long let len_bytes := get_uint_bytes(_data.length) mstore8(ptr, add(0xb7, len_bytes)) ptr := add(ptr, 1) mstore(ptr, shl(mul(8, sub(32, len_bytes)), _data.length)) ptr := add(ptr, len_bytes) calldatacopy(ptr, _data.offset, _data.length) ptr := add(ptr, _data.length) } } ptr := store_address(ptr, _sender) let payload_len := sub(ptr, start_ptr) let value let value_bytes switch lt(payload_len, 56) case 1 { // the total payload of a list is 0-55 bytes long value := add(0xc0, payload_len) value_bytes := 1 } default { // If the total payload of a list is more than 55 bytes long let len_bytes := get_uint_bytes(payload_len) value_bytes := add(len_bytes, 1) value := add(0xf7, len_bytes) value := shl(mul(len_bytes, 8), value) value := or(value, payload_len) } value := or(value, shl(mul(8, value_bytes), transactionType)) value_bytes := add(value_bytes, 1) let value_bits := mul(8, value_bytes) value := or(shl(sub(256, value_bits), value), shr(value_bits, mload(start_ptr))) start_ptr := sub(start_ptr, value_bytes) mstore(start_ptr, value) hash := keccak256(start_ptr, sub(ptr, start_ptr)) } return hash; } /// @inheritdoc IL1MessageQueue function isMessageSkipped(uint256 _queueIndex) external view returns (bool) { if (_queueIndex >= pendingQueueIndex) return false; return _isMessageSkipped(_queueIndex); } /// @inheritdoc IL1MessageQueue function isMessageDropped(uint256 _queueIndex) external view returns (bool) { // it should be a skipped message first. return _isMessageSkipped(_queueIndex) && droppedMessageBitmap.get(_queueIndex); } /***************************** * Public Mutating Functions * *****************************/ /// @inheritdoc IL1MessageQueue function appendCrossDomainMessage( address _target, uint256 _gasLimit, bytes calldata _data ) external override onlyMessenger { // validate gas limit _validateGasLimit(_gasLimit, _data); // do address alias to avoid replay attack in L2. address _sender = AddressAliasHelper.applyL1ToL2Alias(msg.sender); _queueTransaction(_sender, _target, 0, _gasLimit, _data); } /// @inheritdoc IL1MessageQueue function appendEnforcedTransaction( address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes calldata _data ) external override { require(msg.sender == enforcedTxGateway, "Only callable by the EnforcedTxGateway"); // We will check it in EnforcedTxGateway, just in case. require(_sender.code.length == 0, "only EOA"); // validate gas limit _validateGasLimit(_gasLimit, _data); _queueTransaction(_sender, _target, _value, _gasLimit, _data); } /// @inheritdoc IL1MessageQueue function popCrossDomainMessage( uint256 _startIndex, uint256 _count, uint256 _skippedBitmap ) external { require(msg.sender == scrollChain, "Only callable by the ScrollChain"); require(_count <= 256, "pop too many messages"); require(pendingQueueIndex == _startIndex, "start index mismatch"); unchecked { // clear extra bits in `_skippedBitmap`, and if _count = 256, it's designed to overflow. uint256 mask = (1 << _count) - 1; _skippedBitmap &= mask; uint256 bucket = _startIndex >> 8; uint256 offset = _startIndex & 0xff; skippedMessageBitmap[bucket] |= _skippedBitmap << offset; if (offset + _count > 256) { skippedMessageBitmap[bucket + 1] = _skippedBitmap >> (256 - offset); } pendingQueueIndex = _startIndex + _count; } emit DequeueTransaction(_startIndex, _count, _skippedBitmap); } /// @inheritdoc IL1MessageQueue function dropCrossDomainMessage(uint256 _index) external onlyMessenger { require(_index < pendingQueueIndex, "cannot drop pending message"); require(_isMessageSkipped(_index), "drop non-skipped message"); require(!droppedMessageBitmap.get(_index), "message already dropped"); droppedMessageBitmap.set(_index); emit DropTransaction(_index); } /************************ * Restricted Functions * ************************/ /// @notice Update the address of gas oracle. /// @dev This function can only called by contract owner. /// @param _newGasOracle The address to update. function updateGasOracle(address _newGasOracle) external onlyOwner { address _oldGasOracle = gasOracle; gasOracle = _newGasOracle; emit UpdateGasOracle(_oldGasOracle, _newGasOracle); } /// @notice Update the address of EnforcedTxGateway. /// @dev This function can only called by contract owner. /// @param _newGateway The address to update. function updateEnforcedTxGateway(address _newGateway) external onlyOwner { address _oldGateway = enforcedTxGateway; enforcedTxGateway = _newGateway; emit UpdateEnforcedTxGateway(_oldGateway, _newGateway); } /// @notice Update the max gas limit. /// @dev This function can only called by contract owner. /// @param _newMaxGasLimit The new max gas limit. function updateMaxGasLimit(uint256 _newMaxGasLimit) external onlyOwner { uint256 _oldMaxGasLimit = maxGasLimit; maxGasLimit = _newMaxGasLimit; emit UpdateMaxGasLimit(_oldMaxGasLimit, _newMaxGasLimit); } /********************** * Internal Functions * **********************/ /// @dev Internal function to queue a L1 transaction. /// @param _sender The address of sender who will initiate this transaction in L2. /// @param _target The address of target contract to call in L2. /// @param _value The value passed /// @param _gasLimit The maximum gas should be used for this transaction in L2. /// @param _data The calldata passed to target contract. function _queueTransaction( address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes calldata _data ) internal { // compute transaction hash uint256 _queueIndex = messageQueue.length; bytes32 _hash = computeTransactionHash(_sender, _queueIndex, _value, _target, _gasLimit, _data); messageQueue.push(_hash); // emit event emit QueueTransaction(_sender, _target, _value, uint64(_queueIndex), _gasLimit, _data); } function _validateGasLimit(uint256 _gasLimit, bytes memory _calldata) internal view { require(_gasLimit <= maxGasLimit, "Gas limit must not exceed maxGasLimit"); // check if the gas limit is above intrinsic gas uint256 intrinsicGas = calculateIntrinsicGasFee(_calldata); require(_gasLimit >= intrinsicGas, "Insufficient gas limit, must be above intrinsic gas"); } /// @dev Returns whether the bit at `index` is set. function _isMessageSkipped(uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return skippedMessageBitmap[bucket] & mask != 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMapsUpgradeable { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo(BitMap storage bitmap, uint256 index, bool value) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IL2GasPriceOracle { /// @notice Estimate fee for cross chain message call. /// @param _gasLimit Gas limit required to complete the message relay on L2. function estimateCrossDomainMessageFee(uint256 _gasLimit) external view returns (uint256); /// @notice Estimate intrinsic gas fee for cross chain message call. /// @param _message The message to be relayed on L2. function calculateIntrinsicGasFee(bytes memory _message) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IL1MessageQueue { /********** * Events * **********/ /// @notice Emitted when a new L1 => L2 transaction is appended to the queue. /// @param sender The address of account who initiates the transaction. /// @param target The address of account who will receive the transaction. /// @param value The value passed with the transaction. /// @param queueIndex The index of this transaction in the queue. /// @param gasLimit Gas limit required to complete the message relay on L2. /// @param data The calldata of the transaction. event QueueTransaction( address indexed sender, address indexed target, uint256 value, uint64 queueIndex, uint256 gasLimit, bytes data ); /// @notice Emitted when some L1 => L2 transactions are included in L1. /// @param startIndex The start index of messages popped. /// @param count The number of messages popped. /// @param skippedBitmap A bitmap indicates whether a message is skipped. event DequeueTransaction(uint256 startIndex, uint256 count, uint256 skippedBitmap); /// @notice Emitted when a message is dropped from L1. /// @param index The index of message dropped. event DropTransaction(uint256 index); /************************* * Public View Functions * *************************/ /// @notice The start index of all pending inclusion messages. function pendingQueueIndex() external view returns (uint256); /// @notice Return the index of next appended message. /// @dev Also the total number of appended messages. function nextCrossDomainMessageIndex() external view returns (uint256); /// @notice Return the message of in `queueIndex`. /// @param queueIndex The index to query. function getCrossDomainMessage(uint256 queueIndex) external view returns (bytes32); /// @notice Return the amount of ETH should pay for cross domain message. /// @param gasLimit Gas limit required to complete the message relay on L2. function estimateCrossDomainMessageFee(uint256 gasLimit) external view returns (uint256); /// @notice Return the amount of intrinsic gas fee should pay for cross domain message. /// @param _calldata The calldata of L1-initiated transaction. function calculateIntrinsicGasFee(bytes memory _calldata) external view returns (uint256); /// @notice Return the hash of a L1 message. /// @param sender The address of sender. /// @param queueIndex The queue index of this message. /// @param value The amount of Ether transfer to target. /// @param target The address of target. /// @param gasLimit The gas limit provided. /// @param data The calldata passed to target address. function computeTransactionHash( address sender, uint256 queueIndex, uint256 value, address target, uint256 gasLimit, bytes calldata data ) external view returns (bytes32); /// @notice Return whether the message is skipped. /// @param queueIndex The queue index of the message to check. function isMessageSkipped(uint256 queueIndex) external view returns (bool); /// @notice Return whether the message is dropped. /// @param queueIndex The queue index of the message to check. function isMessageDropped(uint256 queueIndex) external view returns (bool); /***************************** * Public Mutating Functions * *****************************/ /// @notice Append a L1 to L2 message into this contract. /// @param target The address of target contract to call in L2. /// @param gasLimit The maximum gas should be used for relay this message in L2. /// @param data The calldata passed to target contract. function appendCrossDomainMessage( address target, uint256 gasLimit, bytes calldata data ) external; /// @notice Append an enforced transaction to this contract. /// @dev The address of sender should be an EOA. /// @param sender The address of sender who will initiate this transaction in L2. /// @param target The address of target contract to call in L2. /// @param value The value passed /// @param gasLimit The maximum gas should be used for this transaction in L2. /// @param data The calldata passed to target contract. function appendEnforcedTransaction( address sender, address target, uint256 value, uint256 gasLimit, bytes calldata data ) external; /// @notice Pop finalized messages from queue. /// /// @dev We can pop at most 256 messages each time. And if the message is not skipped, /// the corresponding entry will be cleared. /// /// @param startIndex The start index to pop. /// @param count The number of messages to pop. /// @param skippedBitmap A bitmap indicates whether a message is skipped. function popCrossDomainMessage( uint256 startIndex, uint256 count, uint256 skippedBitmap ) external; /// @notice Drop a skipped message from the queue. function dropCrossDomainMessage(uint256 index) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; library AddressAliasHelper { /// @dev The offset added to the address in L1. uint160 internal constant OFFSET = uint160(0x1111000000000000000000000000000000001111); /// @notice Utility function that converts the address in the L1 that submitted a tx to /// the inbox to the msg.sender viewed in the L2 /// @param l1Address the address in the L1 that triggered the tx to L2 /// @return l2Address L2 address as viewed in msg.sender function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { unchecked { l2Address = address(uint160(l1Address) + OFFSET); } } /// @notice Utility function that converts the msg.sender viewed in the L2 to the /// address in the L1 that submitted a tx to the inbox /// @param l2Address L2 address as viewed in msg.sender /// @return l1Address the address in the L1 that triggered the tx to L2 function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) { unchecked { l1Address = address(uint160(l2Address) - OFFSET); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/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); } } }
{ "remappings": [ "hardhat/=node_modules/hardhat/", "forge-std/=lib/forge-std/src/", "ds-test/=lib/ds-test/src/", "solmate/=lib/solmate/src/", "@openzeppelin/=node_modules/@openzeppelin/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"skippedBitmap","type":"uint256"}],"name":"DequeueTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"DropTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"queueIndex","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"gasLimit","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"QueueTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldGateway","type":"address"},{"indexed":true,"internalType":"address","name":"_newGateway","type":"address"}],"name":"UpdateEnforcedTxGateway","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldGasOracle","type":"address"},{"indexed":true,"internalType":"address","name":"_newGasOracle","type":"address"}],"name":"UpdateGasOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldMaxGasLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newMaxGasLimit","type":"uint256"}],"name":"UpdateMaxGasLimit","type":"event"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"appendCrossDomainMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"appendEnforcedTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"calculateIntrinsicGasFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_queueIndex","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"computeTransactionHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"dropCrossDomainMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enforcedTxGateway","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gasLimit","type":"uint256"}],"name":"estimateCrossDomainMessageFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gasOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_queueIndex","type":"uint256"}],"name":"getCrossDomainMessage","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_messenger","type":"address"},{"internalType":"address","name":"_scrollChain","type":"address"},{"internalType":"address","name":"_enforcedTxGateway","type":"address"},{"internalType":"address","name":"_gasOracle","type":"address"},{"internalType":"uint256","name":"_maxGasLimit","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_queueIndex","type":"uint256"}],"name":"isMessageDropped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_queueIndex","type":"uint256"}],"name":"isMessageSkipped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxGasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"messageQueue","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messenger","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextCrossDomainMessageIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingQueueIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"_skippedBitmap","type":"uint256"}],"name":"popCrossDomainMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scrollChain","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGateway","type":"address"}],"name":"updateEnforcedTxGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGasOracle","type":"address"}],"name":"updateGasOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxGasLimit","type":"uint256"}],"name":"updateMaxGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001961001e565b6100dd565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100db576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611612806100ec6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c94864e111610097578063e172d3a111610071578063e172d3a114610323578063f2fde38b14610336578063f7013ef614610349578063fd0ad31e1461035c57600080fd5b8063c94864e1146102ea578063d5ad4a97146102fd578063d7704bae1461031057600080fd5b80638da5cb5b1461028457806391652461146102955780639b159782146102a8578063a85006ca146102bb578063ae453cd5146102c4578063bdc6f0a0146102d757600080fd5b80635d62a8dd116101305780635d62a8dd146102275780635e45da231461023a57806370cee67f14610243578063715018a6146102565780637d82191a1461025e578063897630dd1461027157600080fd5b806329aa604b146101785780633cb747bf1461019e5780633e6dada1146101c95780633e83496c146101ec57806355f613ce146101ff5780635ad9945a14610214575b600080fd5b61018b610186366004611149565b610364565b6040519081526020015b60405180910390f35b6065546101b1906001600160a01b031681565b6040516001600160a01b039091168152602001610195565b6101dc6101d7366004611149565b610385565b6040519015158152602001610195565b6067546101b1906001600160a01b031681565b61021261020d366004611162565b6103cf565b005b61018b6102223660046111ee565b61056a565b6068546101b1906001600160a01b031681565b61018b606b5481565b610212610251366004611270565b61075f565b6102126107b9565b6101dc61026c366004611149565b6107cd565b6066546101b1906001600160a01b031681565b6033546001600160a01b03166101b1565b6102126102a3366004611149565b610803565b6102126102b636600461128b565b6109a4565b61018b606a5481565b61018b6102d2366004611149565b610a3b565b6102126102e53660046112e5565b610a62565b6102126102f8366004611270565b610b64565b61021261030b366004611149565b610bbe565b61018b61031e366004611149565b610c0b565b61018b610331366004611373565b610c99565b610212610344366004611270565b610ce2565b610212610357366004611424565b610d5b565b60695461018b565b6069818154811061037457600080fd5b600091825260209091200154905081565b600881901c6000908152606d6020526040812054600160ff84161b16151580156103c95750600882901c6000908152606c6020526040902054600160ff84161b1615155b92915050565b6066546001600160a01b0316331461042e5760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792063616c6c61626c6520627920746865205363726f6c6c436861696e60448201526064015b60405180910390fd5b6101008211156104785760405162461bcd60e51b8152602060048201526015602482015274706f7020746f6f206d616e79206d6573736167657360581b6044820152606401610425565b82606a54146104c05760405162461bcd60e51b81526020600482015260146024820152730e6e8c2e4e840d2dcc8caf040dad2e6dac2e8c6d60631b6044820152606401610425565b600883901c6000818152606d6020526040902080546001851b6000190193841660ff871681811b90921790925590929190610100818601111561051b57600182016000908152606d6020526040902061010082900385901c90555b505050818301606a5560408051848152602081018490529081018290527fc77f792f838ae38399ac31acc3348389aeb110ce7bedf3cfdbdd5e66792679709060600160405180910390a1505050565b6000607e81610616565b60008161058357506001919050565b5b81156105995760089190911c90600101610584565b919050565b8060808310600181146105d6576105b484610574565b60808101835360018301925084816020036008021b83528083019250506105f7565b84841516600181146105ea578483536105ef565b608083535b506001820191505b509392505050565b806094815360609290921b60018301525060150190565b6005604051018061062960018c8361059e565b90506106376001898361059e565b905061064389826105ff565b905061065160018b8361059e565b905060018614600181146106b957603887106001811461069e5761067488610574565b8060b701845360018401935088816020036008021b845280840193505087898437918701916106b3565b87608001835360018301925087898437918701915b506106cc565b6106c96000893560001a8461059e565b91505b506106d78c826105ff565b9050818103600080603883106001811461070b576106f484610574565b60f78101600882021b851793506001019150610716565b8360c0019250600191505b5086816008021b821791506001810190508060080292508451831c8284610100031b17915080850394505080845250508181038220925050508092505050979650505050505050565b610767610ebf565b606880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f9ed5ec28f252b3e7f62f1ace8e54c5ebabf4c61cc2a7c33a806365b2ff7ecc5e90600090a35050565b6107c1610ebf565b6107cb6000610f19565b565b6000606a5482106107e057506000919050565b600882901c6000908152606d6020526040902054600160ff84161b1615156103c9565b6065546001600160a01b0316331461082d5760405162461bcd60e51b815260040161042590611480565b606a54811061087e5760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f742064726f702070656e64696e67206d65737361676500000000006044820152606401610425565b600881901c6000908152606d6020526040902054600160ff83161b166108e65760405162461bcd60e51b815260206004820152601860248201527f64726f70206e6f6e2d736b6970706564206d65737361676500000000000000006044820152606401610425565b600881901c6000908152606c6020526040902054600160ff83161b161561094f5760405162461bcd60e51b815260206004820152601760248201527f6d65737361676520616c72656164792064726f707065640000000000000000006044820152606401610425565b600881901c6000908152606c602052604090208054600160ff84161b1790556040518181527f43a375005206d20a83abc71722cba68c24434a8dc1f583775be7c3fde0396cbf9060200160405180910390a150565b6065546001600160a01b031633146109ce5760405162461bcd60e51b815260040161042590611480565b610a0e8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6b92505050565b3373111100000000000000000000000000000000111101610a3481866000878787611049565b5050505050565b600060698281548110610a5057610a506114c6565b90600052602060002001549050919050565b6067546001600160a01b03163314610acb5760405162461bcd60e51b815260206004820152602660248201527f4f6e6c792063616c6c61626c652062792074686520456e666f7263656454784760448201526561746577617960d01b6064820152608401610425565b6001600160a01b0386163b15610b0e5760405162461bcd60e51b81526020600482015260086024820152676f6e6c7920454f4160c01b6044820152606401610425565b610b4e8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6b92505050565b610b5c868686868686611049565b505050505050565b610b6c610ebf565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5fd1d27c789fb50eafa108fba89345986a66d9d0aba85d48adee09f5e3307bbd90600090a35050565b610bc6610ebf565b606b80549082905560408051828152602081018490527fa030881e03ff723954dd0d35500564afab9603555d09d4456a32436f2b2373c5910160405180910390a15050565b6068546000906001600160a01b031680610c285750600092915050565b604051636bb825d760e11b8152600481018490526001600160a01b0382169063d7704bae906024015b602060405180830381865afa158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9291906114dc565b9392505050565b6068546000906001600160a01b031680610cb65750600092915050565b60405163e172d3a160e01b81526001600160a01b0382169063e172d3a190610c519086906004016114f5565b610cea610ebf565b6001600160a01b038116610d4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610425565b610d5881610f19565b50565b600054610100900460ff1615808015610d7b5750600054600160ff909116105b80610d955750303b158015610d95575060005460ff166001145b610df85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610425565b6000805460ff191660011790558015610e1b576000805461ff0019166101001790555b610e236110ef565b606580546001600160a01b038089166001600160a01b03199283161790925560668054888416908316179055606780548784169083161790556068805492861692909116919091179055606b8290558015610b5c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b6033546001600160a01b031633146107cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610425565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606b54821115610fcb5760405162461bcd60e51b815260206004820152602560248201527f476173206c696d6974206d757374206e6f7420657863656564206d6178476173604482015264131a5b5a5d60da1b6064820152608401610425565b6000610fd682610c99565b9050808310156110445760405162461bcd60e51b815260206004820152603360248201527f496e73756666696369656e7420676173206c696d69742c206d7573742062652060448201527261626f766520696e7472696e7369632067617360681b6064820152608401610425565b505050565b606954600061105d8883888a89898961056a565b606980546001810182556000919091527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe399914308018190556040519091506001600160a01b0380891691908a16907f69cfcb8e6d4192b8aba9902243912587f37e550d75c1fa801491fce26717f37e906110dd908a9087908b908b908b90611543565b60405180910390a35050505050505050565b600054610100900460ff166111165760405162461bcd60e51b815260040161042590611591565b6107cb600054610100900460ff166111405760405162461bcd60e51b815260040161042590611591565b6107cb33610f19565b60006020828403121561115b57600080fd5b5035919050565b60008060006060848603121561117757600080fd5b505081359360208301359350604090920135919050565b80356001600160a01b038116811461059957600080fd5b60008083601f8401126111b757600080fd5b50813567ffffffffffffffff8111156111cf57600080fd5b6020830191508360208285010111156111e757600080fd5b9250929050565b600080600080600080600060c0888a03121561120957600080fd5b6112128861118e565b9650602088013595506040880135945061122e6060890161118e565b93506080880135925060a088013567ffffffffffffffff81111561125157600080fd5b61125d8a828b016111a5565b989b979a50959850939692959293505050565b60006020828403121561128257600080fd5b610c928261118e565b600080600080606085870312156112a157600080fd5b6112aa8561118e565b935060208501359250604085013567ffffffffffffffff8111156112cd57600080fd5b6112d9878288016111a5565b95989497509550505050565b60008060008060008060a087890312156112fe57600080fd5b6113078761118e565b95506113156020880161118e565b94506040870135935060608701359250608087013567ffffffffffffffff81111561133f57600080fd5b61134b89828a016111a5565b979a9699509497509295939492505050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561138557600080fd5b813567ffffffffffffffff8082111561139d57600080fd5b818401915084601f8301126113b157600080fd5b8135818111156113c3576113c361135d565b604051601f8201601f19908116603f011681019083821181831017156113eb576113eb61135d565b8160405282815287602084870101111561140457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080600080600060a0868803121561143c57600080fd5b6114458661118e565b94506114536020870161118e565b93506114616040870161118e565b925061146f6060870161118e565b949793965091946080013592915050565b60208082526026908201527f4f6e6c792063616c6c61626c6520627920746865204c315363726f6c6c4d657360408201526539b2b733b2b960d11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156114ee57600080fd5b5051919050565b600060208083528351808285015260005b8181101561152257858101830151858201604001528201611506565b506000604082860101526040601f19601f8301168501019250505092915050565b85815267ffffffffffffffff8516602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220d69f9ff214ec92f1b27ff4853bc954120bb9686716812fccc81ad016eca9392564736f6c63430008100033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c94864e111610097578063e172d3a111610071578063e172d3a114610323578063f2fde38b14610336578063f7013ef614610349578063fd0ad31e1461035c57600080fd5b8063c94864e1146102ea578063d5ad4a97146102fd578063d7704bae1461031057600080fd5b80638da5cb5b1461028457806391652461146102955780639b159782146102a8578063a85006ca146102bb578063ae453cd5146102c4578063bdc6f0a0146102d757600080fd5b80635d62a8dd116101305780635d62a8dd146102275780635e45da231461023a57806370cee67f14610243578063715018a6146102565780637d82191a1461025e578063897630dd1461027157600080fd5b806329aa604b146101785780633cb747bf1461019e5780633e6dada1146101c95780633e83496c146101ec57806355f613ce146101ff5780635ad9945a14610214575b600080fd5b61018b610186366004611149565b610364565b6040519081526020015b60405180910390f35b6065546101b1906001600160a01b031681565b6040516001600160a01b039091168152602001610195565b6101dc6101d7366004611149565b610385565b6040519015158152602001610195565b6067546101b1906001600160a01b031681565b61021261020d366004611162565b6103cf565b005b61018b6102223660046111ee565b61056a565b6068546101b1906001600160a01b031681565b61018b606b5481565b610212610251366004611270565b61075f565b6102126107b9565b6101dc61026c366004611149565b6107cd565b6066546101b1906001600160a01b031681565b6033546001600160a01b03166101b1565b6102126102a3366004611149565b610803565b6102126102b636600461128b565b6109a4565b61018b606a5481565b61018b6102d2366004611149565b610a3b565b6102126102e53660046112e5565b610a62565b6102126102f8366004611270565b610b64565b61021261030b366004611149565b610bbe565b61018b61031e366004611149565b610c0b565b61018b610331366004611373565b610c99565b610212610344366004611270565b610ce2565b610212610357366004611424565b610d5b565b60695461018b565b6069818154811061037457600080fd5b600091825260209091200154905081565b600881901c6000908152606d6020526040812054600160ff84161b16151580156103c95750600882901c6000908152606c6020526040902054600160ff84161b1615155b92915050565b6066546001600160a01b0316331461042e5760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792063616c6c61626c6520627920746865205363726f6c6c436861696e60448201526064015b60405180910390fd5b6101008211156104785760405162461bcd60e51b8152602060048201526015602482015274706f7020746f6f206d616e79206d6573736167657360581b6044820152606401610425565b82606a54146104c05760405162461bcd60e51b81526020600482015260146024820152730e6e8c2e4e840d2dcc8caf040dad2e6dac2e8c6d60631b6044820152606401610425565b600883901c6000818152606d6020526040902080546001851b6000190193841660ff871681811b90921790925590929190610100818601111561051b57600182016000908152606d6020526040902061010082900385901c90555b505050818301606a5560408051848152602081018490529081018290527fc77f792f838ae38399ac31acc3348389aeb110ce7bedf3cfdbdd5e66792679709060600160405180910390a1505050565b6000607e81610616565b60008161058357506001919050565b5b81156105995760089190911c90600101610584565b919050565b8060808310600181146105d6576105b484610574565b60808101835360018301925084816020036008021b83528083019250506105f7565b84841516600181146105ea578483536105ef565b608083535b506001820191505b509392505050565b806094815360609290921b60018301525060150190565b6005604051018061062960018c8361059e565b90506106376001898361059e565b905061064389826105ff565b905061065160018b8361059e565b905060018614600181146106b957603887106001811461069e5761067488610574565b8060b701845360018401935088816020036008021b845280840193505087898437918701916106b3565b87608001835360018301925087898437918701915b506106cc565b6106c96000893560001a8461059e565b91505b506106d78c826105ff565b9050818103600080603883106001811461070b576106f484610574565b60f78101600882021b851793506001019150610716565b8360c0019250600191505b5086816008021b821791506001810190508060080292508451831c8284610100031b17915080850394505080845250508181038220925050508092505050979650505050505050565b610767610ebf565b606880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f9ed5ec28f252b3e7f62f1ace8e54c5ebabf4c61cc2a7c33a806365b2ff7ecc5e90600090a35050565b6107c1610ebf565b6107cb6000610f19565b565b6000606a5482106107e057506000919050565b600882901c6000908152606d6020526040902054600160ff84161b1615156103c9565b6065546001600160a01b0316331461082d5760405162461bcd60e51b815260040161042590611480565b606a54811061087e5760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f742064726f702070656e64696e67206d65737361676500000000006044820152606401610425565b600881901c6000908152606d6020526040902054600160ff83161b166108e65760405162461bcd60e51b815260206004820152601860248201527f64726f70206e6f6e2d736b6970706564206d65737361676500000000000000006044820152606401610425565b600881901c6000908152606c6020526040902054600160ff83161b161561094f5760405162461bcd60e51b815260206004820152601760248201527f6d65737361676520616c72656164792064726f707065640000000000000000006044820152606401610425565b600881901c6000908152606c602052604090208054600160ff84161b1790556040518181527f43a375005206d20a83abc71722cba68c24434a8dc1f583775be7c3fde0396cbf9060200160405180910390a150565b6065546001600160a01b031633146109ce5760405162461bcd60e51b815260040161042590611480565b610a0e8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6b92505050565b3373111100000000000000000000000000000000111101610a3481866000878787611049565b5050505050565b600060698281548110610a5057610a506114c6565b90600052602060002001549050919050565b6067546001600160a01b03163314610acb5760405162461bcd60e51b815260206004820152602660248201527f4f6e6c792063616c6c61626c652062792074686520456e666f7263656454784760448201526561746577617960d01b6064820152608401610425565b6001600160a01b0386163b15610b0e5760405162461bcd60e51b81526020600482015260086024820152676f6e6c7920454f4160c01b6044820152606401610425565b610b4e8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f6b92505050565b610b5c868686868686611049565b505050505050565b610b6c610ebf565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5fd1d27c789fb50eafa108fba89345986a66d9d0aba85d48adee09f5e3307bbd90600090a35050565b610bc6610ebf565b606b80549082905560408051828152602081018490527fa030881e03ff723954dd0d35500564afab9603555d09d4456a32436f2b2373c5910160405180910390a15050565b6068546000906001600160a01b031680610c285750600092915050565b604051636bb825d760e11b8152600481018490526001600160a01b0382169063d7704bae906024015b602060405180830381865afa158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9291906114dc565b9392505050565b6068546000906001600160a01b031680610cb65750600092915050565b60405163e172d3a160e01b81526001600160a01b0382169063e172d3a190610c519086906004016114f5565b610cea610ebf565b6001600160a01b038116610d4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610425565b610d5881610f19565b50565b600054610100900460ff1615808015610d7b5750600054600160ff909116105b80610d955750303b158015610d95575060005460ff166001145b610df85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610425565b6000805460ff191660011790558015610e1b576000805461ff0019166101001790555b610e236110ef565b606580546001600160a01b038089166001600160a01b03199283161790925560668054888416908316179055606780548784169083161790556068805492861692909116919091179055606b8290558015610b5c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b6033546001600160a01b031633146107cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610425565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606b54821115610fcb5760405162461bcd60e51b815260206004820152602560248201527f476173206c696d6974206d757374206e6f7420657863656564206d6178476173604482015264131a5b5a5d60da1b6064820152608401610425565b6000610fd682610c99565b9050808310156110445760405162461bcd60e51b815260206004820152603360248201527f496e73756666696369656e7420676173206c696d69742c206d7573742062652060448201527261626f766520696e7472696e7369632067617360681b6064820152608401610425565b505050565b606954600061105d8883888a89898961056a565b606980546001810182556000919091527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe399914308018190556040519091506001600160a01b0380891691908a16907f69cfcb8e6d4192b8aba9902243912587f37e550d75c1fa801491fce26717f37e906110dd908a9087908b908b908b90611543565b60405180910390a35050505050505050565b600054610100900460ff166111165760405162461bcd60e51b815260040161042590611591565b6107cb600054610100900460ff166111405760405162461bcd60e51b815260040161042590611591565b6107cb33610f19565b60006020828403121561115b57600080fd5b5035919050565b60008060006060848603121561117757600080fd5b505081359360208301359350604090920135919050565b80356001600160a01b038116811461059957600080fd5b60008083601f8401126111b757600080fd5b50813567ffffffffffffffff8111156111cf57600080fd5b6020830191508360208285010111156111e757600080fd5b9250929050565b600080600080600080600060c0888a03121561120957600080fd5b6112128861118e565b9650602088013595506040880135945061122e6060890161118e565b93506080880135925060a088013567ffffffffffffffff81111561125157600080fd5b61125d8a828b016111a5565b989b979a50959850939692959293505050565b60006020828403121561128257600080fd5b610c928261118e565b600080600080606085870312156112a157600080fd5b6112aa8561118e565b935060208501359250604085013567ffffffffffffffff8111156112cd57600080fd5b6112d9878288016111a5565b95989497509550505050565b60008060008060008060a087890312156112fe57600080fd5b6113078761118e565b95506113156020880161118e565b94506040870135935060608701359250608087013567ffffffffffffffff81111561133f57600080fd5b61134b89828a016111a5565b979a9699509497509295939492505050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561138557600080fd5b813567ffffffffffffffff8082111561139d57600080fd5b818401915084601f8301126113b157600080fd5b8135818111156113c3576113c361135d565b604051601f8201601f19908116603f011681019083821181831017156113eb576113eb61135d565b8160405282815287602084870101111561140457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080600080600060a0868803121561143c57600080fd5b6114458661118e565b94506114536020870161118e565b93506114616040870161118e565b925061146f6060870161118e565b949793965091946080013592915050565b60208082526026908201527f4f6e6c792063616c6c61626c6520627920746865204c315363726f6c6c4d657360408201526539b2b733b2b960d11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156114ee57600080fd5b5051919050565b600060208083528351808285015260005b8181101561152257858101830151858201604001528201611506565b506000604082860101526040601f19601f8301168501019250505092915050565b85815267ffffffffffffffff8516602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220d69f9ff214ec92f1b27ff4853bc954120bb9686716812fccc81ad016eca9392564736f6c63430008100033
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.