Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
L2GovernanceRelay
Compiler Version
v0.6.11+commit.5ef660b1
Contract Source Code (Solidity)
/** *Submitted for verification at Nova.Arbiscan.io on 2022-10-28 */ // SPDX-License-Identifier: AGPL-3.0-or-later // Copyright (C) 2022 Dai Foundation // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.6.11; /** * @title Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality. */ interface ArbSys { /** * @notice Get internal version number identifying an ArbOS build * @return version number as int */ function arbOSVersion() external pure returns (uint256); function arbChainID() external view returns (uint256); /** * @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 Send given amount of Eth to dest from sender. * This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1. * @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 * @param destination recipient address on L1 * @param calldataForL1 (optional) calldata for L1 contract call * @return a unique identifier for this L2-to-L1 transaction. */ function sendTxToL1(address destination, bytes calldata calldataForL1) external payable returns (uint256); /** * @notice get the number of transactions issued by the given external account or the account sequence number of the given contract * @param account target account * @return the number of transactions issued by the given external account or the account sequence number of the given contract */ function getTransactionCount(address account) external view returns (uint256); /** * @notice get the value of target L2 storage slot * This function is only callable from address 0 to prevent contracts from being able to call it * @param account target account * @param index target index of storage slot * @return stotage value for the given account at the given index */ function getStorageAt(address account, uint256 index) external view returns (uint256); /** * @notice check if current call is coming from l1 * @return true if the caller of this was called directly from L1 */ function isTopLevelCall() external view returns (bool); event EthWithdrawal(address indexed destAddr, uint256 amount); 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 ); } abstract contract L2CrossDomainEnabled { event TxToL1(address indexed from, address indexed to, uint256 indexed id, bytes data); function sendTxToL1( address user, address to, bytes memory data ) internal returns (uint256) { // note: this method doesn't support sending ether to L1 together with a call uint256 id = ArbSys(address(100)).sendTxToL1(to, data); emit TxToL1(user, to, id, data); return id; } modifier onlyL1Counterpart(address l1Counterpart) { require(msg.sender == applyL1ToL2Alias(l1Counterpart), "ONLY_COUNTERPART_GATEWAY"); _; } uint160 constant offset = uint160(0x1111000000000000000000000000000000001111); // l1 addresses are transformed durng l1->l2 calls function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { l2Address = address(uint160(l1Address) + offset); } } // Receive xchain message from L1 counterpart and execute given spell contract L2GovernanceRelay is L2CrossDomainEnabled { address public immutable l1GovernanceRelay; constructor(address _l1GovernanceRelay) public { l1GovernanceRelay = _l1GovernanceRelay; } // Allow contract to receive ether receive() external payable {} function relay(address target, bytes calldata targetData) external onlyL1Counterpart(l1GovernanceRelay) { (bool ok, ) = target.delegatecall(targetData); // note: even if a retryable call fails, it can be retried require(ok, "L2GovernanceRelay/delegatecall-error"); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_l1GovernanceRelay","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"TxToL1","type":"event"},{"inputs":[],"name":"l1GovernanceRelay","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"targetData","type":"bytes"}],"name":"relay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161040d38038061040d8339818101604052602081101561003357600080fd5b81019080805190602001909291905050508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250505060805160601c61036f61009e60003980610138528061015c525061036f6000f3fe60806040526004361061002d5760003560e01c80635892807d14610039578063c28e83fd1461009057610034565b3661003457005b600080fd5b34801561004557600080fd5b5061004e610136565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561009c57600080fd5b50610134600480360360408110156100b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100f057600080fd5b82018360208201111561010257600080fd5b8035906020019184600183028401116401000000008311171561012457600080fd5b909192939192939050505061015a565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b7f0000000000000000000000000000000000000000000000000000000000000000610184816102f5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610224576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f4e4c595f434f554e544552504152545f47415445574159000000000000000081525060200191505060405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff168484604051808383808284378083019250505092505050600060405180830381855af49150503d806000811461028f576040519150601f19603f3d011682016040523d82523d6000602084013e610294565b606091505b50509050806102ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806103166024913960400191505060405180910390fd5b5050505050565b60007311110000000000000000000000000000000011118201905091905056fe4c32476f7665726e616e636552656c61792f64656c656761746563616c6c2d6572726f72a264697066735822122089875e30cae1ec85c01cfd52f980d2fa8eb70cfc7ddb3c5e688b22101516c14464736f6c634300060b0033000000000000000000000000b90ab1055fc1d314be197f2385a2900347621d78
Deployed Bytecode
0x60806040526004361061002d5760003560e01c80635892807d14610039578063c28e83fd1461009057610034565b3661003457005b600080fd5b34801561004557600080fd5b5061004e610136565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561009c57600080fd5b50610134600480360360408110156100b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100f057600080fd5b82018360208201111561010257600080fd5b8035906020019184600183028401116401000000008311171561012457600080fd5b909192939192939050505061015a565b005b7f000000000000000000000000b90ab1055fc1d314be197f2385a2900347621d7881565b7f000000000000000000000000b90ab1055fc1d314be197f2385a2900347621d78610184816102f5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610224576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f4e4c595f434f554e544552504152545f47415445574159000000000000000081525060200191505060405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff168484604051808383808284378083019250505092505050600060405180830381855af49150503d806000811461028f576040519150601f19603f3d011682016040523d82523d6000602084013e610294565b606091505b50509050806102ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806103166024913960400191505060405180910390fd5b5050505050565b60007311110000000000000000000000000000000011118201905091905056fe4c32476f7665726e616e636552656c61792f64656c656761746563616c6c2d6572726f72a264697066735822122089875e30cae1ec85c01cfd52f980d2fa8eb70cfc7ddb3c5e688b22101516c14464736f6c634300060b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b90ab1055fc1d314be197f2385a2900347621d78
-----Decoded View---------------
Arg [0] : _l1GovernanceRelay (address): 0xb90Ab1055fC1d314be197F2385a2900347621d78
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b90ab1055fc1d314be197f2385a2900347621d78
Deployed Bytecode Sourcemap
4579:582:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4635:42;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;4861:297;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;4635:42;;;:::o;4861:297::-;4956:17;4133:31;4150:13;4133:16;:31::i;:::-;4119:45;;:10;:45;;;4111:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4986:7:::1;4999:6;:19;;5019:10;;4999:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4985:45;;;5109:2;5101:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4200:1;4861:297:::0;;;;:::o;4351:148::-;4419:17;4247:42;4473:9;4465:27;4445:48;;4351:148;;;:::o
Swarm Source
ipfs://89875e30cae1ec85c01cfd52f980d2fa8eb70cfc7ddb3c5e688b22101516c144
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.