Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
ERC20RollupEventInbox
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./AbsRollupEventInbox.sol"; import "../bridge/IERC20Bridge.sol"; /** * @title The inbox for rollup protocol events */ contract ERC20RollupEventInbox is AbsRollupEventInbox { constructor() AbsRollupEventInbox() {} function _enqueueInitializationMsg(bytes memory initMsg) internal override returns (uint256) { uint256 tokenAmount = 0; return IERC20Bridge(address(bridge)).enqueueDelayedMessage( INITIALIZATION_MSG_TYPE, address(0), keccak256(initMsg), tokenAmount ); } function _currentDataCostToReport() internal pure override returns (uint256) { // at the moment chains using fee token in Anytrust mode do not charge for the data posting fees return 0; } }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 // solhint-disable-next-line compiler-version pragma solidity >=0.6.9 <0.9.0; import "./IOwnable.sol"; interface IBridge { /// @dev This is an instruction to offchain readers to inform them where to look /// for sequencer inbox batch data. This is not the type of data (eg. das, brotli encoded, or blob versioned hash) /// and this enum is not used in the state transition function, rather it informs an offchain /// reader where to find the data so that they can supply it to the replay binary enum BatchDataLocation { /// @notice The data can be found in the transaction call data TxInput, /// @notice The data can be found in an event emitted during the transaction SeparateBatchEvent, /// @notice This batch contains no data NoData, /// @notice The data can be found in the 4844 data blobs on this transaction Blob } struct TimeBounds { uint64 minTimestamp; uint64 maxTimestamp; uint64 minBlockNumber; uint64 maxBlockNumber; } event MessageDelivered( uint256 indexed messageIndex, bytes32 indexed beforeInboxAcc, address inbox, uint8 kind, address sender, bytes32 messageDataHash, uint256 baseFeeL1, uint64 timestamp ); event BridgeCallTriggered( address indexed outbox, address indexed to, uint256 value, bytes data ); event InboxToggle(address indexed inbox, bool enabled); event OutboxToggle(address indexed outbox, bool enabled); event SequencerInboxUpdated(address newSequencerInbox); event RollupUpdated(address rollup); function allowedDelayedInboxList(uint256) external returns (address); function allowedOutboxList(uint256) external returns (address); /// @dev Accumulator for delayed inbox messages; tail represents hash of the current state; each element represents the inclusion of a new message. function delayedInboxAccs(uint256) external view returns (bytes32); /// @dev Accumulator for sequencer inbox messages; tail represents hash of the current state; each element represents the inclusion of a new message. function sequencerInboxAccs(uint256) external view returns (bytes32); function rollup() external view returns (IOwnable); function sequencerInbox() external view returns (address); function activeOutbox() external view returns (address); function allowedDelayedInboxes(address inbox) external view returns (bool); function allowedOutboxes(address outbox) external view returns (bool); function sequencerReportedSubMessageCount() external view returns (uint256); function executeCall( address to, uint256 value, bytes calldata data ) external returns (bool success, bytes memory returnData); function delayedMessageCount() external view returns (uint256); function sequencerMessageCount() external view returns (uint256); // ---------- onlySequencerInbox functions ---------- function enqueueSequencerMessage( bytes32 dataHash, uint256 afterDelayedMessagesRead, uint256 prevMessageCount, uint256 newMessageCount ) external returns ( uint256 seqMessageIndex, bytes32 beforeAcc, bytes32 delayedAcc, bytes32 acc ); /** * @dev Allows the sequencer inbox to submit a delayed message of the batchPostingReport type * This is done through a separate function entrypoint instead of allowing the sequencer inbox * to call `enqueueDelayedMessage` to avoid the gas overhead of an extra SLOAD in either * every delayed inbox or every sequencer inbox call. */ function submitBatchSpendingReport(address batchPoster, bytes32 dataHash) external returns (uint256 msgNum); // ---------- onlyRollupOrOwner functions ---------- function setSequencerInbox(address _sequencerInbox) external; function setDelayedInbox(address inbox, bool enabled) external; function setOutbox(address inbox, bool enabled) external; function updateRollupAddress(IOwnable _rollup) external; }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 // solhint-disable-next-line compiler-version pragma solidity >=0.6.9 <0.9.0; interface IDelayedMessageProvider { /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator event InboxMessageDelivered(uint256 indexed messageNum, bytes data); /// @dev event emitted when a inbox message is added to the Bridge's delayed accumulator /// same as InboxMessageDelivered but the batch data is available in tx.input event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // SPDX-License-Identifier: BUSL-1.1 // solhint-disable-next-line compiler-version pragma solidity >=0.6.9 <0.9.0; import "./IOwnable.sol"; import "./IBridge.sol"; interface IERC20Bridge is IBridge { /** * @dev token that is escrowed in bridge on L1 side and minted on L2 as native currency. * Fees are paid in this token. There are certain restrictions on the native token: * - The token can't be rebasing or have a transfer fee * - The token must only be transferrable via a call to the token address itself * - The token must only be able to set allowance via a call to the token address itself * - The token must not have a callback on transfer, and more generally a user must not be able to make a transfer to themselves revert */ function nativeToken() external view returns (address); /** * @dev number of decimals used by the native token * This is set on bridge initialization using nativeToken.decimals() * If the token does not have decimals() method, we assume it have 0 decimals */ function nativeTokenDecimals() external view returns (uint8); /** * @dev Enqueue a message in the delayed inbox accumulator. * These messages are later sequenced in the SequencerInbox, either * by the sequencer as part of a normal batch, or by force inclusion. */ function enqueueDelayedMessage( uint8 kind, address sender, bytes32 messageDataHash, uint256 tokenFeeAmount ) external returns (uint256); // ---------- initializer ---------- function initialize(IOwnable rollup_, address nativeToken_) external; }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // SPDX-License-Identifier: BUSL-1.1 // solhint-disable-next-line compiler-version pragma solidity >=0.6.9 <0.9.0; import "./IOwnable.sol"; import "./IBridge.sol"; interface IEthBridge is IBridge { /** * @dev Enqueue a message in the delayed inbox accumulator. * These messages are later sequenced in the SequencerInbox, either * by the sequencer as part of a normal batch, or by force inclusion. */ function enqueueDelayedMessage( uint8 kind, address sender, bytes32 messageDataHash ) external payable returns (uint256); // ---------- initializer ---------- function initialize(IOwnable rollup_) external; }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 // solhint-disable-next-line compiler-version pragma solidity >=0.4.21 <0.9.0; interface IOwnable { function owner() external view returns (address); }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "../precompiles/ArbSys.sol"; library ArbitrumChecker { function runningOnArbitrum() internal view returns (bool) { (bool ok, bytes memory data) = address(100).staticcall( abi.encodeWithSelector(ArbSys.arbOSVersion.selector) ); return ok && data.length == 32; } }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {NotOwner} from "./Error.sol"; /// @dev A stateless contract that allows you to infer if the current call has been delegated or not /// Pattern used here is from UUPS implementation by the OpenZeppelin team abstract contract DelegateCallAware { address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegate call. This allows a function to be * callable on the proxy contract but not on the logic contract. */ modifier onlyDelegated() { require(address(this) != __self, "Function must be called through delegatecall"); _; } /** * @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, "Function must not be called through delegatecall"); _; } /// @dev Check that msg.sender is the current EIP 1967 proxy admin modifier onlyProxyOwner() { // Storage slot with the admin of the proxy contract // This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1 bytes32 slot = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; address admin; assembly { admin := sload(slot) } if (msg.sender != admin) revert NotOwner(msg.sender, admin); _; } }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.4; /// @dev Init was already called error AlreadyInit(); /// @dev Init was called with param set to zero that must be nonzero error HadZeroInit(); /// @dev Thrown when post upgrade init validation fails error BadPostUpgradeInit(); /// @dev Thrown when the caller is not a codeless origin error NotCodelessOrigin(); /// @dev Thrown when non owner tries to access an only-owner function /// @param sender The msg.sender who is not the owner /// @param owner The owner address error NotOwner(address sender, address owner); /// @dev Thrown when an address that is not the rollup tries to call an only-rollup function /// @param sender The sender who is not the rollup /// @param rollup The rollup address authorized to call this function error NotRollup(address sender, address rollup); /// @dev Thrown when the contract was not called directly from the origin ie msg.sender != tx.origin error NotOrigin(); /// @dev Provided data was too large /// @param dataLength The length of the data that is too large /// @param maxDataLength The max length the data can be error DataTooLarge(uint256 dataLength, uint256 maxDataLength); /// @dev The provided is not a contract and was expected to be /// @param addr The adddress in question error NotContract(address addr); /// @dev The merkle proof provided was too long /// @param actualLength The length of the merkle proof provided /// @param maxProofLength The max length a merkle proof can have error MerkleProofTooLong(uint256 actualLength, uint256 maxProofLength); /// @dev Thrown when an un-authorized address tries to access an admin function /// @param sender The un-authorized sender /// @param rollup The rollup, which would be authorized /// @param owner The rollup's owner, which would be authorized error NotRollupOrOwner(address sender, address rollup, address owner); // Bridge Errors /// @dev Thrown when an un-authorized address tries to access an only-inbox function /// @param sender The un-authorized sender error NotDelayedInbox(address sender); /// @dev Thrown when an un-authorized address tries to access an only-sequencer-inbox function /// @param sender The un-authorized sender error NotSequencerInbox(address sender); /// @dev Thrown when an un-authorized address tries to access an only-outbox function /// @param sender The un-authorized sender error NotOutbox(address sender); /// @dev the provided outbox address isn't valid /// @param outbox address of outbox being set error InvalidOutboxSet(address outbox); /// @dev The provided token address isn't valid /// @param token address of token being set error InvalidTokenSet(address token); /// @dev Call to this specific address is not allowed /// @param target address of the call receiver error CallTargetNotAllowed(address target); /// @dev Call that changes the balance of ERC20Bridge is not allowed error CallNotAllowed(); // Inbox Errors /// @dev msg.value sent to the inbox isn't high enough error InsufficientValue(uint256 expected, uint256 actual); /// @dev submission cost provided isn't enough to create retryable ticket error InsufficientSubmissionCost(uint256 expected, uint256 actual); /// @dev address not allowed to interact with the given contract error NotAllowedOrigin(address origin); /// @dev used to convey retryable tx data in eth calls without requiring a tx trace /// this follows a pattern similar to EIP-3668 where reverts surface call information error RetryableData( address from, address to, uint256 l2CallValue, uint256 deposit, uint256 maxSubmissionCost, address excessFeeRefundAddress, address callValueRefundAddress, uint256 gasLimit, uint256 maxFeePerGas, bytes data ); /// @dev Thrown when a L1 chainId fork is detected error L1Forked(); /// @dev Thrown when a L1 chainId fork is not detected error NotForked(); /// @dev The provided gasLimit is larger than uint64 error GasLimitTooLarge(); /// @dev The provided amount cannot be adjusted to 18 decimals due to overflow error AmountTooLarge(uint256 amount); /// @dev Number of native token's decimals is restricted to enable conversions to 18 decimals error NativeTokenDecimalsTooLarge(uint256 decimals); // Outbox Errors /// @dev The provided proof was too long /// @param proofLength The length of the too-long proof error ProofTooLong(uint256 proofLength); /// @dev The output index was greater than the maximum /// @param index The output index /// @param maxIndex The max the index could be error PathNotMinimal(uint256 index, uint256 maxIndex); /// @dev The calculated root does not exist /// @param root The calculated root error UnknownRoot(bytes32 root); /// @dev The record has already been spent /// @param index The index of the spent record error AlreadySpent(uint256 index); /// @dev A call to the bridge failed with no return data error BridgeCallFailed(); // Sequencer Inbox Errors /// @dev Thrown when someone attempts to read fewer messages than have already been read error DelayedBackwards(); /// @dev Thrown when someone attempts to read more messages than exist error DelayedTooFar(); /// @dev Force include can only read messages more blocks old than the delay period error ForceIncludeBlockTooSoon(); /// @dev Force include can only read messages more seconds old than the delay period error ForceIncludeTimeTooSoon(); /// @dev The message provided did not match the hash in the delayed inbox error IncorrectMessagePreimage(); /// @dev This can only be called by the batch poster error NotBatchPoster(); /// @dev The sequence number provided to this message was inconsistent with the number of batches already included error BadSequencerNumber(uint256 stored, uint256 received); /// @dev The sequence message number provided to this message was inconsistent with the previous one error BadSequencerMessageNumber(uint256 stored, uint256 received); /// @dev Tried to create an already valid Data Availability Service keyset error AlreadyValidDASKeyset(bytes32); /// @dev Tried to use or invalidate an already invalid Data Availability Service keyset error NoSuchKeyset(bytes32); /// @dev Thrown when the provided address is not the designated batch poster manager error NotBatchPosterManager(address); /// @dev Thrown when a data blob feature is attempted to be used on a chain that doesnt support it error DataBlobsNotSupported(); /// @dev Thrown when an init param was supplied as empty error InitParamZero(string name); /// @dev Thrown when data hashes where expected but not where present on the tx error MissingDataHashes(); /// @dev Thrown when rollup is not updated with updateRollupAddress error RollupNotChanged(); /// @dev Unsupported header flag was provided error InvalidHeaderFlag(bytes1); /// @dev SequencerInbox and Bridge are not in the same feeToken/ETH mode error NativeTokenMismatch(); /// @dev Thrown when a deprecated function is called error Deprecated(); /// @dev Thrown when any component of maxTimeVariation is over uint64 error BadMaxTimeVariation();
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.4; uint8 constant L2_MSG = 3; uint8 constant L1MessageType_L2FundedByL1 = 7; uint8 constant L1MessageType_submitRetryableTx = 9; uint8 constant L1MessageType_ethDeposit = 12; uint8 constant L1MessageType_batchPostingReport = 13; uint8 constant L2MessageType_unsignedEOATx = 0; uint8 constant L2MessageType_unsignedContractTx = 1; uint8 constant ROLLUP_PROTOCOL_EVENT_TYPE = 8; uint8 constant INITIALIZATION_MSG_TYPE = 11;
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.4.21 <0.9.0; /// @title Provides insight into the cost of using the chain. /// @notice These methods have been adjusted to account for Nitro's heavy use of calldata compression. /// Of note to end-users, we no longer make a distinction between non-zero and zero-valued calldata bytes. /// Precompiled contract that exists in every Arbitrum chain at 0x000000000000000000000000000000000000006c. interface ArbGasInfo { /// @notice Get gas prices for a provided aggregator /// @return return gas prices in wei /// ( /// per L2 tx, /// per L1 calldata byte /// per storage allocation, /// per ArbGas base, /// per ArbGas congestion, /// per ArbGas total /// ) function getPricesInWeiWithAggregator(address aggregator) external view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ); /// @notice Get gas prices. Uses the caller's preferred aggregator, or the default if the caller doesn't have a preferred one. /// @return return gas prices in wei /// ( /// per L2 tx, /// per L1 calldata byte /// per storage allocation, /// per ArbGas base, /// per ArbGas congestion, /// per ArbGas total /// ) function getPricesInWei() external view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ); /// @notice Get prices in ArbGas for the supplied aggregator /// @return (per L2 tx, per L1 calldata byte, per storage allocation) function getPricesInArbGasWithAggregator(address aggregator) external view returns ( uint256, uint256, uint256 ); /// @notice Get prices in ArbGas. Assumes the callers preferred validator, or the default if caller doesn't have a preferred one. /// @return (per L2 tx, per L1 calldata byte, per storage allocation) function getPricesInArbGas() external view returns ( uint256, uint256, uint256 ); /// @notice Get the gas accounting parameters. `gasPoolMax` is always zero, as the exponential pricing model has no such notion. /// @return (speedLimitPerSecond, gasPoolMax, maxTxGasLimit) function getGasAccountingParams() external view returns ( uint256, uint256, uint256 ); /// @notice Get the minimum gas price needed for a tx to succeed function getMinimumGasPrice() external view returns (uint256); /// @notice Get ArbOS's estimate of the L1 basefee in wei function getL1BaseFeeEstimate() external view returns (uint256); /// @notice Get how slowly ArbOS updates its estimate of the L1 basefee function getL1BaseFeeEstimateInertia() external view returns (uint64); /// @notice Get the L1 pricer reward rate, in wei per unit /// Available in ArbOS version 11 function getL1RewardRate() external view returns (uint64); /// @notice Get the L1 pricer reward recipient /// Available in ArbOS version 11 function getL1RewardRecipient() external view returns (address); /// @notice Deprecated -- Same as getL1BaseFeeEstimate() function getL1GasPriceEstimate() external view returns (uint256); /// @notice Get L1 gas fees paid by the current transaction function getCurrentTxL1GasFees() external view returns (uint256); /// @notice Get the backlogged amount of gas burnt in excess of the speed limit function getGasBacklog() external view returns (uint64); /// @notice Get how slowly ArbOS updates the L2 basefee in response to backlogged gas function getPricingInertia() external view returns (uint64); /// @notice Get the forgivable amount of backlogged gas ArbOS will ignore when raising the basefee function getGasBacklogTolerance() external view returns (uint64); /// @notice Returns the surplus of funds for L1 batch posting payments (may be negative). function getL1PricingSurplus() external view returns (int256); /// @notice Returns the base charge (in L1 gas) attributed to each data batch in the calldata pricer function getPerBatchGasCharge() external view returns (int64); /// @notice Returns the cost amortization cap in basis points function getAmortizedCostCapBips() external view returns (uint64); /// @notice Returns the available funds from L1 fees function getL1FeesAvailable() external view returns (uint256); /// @notice Returns the equilibration units parameter for L1 price adjustment algorithm /// Available in ArbOS version 20 function getL1PricingEquilibrationUnits() external view returns (uint256); /// @notice Returns the last time the L1 calldata pricer was updated. /// Available in ArbOS version 20 function getLastL1PricingUpdateTime() external view returns (uint64); /// @notice Returns the amount of L1 calldata payments due for rewards (per the L1 reward rate) /// Available in ArbOS version 20 function getL1PricingFundsDueForRewards() external view returns (uint256); /// @notice Returns the amount of L1 calldata posted since the last update. /// Available in ArbOS version 20 function getL1PricingUnitsSinceUpdate() external view returns (uint64); /// @notice Returns the L1 pricing surplus as of the last update (may be negative). /// Available in ArbOS version 20 function getLastL1PricingSurplus() external view returns (int256); }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.4.21 <0.9.0; /** * @title System level functionality * @notice For use by contracts to interact with core L2-specific functionality. * Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. */ interface ArbSys { /** * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0) * @return block number as int */ function arbBlockNumber() external view returns (uint256); /** * @notice Get Arbitrum block hash (reverts unless currentBlockNum-256 <= arbBlockNum < currentBlockNum) * @return block hash */ function arbBlockHash(uint256 arbBlockNum) external view returns (bytes32); /** * @notice Gets the rollup's unique chain identifier * @return Chain identifier as int */ function arbChainID() external view returns (uint256); /** * @notice Get internal version number identifying an ArbOS build, this is `55 + nitroArbOS version number` * e.g. on ArbOS 31 this would return 86. This is the only function that have the 55 offset. * @return version number as int */ function arbOSVersion() external view returns (uint256); /** * @notice Returns 0 since Nitro has no concept of storage gas * @return uint 0 */ function getStorageGasAvailable() external view returns (uint256); /** * @notice (deprecated) check if current call is top level (meaning it was triggered by an EoA or a L1 contract) * @dev this call has been deprecated and may be removed in a future release * @return true if current execution frame is not a call by another L2 contract */ function isTopLevelCall() external view returns (bool); /** * @notice map L1 sender contract address to its L2 alias * @param sender sender address * @param unused argument no longer used * @return aliased sender address */ function mapL1SenderContractAddressToL2Alias(address sender, address unused) external pure returns (address); /** * @notice check if the caller (of this caller of this) is an aliased L1 contract address * @return true iff the caller's address is an alias for an L1 contract address */ function wasMyCallersAddressAliased() external view returns (bool); /** * @notice return the address of the caller (of this caller of this), without applying L1 contract address aliasing * @return address of the caller's caller, without applying L1 contract address aliasing */ function myCallersAddressWithoutAliasing() external view returns (address); /** * @notice Send given amount of Eth to dest from sender. * This is a convenience function, which is equivalent to calling sendTxToL1 with empty data. * @param destination recipient address on L1 * @return unique identifier for this L2-to-L1 transaction. */ function withdrawEth(address destination) external payable returns (uint256); /** * @notice Send a transaction to L1 * @dev it is not possible to execute on the L1 any L2-to-L1 transaction which contains data * to a contract address without any code (as enforced by the Bridge contract). * @param destination recipient address on L1 * @param data (optional) calldata for L1 contract call * @return a unique identifier for this L2-to-L1 transaction. */ function sendTxToL1(address destination, bytes calldata data) external payable returns (uint256); /** * @notice Get send Merkle tree state * @return size number of sends in the history * @return root root hash of the send history * @return partials hashes of partial subtrees in the send history tree */ function sendMerkleTreeState() external view returns ( uint256 size, bytes32 root, bytes32[] memory partials ); /** * @notice creates a send txn from L2 to L1 * @param position = (level << 192) + leaf = (0 << 192) + leaf = leaf */ event L2ToL1Tx( address caller, address indexed destination, uint256 indexed hash, uint256 indexed position, uint256 arbBlockNum, uint256 ethBlockNum, uint256 timestamp, uint256 callvalue, bytes data ); /// @dev DEPRECATED in favour of the new L2ToL1Tx event above after the nitro upgrade event L2ToL1Transaction( address caller, address indexed destination, uint256 indexed uniqueId, uint256 indexed batchNumber, uint256 indexInBatch, uint256 arbBlockNum, uint256 ethBlockNum, uint256 timestamp, uint256 callvalue, bytes data ); /** * @notice logs a merkle branch for proof synthesis * @param reserved an index meant only to align the 4th index with L2ToL1Transaction's 4th event * @param hash the merkle hash * @param position = (level << 192) + leaf */ event SendMerkleUpdate( uint256 indexed reserved, bytes32 indexed hash, uint256 indexed position ); error InvalidBlockNumber(uint256 requested, uint256 current); }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./IRollupEventInbox.sol"; import "../bridge/IBridge.sol"; import "../bridge/IEthBridge.sol"; import "../precompiles/ArbGasInfo.sol"; import "../libraries/ArbitrumChecker.sol"; import "../bridge/IDelayedMessageProvider.sol"; import "../libraries/DelegateCallAware.sol"; import {INITIALIZATION_MSG_TYPE} from "../libraries/MessageTypes.sol"; import {AlreadyInit, HadZeroInit, RollupNotChanged} from "../libraries/Error.sol"; /** * @title The inbox for rollup protocol events */ abstract contract AbsRollupEventInbox is IRollupEventInbox, IDelayedMessageProvider, DelegateCallAware { IBridge public override bridge; address public override rollup; modifier onlyRollup() { require(msg.sender == rollup, "ONLY_ROLLUP"); _; } function initialize(IBridge _bridge) external override onlyDelegated { if (address(bridge) != address(0)) revert AlreadyInit(); if (address(_bridge) == address(0)) revert HadZeroInit(); bridge = _bridge; rollup = address(_bridge.rollup()); } /// @notice Allows the rollup owner to sync the rollup address function updateRollupAddress() external { if (msg.sender != IOwnable(rollup).owner()) revert NotOwner(msg.sender, IOwnable(rollup).owner()); address newRollup = address(bridge.rollup()); if (rollup == newRollup) revert RollupNotChanged(); rollup = newRollup; } function rollupInitialized(uint256 chainId, string calldata chainConfig) external override onlyRollup { require(bytes(chainConfig).length > 0, "EMPTY_CHAIN_CONFIG"); uint8 initMsgVersion = 1; uint256 currentDataCost = _currentDataCostToReport(); bytes memory initMsg = abi.encodePacked( chainId, initMsgVersion, currentDataCost, chainConfig ); uint256 num = _enqueueInitializationMsg(initMsg); emit InboxMessageDelivered(num, initMsg); } function _enqueueInitializationMsg(bytes memory initMsg) internal virtual returns (uint256); function _currentDataCostToReport() internal virtual returns (uint256); }
// Copyright 2021-2022, Offchain Labs, Inc. // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "../bridge/IBridge.sol"; interface IRollupEventInbox { function bridge() external view returns (IBridge); function initialize(IBridge _bridge) external; function rollup() external view returns (address); function updateRollupAddress() external; function rollupInitialized(uint256 chainId, string calldata chainConfig) external; }
{ "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInit","type":"error"},{"inputs":[],"name":"HadZeroInit","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"NotOwner","type":"error"},{"inputs":[],"name":"RollupNotChanged","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"messageNum","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"InboxMessageDelivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"messageNum","type":"uint256"}],"name":"InboxMessageDeliveredFromOrigin","type":"event"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"contract IBridge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBridge","name":"_bridge","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollup","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"string","name":"chainConfig","type":"string"}],"name":"rollupInitialized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateRollupAddress","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b506080516107cf61003060003960006102ff01526107cf6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80636ae71f121461005c578063c4d66de814610066578063cb23bcb514610079578063cf8d56d6146100a8578063e78cea92146100bb575b600080fd5b6100646100ce565b005b610064610074366004610644565b6102f4565b60015461008c906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100646100b6366004610661565b610482565b60005461008c906001600160a01b031681565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011c57600080fd5b505afa158015610130573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015491906106dd565b6001600160a01b0316336001600160a01b0316146102195760015460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b1580156101b057600080fd5b505afa1580156101c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e891906106dd565b604051631194af8760e11b81526001600160a01b039283166004820152911660248201526044015b60405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b031663cb23bcb56040518163ffffffff1660e01b815260040160206040518083038186803b15801561026857600080fd5b505afa15801561027c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a091906106dd565b6001549091506001600160a01b03808316911614156102d25760405163d054909f60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156103825760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610210565b6000546001600160a01b0316156103ac57604051633bcd329760e21b815260040160405180910390fd5b6001600160a01b0381166103d357604051631ad0f74360e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040805163cb23bcb560e01b8152905163cb23bcb591600480820192602092909190829003018186803b15801561042757600080fd5b505afa15801561043b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045f91906106dd565b600180546001600160a01b0319166001600160a01b039290921691909117905550565b6001546001600160a01b031633146104ca5760405162461bcd60e51b815260206004820152600b60248201526a04f4e4c595f524f4c4c55560ac1b6044820152606401610210565b8061050c5760405162461bcd60e51b8152602060048201526012602482015271454d5054595f434841494e5f434f4e46494760701b6044820152606401610210565b6001600080858383878760405160200161052a9594939291906106fa565b6040516020818303038152906040529050600061054682610589565b9050807fff64905f73a67fb594e0f940a8075a860db489ad991e032f48c81123eb52d60b83604051610578919061072b565b60405180910390a250505050505050565b60008054825160208401206040516375d81e2560e01b8152600b60048201526024810184905260448101919091526064810183905282916001600160a01b0316906375d81e2590608401602060405180830381600087803b1580156105ed57600080fd5b505af1158015610601573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106259190610780565b9392505050565b6001600160a01b038116811461064157600080fd5b50565b60006020828403121561065657600080fd5b81356106258161062c565b60008060006040848603121561067657600080fd5b83359250602084013567ffffffffffffffff8082111561069557600080fd5b818601915086601f8301126106a957600080fd5b8135818111156106b857600080fd5b8760208285010111156106ca57600080fd5b6020830194508093505050509250925092565b6000602082840312156106ef57600080fd5b81516106258161062c565b85815260ff60f81b8560f81b1660208201528360218201528183604183013760009101604101908152949350505050565b600060208083528351808285015260005b818110156107585785810183015185820160400152820161073c565b8181111561076a576000604083870101525b50601f01601f1916929092016040019392505050565b60006020828403121561079257600080fd5b505191905056fea2646970667358221220031f35bf3b3e0f2234d071835499fcc4151dfbd273d93b742c4e044dcad20ffd64736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c80636ae71f121461005c578063c4d66de814610066578063cb23bcb514610079578063cf8d56d6146100a8578063e78cea92146100bb575b600080fd5b6100646100ce565b005b610064610074366004610644565b6102f4565b60015461008c906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100646100b6366004610661565b610482565b60005461008c906001600160a01b031681565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011c57600080fd5b505afa158015610130573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015491906106dd565b6001600160a01b0316336001600160a01b0316146102195760015460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b1580156101b057600080fd5b505afa1580156101c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e891906106dd565b604051631194af8760e11b81526001600160a01b039283166004820152911660248201526044015b60405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b031663cb23bcb56040518163ffffffff1660e01b815260040160206040518083038186803b15801561026857600080fd5b505afa15801561027c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a091906106dd565b6001549091506001600160a01b03808316911614156102d25760405163d054909f60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000760c1b5fe95b2c66d67662ec544975bdbb1296451614156103825760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608401610210565b6000546001600160a01b0316156103ac57604051633bcd329760e21b815260040160405180910390fd5b6001600160a01b0381166103d357604051631ad0f74360e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040805163cb23bcb560e01b8152905163cb23bcb591600480820192602092909190829003018186803b15801561042757600080fd5b505afa15801561043b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045f91906106dd565b600180546001600160a01b0319166001600160a01b039290921691909117905550565b6001546001600160a01b031633146104ca5760405162461bcd60e51b815260206004820152600b60248201526a04f4e4c595f524f4c4c55560ac1b6044820152606401610210565b8061050c5760405162461bcd60e51b8152602060048201526012602482015271454d5054595f434841494e5f434f4e46494760701b6044820152606401610210565b6001600080858383878760405160200161052a9594939291906106fa565b6040516020818303038152906040529050600061054682610589565b9050807fff64905f73a67fb594e0f940a8075a860db489ad991e032f48c81123eb52d60b83604051610578919061072b565b60405180910390a250505050505050565b60008054825160208401206040516375d81e2560e01b8152600b60048201526024810184905260448101919091526064810183905282916001600160a01b0316906375d81e2590608401602060405180830381600087803b1580156105ed57600080fd5b505af1158015610601573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106259190610780565b9392505050565b6001600160a01b038116811461064157600080fd5b50565b60006020828403121561065657600080fd5b81356106258161062c565b60008060006040848603121561067657600080fd5b83359250602084013567ffffffffffffffff8082111561069557600080fd5b818601915086601f8301126106a957600080fd5b8135818111156106b857600080fd5b8760208285010111156106ca57600080fd5b6020830194508093505050509250925092565b6000602082840312156106ef57600080fd5b81516106258161062c565b85815260ff60f81b8560f81b1660208201528360218201528183604183013760009101604101908152949350505050565b600060208083528351808285015260005b818110156107585785810183015185820160400152820161073c565b8181111561076a576000604083870101525b50601f01601f1916929092016040019392505050565b60006020828403121561079257600080fd5b505191905056fea2646970667358221220031f35bf3b3e0f2234d071835499fcc4151dfbd273d93b742c4e044dcad20ffd64736f6c63430008090033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.