Commit 42a4cc30 authored by smartcontracts's avatar smartcontracts Committed by GitHub

style(ctb): remove Lib_ and OVM_ prefixes (#2923)

Removes Lib_ and OVM_ prefixes from all contracts. We're no longer using
prefixes for new contracts, I see no good reason to include prefixes for
all of the older contracts that are being included and overhauled as
part of this upgrade. Keeps everything consistent while also removing
some legacy cruft.
parent 2e89f634
---
'@eth-optimism/contracts-bedrock': minor
---
Remove Lib* and OVM* prefixes from all contracts
......@@ -33,7 +33,7 @@ gas-price-oracle-bindings:
./gen_bindings.sh GasPriceOracle bindings
address-manager-bindings:
./gen_bindings.sh Lib_AddressManager bindings
./gen_bindings.sh AddressManager bindings
mkdir:
mkdir -p bin bindings
......
......@@ -102,64 +102,15 @@ L2StandardBridge_Test:test_withdraw_onlyEOA() (gas: 251952)
L2ToL1MessagePasserTest:test_burn() (gas: 112024)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromContract() (gas: 67935)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromEOA() (gas: 74851)
Lib_RLPReader_Test:testReadBool() (gas: 1109)
Lib_RLPReader_Test:test_readAddress() (gas: 1347)
Lib_RLPReader_Test:test_readAddressSmall() (gas: 614)
Lib_RLPReader_Test:test_readAddressTooLarge() (gas: 3646)
Lib_RLPReader_Test:test_readAddressTooShort() (gas: 3603)
Lib_RLPReader_Test:test_readBoolInvalidValue() (gas: 3677)
Lib_RLPReader_Test:test_readBoolLargeInput() (gas: 3550)
Lib_RLPReader_Test:test_readBytes32_revertOnList() (gas: 3998)
Lib_RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3588)
Lib_RLPReader_Test:test_readBytes_bytestring00() (gas: 1823)
Lib_RLPReader_Test:test_readBytes_bytestring01() (gas: 1846)
Lib_RLPReader_Test:test_readBytes_bytestring7f() (gas: 1844)
Lib_RLPReader_Test:test_readBytes_invalidListLength() (gas: 3812)
Lib_RLPReader_Test:test_readBytes_invalidStringLength() (gas: 3768)
Lib_RLPReader_Test:test_readBytes_revertListItem() (gas: 3922)
Lib_RLPReader_Test:test_readList_dictTest1() (gas: 23791)
Lib_RLPReader_Test:test_readList_empty() (gas: 4472)
Lib_RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4213)
Lib_RLPReader_Test:test_readList_int32Overflow() (gas: 3958)
Lib_RLPReader_Test:test_readList_int32Overflow2() (gas: 4024)
Lib_RLPReader_Test:test_readList_invalidShortList() (gas: 3858)
Lib_RLPReader_Test:test_readList_invalidValue() (gas: 3790)
Lib_RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4196)
Lib_RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 4180)
Lib_RLPReader_Test:test_readList_leadingZerosInLongLengthList1() (gas: 38563)
Lib_RLPReader_Test:test_readList_listOfLists() (gas: 9619)
Lib_RLPReader_Test:test_readList_listOfLists2() (gas: 12479)
Lib_RLPReader_Test:test_readList_longList1() (gas: 29013)
Lib_RLPReader_Test:test_readList_longList2() (gas: 202895)
Lib_RLPReader_Test:test_readList_longStringLength() (gas: 3856)
Lib_RLPReader_Test:test_readList_multiList() (gas: 12025)
Lib_RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 4203)
Lib_RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4226)
Lib_RLPReader_Test:test_readList_notLongEnough() (gas: 3844)
Lib_RLPReader_Test:test_readList_shortListMax1() (gas: 40662)
Lib_RLPReader_Test:test_readList_stringList() (gas: 16796)
Lib_RLPReader_Test:test_readString_emptyString() (gas: 1719)
Lib_RLPReader_Test:test_readString_longString() (gas: 3076)
Lib_RLPReader_Test:test_readString_longString2() (gas: 18524)
Lib_RLPReader_Test:test_readString_shortString() (gas: 2280)
Lib_RLPReader_Test:test_readString_shortString2() (gas: 2775)
Lib_RLPReader_Test:test_readUint256_mediumInt1() (gas: 1235)
Lib_RLPReader_Test:test_readUint256_mediumInt2() (gas: 1237)
Lib_RLPReader_Test:test_readUint256_mediumInt3() (gas: 1238)
Lib_RLPReader_Test:test_readUint256_smallInt() (gas: 1084)
Lib_RLPReader_Test:test_readUint256_smallInt2() (gas: 1151)
Lib_RLPReader_Test:test_readUint256_smallInt3() (gas: 1127)
Lib_RLPReader_Test:test_readUint256_smallInt4() (gas: 1128)
Lib_RLPReader_Test:test_readUint256_zero() (gas: 1258)
OVM_ETH_Test:test_approve() (gas: 10760)
OVM_ETH_Test:test_burn() (gas: 10675)
OVM_ETH_Test:test_crossDomain() (gas: 10577)
OVM_ETH_Test:test_decreaseAllowance() (gas: 10731)
OVM_ETH_Test:test_increaseAllowance() (gas: 10741)
OVM_ETH_Test:test_metadata() (gas: 15586)
OVM_ETH_Test:test_mint() (gas: 10621)
OVM_ETH_Test:test_transfer() (gas: 10793)
OVM_ETH_Test:test_transferFrom() (gas: 13008)
LegacyERC20ETH_Test:test_approve() (gas: 10796)
LegacyERC20ETH_Test:test_burn() (gas: 10681)
LegacyERC20ETH_Test:test_crossDomain() (gas: 10577)
LegacyERC20ETH_Test:test_decreaseAllowance() (gas: 10731)
LegacyERC20ETH_Test:test_increaseAllowance() (gas: 10741)
LegacyERC20ETH_Test:test_metadata() (gas: 15586)
LegacyERC20ETH_Test:test_mint() (gas: 10627)
LegacyERC20ETH_Test:test_transfer() (gas: 10829)
LegacyERC20ETH_Test:test_transferFrom() (gas: 13008)
OptimismMintableERC20_Test:test_bridge() (gas: 9828)
OptimismMintableERC20_Test:test_burn() (gas: 52826)
OptimismMintableERC20_Test:test_burnRevertsFromNotBridge() (gas: 13219)
......@@ -227,6 +178,55 @@ ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10751)
ProxyAdmin_Test:test_owner() (gas: 9818)
ProxyAdmin_Test:test_proxyType() (gas: 20622)
ProxyAdmin_Test:test_setImplementationName() (gas: 39002)
RLPReader_Test:testReadBool() (gas: 1109)
RLPReader_Test:test_readAddress() (gas: 1347)
RLPReader_Test:test_readAddressSmall() (gas: 614)
RLPReader_Test:test_readAddressTooLarge() (gas: 3646)
RLPReader_Test:test_readAddressTooShort() (gas: 3603)
RLPReader_Test:test_readBoolInvalidValue() (gas: 3677)
RLPReader_Test:test_readBoolLargeInput() (gas: 3550)
RLPReader_Test:test_readBytes32_revertOnList() (gas: 3998)
RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3588)
RLPReader_Test:test_readBytes_bytestring00() (gas: 1823)
RLPReader_Test:test_readBytes_bytestring01() (gas: 1846)
RLPReader_Test:test_readBytes_bytestring7f() (gas: 1844)
RLPReader_Test:test_readBytes_invalidListLength() (gas: 3812)
RLPReader_Test:test_readBytes_invalidStringLength() (gas: 3768)
RLPReader_Test:test_readBytes_revertListItem() (gas: 3922)
RLPReader_Test:test_readList_dictTest1() (gas: 23791)
RLPReader_Test:test_readList_empty() (gas: 4472)
RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4213)
RLPReader_Test:test_readList_int32Overflow() (gas: 3958)
RLPReader_Test:test_readList_int32Overflow2() (gas: 4024)
RLPReader_Test:test_readList_invalidShortList() (gas: 3858)
RLPReader_Test:test_readList_invalidValue() (gas: 3790)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4196)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 4180)
RLPReader_Test:test_readList_leadingZerosInLongLengthList1() (gas: 38563)
RLPReader_Test:test_readList_listOfLists() (gas: 9619)
RLPReader_Test:test_readList_listOfLists2() (gas: 12479)
RLPReader_Test:test_readList_longList1() (gas: 29013)
RLPReader_Test:test_readList_longList2() (gas: 202895)
RLPReader_Test:test_readList_longStringLength() (gas: 3856)
RLPReader_Test:test_readList_multiList() (gas: 12025)
RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 4203)
RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4226)
RLPReader_Test:test_readList_notLongEnough() (gas: 3844)
RLPReader_Test:test_readList_shortListMax1() (gas: 40662)
RLPReader_Test:test_readList_stringList() (gas: 16796)
RLPReader_Test:test_readString_emptyString() (gas: 1719)
RLPReader_Test:test_readString_longString() (gas: 3076)
RLPReader_Test:test_readString_longString2() (gas: 18524)
RLPReader_Test:test_readString_shortString() (gas: 2280)
RLPReader_Test:test_readString_shortString2() (gas: 2775)
RLPReader_Test:test_readUint256_mediumInt1() (gas: 1235)
RLPReader_Test:test_readUint256_mediumInt2() (gas: 1237)
RLPReader_Test:test_readUint256_mediumInt3() (gas: 1238)
RLPReader_Test:test_readUint256_smallInt() (gas: 1084)
RLPReader_Test:test_readUint256_smallInt2() (gas: 1151)
RLPReader_Test:test_readUint256_smallInt3() (gas: 1127)
RLPReader_Test:test_readUint256_smallInt4() (gas: 1128)
RLPReader_Test:test_readUint256_zero() (gas: 1258)
ResourceMetering_Test:test_initialResourceParams() (gas: 8964)
ResourceMetering_Test:test_updateNoGasDelta() (gas: 2008269)
ResourceMetering_Test:test_updateOneEmptyBlock() (gas: 18123)
......
......@@ -230,26 +230,26 @@
+--------------+--------------------------+------+--------+-------+----------------------------------------------------------+
=======================
OVM_ETH
=======================
+--------------+-------------------------------------------------+------+--------+-------+----------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract |
+===========================================================================================================================+
| _balances | mapping(address => uint256) | 0 | 0 | 32 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| _allowances | mapping(address => mapping(address => uint256)) | 1 | 0 | 32 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| _totalSupply | uint256 | 2 | 0 | 32 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| _name | string | 3 | 0 | 32 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| _symbol | string | 4 | 0 | 32 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| remoteToken | address | 5 | 0 | 20 | contracts/L2/OVM_ETH.sol:OVM_ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------|
| bridge | address | 6 | 0 | 20 | contracts/L2/OVM_ETH.sol:OVM_ETH |
+--------------+-------------------------------------------------+------+--------+-------+----------------------------------+
LegacyERC20ETH
=======================
+--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract |
+=============================================================================================================================================+
| _balances | mapping(address => uint256) | 0 | 0 | 32 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _allowances | mapping(address => mapping(address => uint256)) | 1 | 0 | 32 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _totalSupply | uint256 | 2 | 0 | 32 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _name | string | 3 | 0 | 32 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _symbol | string | 4 | 0 | 32 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| remoteToken | address | 5 | 0 | 20 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
|--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| bridge | address | 6 | 0 | 20 | contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH |
+--------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
=======================
➡ SequencerFeeVault
......@@ -292,7 +292,7 @@
|--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------|
| implementationName | mapping(address => string) | 2 | 0 | 32 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
|--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------|
| addressManager | contract Lib_AddressManager | 3 | 0 | 20 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
| addressManager | contract AddressManager | 3 | 0 | 20 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
|--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------|
| upgrading | bool | 3 | 20 | 1 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
+--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------+
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { OptimismPortal } from "./OptimismPortal.sol";
import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol";
......@@ -40,7 +40,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger {
portal = _portal;
address[] memory blockedSystemAddresses = new address[](1);
blockedSystemAddresses[0] = address(this);
_initialize(Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, blockedSystemAddresses);
_initialize(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, blockedSystemAddresses);
}
/**
......
......@@ -2,7 +2,7 @@
pragma solidity ^0.8.9;
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
/**
......@@ -104,7 +104,7 @@ contract L1StandardBridge is StandardBridge, Initializable {
* @param _messenger Address of the L1CrossDomainMessenger.
*/
function initialize(address payable _messenger) public reinitializer(VERSION) {
_initialize(_messenger, payable(Lib_PredeployAddresses.L2_STANDARD_BRIDGE));
_initialize(_messenger, payable(PredeployAddresses.L2_STANDARD_BRIDGE));
}
/**
......
......@@ -4,7 +4,7 @@ pragma solidity 0.8.10;
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import { ExcessivelySafeCall } from "excessively-safe-call/src/ExcessivelySafeCall.sol";
import { L2OutputOracle } from "./L2OutputOracle.sol";
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { ResourceMetering } from "./ResourceMetering.sol";
......
......@@ -2,7 +2,7 @@
pragma solidity ^0.8.10;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { L1Block } from "../L2/L1Block.sol";
/**
......@@ -89,7 +89,7 @@ contract GasPriceOracle is Ownable {
* @return Latest known L1 base fee.
*/
function l1BaseFee() public view returns (uint256) {
return L1Block(Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES).basefee();
return L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES).basefee();
}
/**
......
......@@ -2,7 +2,7 @@
pragma solidity 0.8.10;
import { L1Block } from "./L1Block.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
/**
* @custom:legacy
......@@ -43,6 +43,6 @@ contract L1BlockNumber {
* @return Latest L1 block number.
*/
function getL1BlockNumber() public view returns (uint256) {
return L1Block(Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES).number();
return L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES).number();
}
}
......@@ -2,7 +2,7 @@
pragma solidity ^0.8.9;
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol";
import { L2ToL1MessagePasser } from "./L2ToL1MessagePasser.sol";
......@@ -23,7 +23,7 @@ contract L2CrossDomainMessenger is CrossDomainMessenger {
function initialize(address _l1CrossDomainMessenger) external initializer {
address[] memory blockedSystemAddresses = new address[](2);
blockedSystemAddresses[0] = address(this);
blockedSystemAddresses[1] = Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER;
blockedSystemAddresses[1] = PredeployAddresses.L2_TO_L1_MESSAGE_PASSER;
_initialize(_l1CrossDomainMessenger, blockedSystemAddresses);
}
......@@ -61,7 +61,8 @@ contract L2CrossDomainMessenger is CrossDomainMessenger {
uint256 _value,
bytes memory _data
) internal override {
L2ToL1MessagePasser(payable(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER))
.initiateWithdrawal{ value: _value }(_to, _gasLimit, _data);
L2ToL1MessagePasser(payable(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER)).initiateWithdrawal{
value: _value
}(_to, _gasLimit, _data);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
......@@ -84,7 +84,7 @@ contract L2StandardBridge is StandardBridge {
* @param _otherBridge Address of the L1StandardBridge.
*/
function initialize(address payable _otherBridge) public {
_initialize(payable(Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER), _otherBridge);
_initialize(payable(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER), _otherBridge);
}
/**
......@@ -148,7 +148,7 @@ contract L2StandardBridge is StandardBridge {
uint256 _amount,
bytes calldata _extraData
) external payable virtual {
if (_l1Token == address(0) && _l2Token == Lib_PredeployAddresses.OVM_ETH) {
if (_l1Token == address(0) && _l2Token == PredeployAddresses.LEGACY_ERC20_ETH) {
finalizeBridgeETH(_from, _to, _amount, _extraData);
} else {
finalizeBridgeERC20(_l2Token, _l1Token, _from, _to, _amount, _extraData);
......@@ -176,7 +176,7 @@ contract L2StandardBridge is StandardBridge {
bytes calldata _extraData
) internal {
address l1Token = OptimismMintableERC20(_l2Token).l1Token();
if (_l2Token == Lib_PredeployAddresses.OVM_ETH) {
if (_l2Token == PredeployAddresses.LEGACY_ERC20_ETH) {
require(msg.value == _amount, "ETH withdrawals must include sufficient ETH value.");
_initiateBridgeETH(_from, _to, _amount, _minGasLimit, _extraData);
} else {
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
import { Burn } from "../libraries/Burn.sol";
/**
......
......@@ -2,7 +2,7 @@
pragma solidity ^0.8.9;
/* Library Imports */
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
/* Contract Imports */
import { L2StandardBridge } from "./L2StandardBridge.sol";
......@@ -42,8 +42,8 @@ contract SequencerFeeVault {
uint256 balance = address(this).balance;
L2StandardBridge(payable(Lib_PredeployAddresses.L2_STANDARD_BRIDGE)).withdrawTo{
L2StandardBridge(payable(PredeployAddresses.L2_STANDARD_BRIDGE)).withdrawTo{
value: balance
}(Lib_PredeployAddresses.OVM_ETH, l1FeeWallet, balance, 0, bytes(""));
}(PredeployAddresses.LEGACY_ERC20_ETH, l1FeeWallet, balance, 0, bytes(""));
}
}
......@@ -5,9 +5,9 @@ pragma solidity ^0.8.9;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Lib_AddressManager
* @title AddressManager
*/
contract Lib_AddressManager is Ownable {
contract AddressManager is Ownable {
/**********
* Events *
**********/
......
......@@ -2,27 +2,27 @@
pragma solidity ^0.8.9;
/* Library Imports */
import { Lib_AddressManager } from "./Lib_AddressManager.sol";
import { AddressManager } from "./AddressManager.sol";
/**
* @title Lib_AddressResolver
* @title AddressResolver
*/
abstract contract Lib_AddressResolver {
abstract contract AddressResolver {
/*************
* Variables *
*************/
Lib_AddressManager public libAddressManager;
AddressManager public libAddressManager;
/***************
* Constructor *
***************/
/**
* @param _libAddressManager Address of the Lib_AddressManager.
* @param _libAddressManager Address of the AddressManager.
*/
constructor(address _libAddressManager) {
libAddressManager = Lib_AddressManager(_libAddressManager);
libAddressManager = AddressManager(_libAddressManager);
}
/********************
......
......@@ -2,7 +2,7 @@
pragma solidity ^0.8.9;
/* Library Imports */
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
/* Contract Imports */
import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
......@@ -11,18 +11,18 @@ import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
* @custom:legacy
* @custom:proxied
* @custom:predeploy 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000
* @title OVM_ETH
* @notice OVM_ETH is a legacy contract that held ETH balances before the Bedrock upgrade. All
* ETH balances held within this contract were migrated to the state trie as part of the
* Bedrock upgrade. Functions within this contract that mutate state were already disabled
* as part of the EVM equivalence upgrade.
* @title LegacyERC20ETH
* @notice LegacyERC20ETH is a legacy contract that held ETH balances before the Bedrock upgrade.
* All ETH balances held within this contract were migrated to the state trie as part of
* the Bedrock upgrade. Functions within this contract that mutate state were already
* disabled as part of the EVM equivalence upgrade.
*/
contract OVM_ETH is OptimismMintableERC20 {
contract LegacyERC20ETH is OptimismMintableERC20 {
/**
* @notice Initializes the contract as an Optimism Mintable ERC20.
*/
constructor()
OptimismMintableERC20(Lib_PredeployAddresses.L2_STANDARD_BRIDGE, address(0), "Ether", "ETH")
OptimismMintableERC20(PredeployAddresses.L2_STANDARD_BRIDGE, address(0), "Ether", "ETH")
{}
/**
......@@ -32,7 +32,7 @@ contract OVM_ETH is OptimismMintableERC20 {
* @param _amount Amount of ETH to mint.
*/
function mint(address _to, uint256 _amount) public virtual override {
revert("OVM_ETH: mint is disabled");
revert("LegacyERC20ETH: mint is disabled");
}
/**
......@@ -42,7 +42,7 @@ contract OVM_ETH is OptimismMintableERC20 {
* @param _amount Amount of ETH to burn.
*/
function burn(address _from, uint256 _amount) public virtual override {
revert("OVM_ETH: burn is disabled");
revert("LegacyERC20ETH: burn is disabled");
}
/**
......@@ -52,7 +52,7 @@ contract OVM_ETH is OptimismMintableERC20 {
* @param _amount Amount of ETH to send.
*/
function transfer(address _recipient, uint256 _amount) public virtual override returns (bool) {
revert("OVM_ETH: transfer is disabled");
revert("LegacyERC20ETH: transfer is disabled");
}
/**
......@@ -62,7 +62,7 @@ contract OVM_ETH is OptimismMintableERC20 {
* @param _amount Amount of ETH to approve.
*/
function approve(address _spender, uint256 _amount) public virtual override returns (bool) {
revert("OVM_ETH: approve is disabled");
revert("LegacyERC20ETH: approve is disabled");
}
/**
......@@ -77,7 +77,7 @@ contract OVM_ETH is OptimismMintableERC20 {
address _recipient,
uint256 _amount
) public virtual override returns (bool) {
revert("OVM_ETH: transferFrom is disabled");
revert("LegacyERC20ETH: transferFrom is disabled");
}
/**
......@@ -92,7 +92,7 @@ contract OVM_ETH is OptimismMintableERC20 {
override
returns (bool)
{
revert("OVM_ETH: increaseAllowance is disabled");
revert("LegacyERC20ETH: increaseAllowance is disabled");
}
/**
......@@ -107,6 +107,6 @@ contract OVM_ETH is OptimismMintableERC20 {
override
returns (bool)
{
revert("OVM_ETH: decreaseAllowance is disabled");
revert("LegacyERC20ETH: decreaseAllowance is disabled");
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { Lib_AddressManager } from "./Lib_AddressManager.sol";
import { AddressManager } from "./AddressManager.sol";
/**
* @title Lib_ResolvedDelegateProxy
* @title ResolvedDelegateProxy
*/
contract Lib_ResolvedDelegateProxy {
contract ResolvedDelegateProxy {
/*************
* Variables *
*************/
......@@ -20,18 +20,18 @@ contract Lib_ResolvedDelegateProxy {
// in the near future. Due to the very limited way that we are using it, this flaw is
// not an issue in our system.
mapping(address => string) private implementationName;
mapping(address => Lib_AddressManager) private addressManager;
mapping(address => AddressManager) private addressManager;
/***************
* Constructor *
***************/
/**
* @param _libAddressManager Address of the Lib_AddressManager.
* @param _libAddressManager Address of the AddressManager.
* @param _implementationName implementationName of the contract to proxy to.
*/
constructor(address _libAddressManager, string memory _implementationName) {
addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
addressManager[address(this)] = AddressManager(_libAddressManager);
implementationName[address(this)] = _implementationName;
}
......
......@@ -2,9 +2,9 @@
pragma solidity ^0.8.9;
/**
* @title Lib_BytesUtils
* @title BytesUtils
*/
library Lib_BytesUtils {
library BytesUtils {
/**********************
* Internal Functions *
**********************/
......
//SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import { Lib_CrossDomainUtils } from "./Lib_CrossDomainUtils.sol";
import { Lib_RLPWriter } from "./rlp/Lib_RLPWriter.sol";
import { CrossDomainUtils } from "./CrossDomainUtils.sol";
import { RLPWriter } from "./rlp/RLPWriter.sol";
/**
* @title CrossDomainHashing
* This library is responsible for holding cross domain utility
* functions.
* TODO(tynes): merge with Lib_CrossDomainUtils
* TODO(tynes): merge with CrossDomainUtils
* TODO(tynes): fill out more devdocs
*/
library CrossDomainHashing {
......@@ -89,22 +89,22 @@ library CrossDomainHashing {
bytes[] memory raw = new bytes[](7);
raw[0] = Lib_RLPWriter.writeBytes(bytes32ToBytes(source));
raw[1] = Lib_RLPWriter.writeAddress(_from);
raw[0] = RLPWriter.writeBytes(bytes32ToBytes(source));
raw[1] = RLPWriter.writeAddress(_from);
if (_isCreate == true) {
require(_to == address(0));
raw[2] = Lib_RLPWriter.writeBytes("");
raw[2] = RLPWriter.writeBytes("");
} else {
raw[2] = Lib_RLPWriter.writeAddress(_to);
raw[2] = RLPWriter.writeAddress(_to);
}
raw[3] = Lib_RLPWriter.writeUint(_mint);
raw[4] = Lib_RLPWriter.writeUint(_value);
raw[5] = Lib_RLPWriter.writeUint(_gas);
raw[6] = Lib_RLPWriter.writeBytes(_data);
raw[3] = RLPWriter.writeUint(_mint);
raw[4] = RLPWriter.writeUint(_value);
raw[5] = RLPWriter.writeUint(_gas);
raw[6] = RLPWriter.writeBytes(_data);
bytes memory encoded = Lib_RLPWriter.writeList(raw);
bytes memory encoded = RLPWriter.writeList(raw);
return abi.encodePacked(uint8(0x7e), uint8(0x0), encoded);
}
......@@ -193,7 +193,7 @@ library CrossDomainHashing {
bytes memory _data,
uint256 _nonce
) internal pure returns (bytes memory) {
return Lib_CrossDomainUtils.encodeXDomainCalldata(_target, _sender, _data, _nonce);
return CrossDomainUtils.encodeXDomainCalldata(_target, _sender, _data, _nonce);
}
/**
......
......@@ -2,9 +2,9 @@
pragma solidity ^0.8.9;
/**
* @title Lib_CrossDomainUtils
* @title CrossDomainUtils
*/
library Lib_CrossDomainUtils {
library CrossDomainUtils {
/**
* Generates the correct cross domain calldata for a message.
* @param _target Target contract address.
......
......@@ -2,9 +2,9 @@
pragma solidity ^0.8.9;
/**
* @title Lib_DefaultValues
* @title DefaultValues
*/
library Lib_DefaultValues {
library DefaultValues {
// The default x-domain message sender being set to a non-zero value makes
// deployment a bit more expensive, but in exchange the refund on every call to
// `relayMessage` by the L1 and L2 messengers will be higher.
......
......@@ -2,16 +2,16 @@
pragma solidity ^0.8.9;
/**
* @title Lib_PredeployAddresses
* @title PredeployAddresses
*/
library Lib_PredeployAddresses {
library PredeployAddresses {
address internal constant L2_TO_L1_MESSAGE_PASSER = 0x4200000000000000000000000000000000000000;
address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001;
address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;
address payable internal constant OVM_ETH = payable(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000);
address internal constant LEGACY_ERC20_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000;
address internal constant L2_CROSS_DOMAIN_MESSENGER =
0x4200000000000000000000000000000000000007;
address internal constant LIB_ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008;
address internal constant ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008;
address internal constant PROXY_EOA = 0x4200000000000000000000000000000000000009;
address internal constant L2_STANDARD_BRIDGE = 0x4200000000000000000000000000000000000010;
address internal constant SEQUENCER_FEE_WALLET = 0x4200000000000000000000000000000000000011;
......
......@@ -2,8 +2,8 @@
pragma solidity 0.8.10;
/* Library Imports */
import { Lib_SecureMerkleTrie } from "./trie/Lib_SecureMerkleTrie.sol";
import { Lib_CrossDomainUtils } from "./Lib_CrossDomainUtils.sol";
import { SecureMerkleTrie } from "./trie/SecureMerkleTrie.sol";
import { CrossDomainUtils } from "./CrossDomainUtils.sol";
/**
* @title WithdrawalVerifier
......@@ -80,7 +80,7 @@ library WithdrawalVerifier {
);
return
Lib_SecureMerkleTrie.verifyInclusionProof(
SecureMerkleTrie.verifyInclusionProof(
abi.encode(storageKey),
hex"01",
_withdrawalProof,
......
......@@ -2,10 +2,10 @@
pragma solidity ^0.8.9;
/**
* @title Lib_RLPReader
* @title RLPReader
* @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
*/
library Lib_RLPReader {
library RLPReader {
/*************
* Constants *
*************/
......@@ -203,7 +203,7 @@ library Lib_RLPReader {
out := byte(0, mload(ptr))
}
require(out == 0 || out == 1, "Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1");
require(out == 0 || out == 1, "RLPReader: Invalid RLP boolean value, must be 0 or 1");
return out != 0;
}
......
......@@ -2,10 +2,10 @@
pragma solidity ^0.8.9;
/**
* @title Lib_RLPWriter
* @title RLPWriter
* @author Bakaoh (with modifications)
*/
library Lib_RLPWriter {
library RLPWriter {
/**********************
* Internal Functions *
**********************/
......
......@@ -2,14 +2,14 @@
pragma solidity ^0.8.9;
/* Library Imports */
import { Lib_BytesUtils } from "../Lib_BytesUtils.sol";
import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
import { BytesUtils } from "../BytesUtils.sol";
import { RLPReader } from "../rlp/RLPReader.sol";
import { RLPWriter } from "../rlp/RLPWriter.sol";
/**
* @title Lib_MerkleTrie
* @title MerkleTrie
*/
library Lib_MerkleTrie {
library MerkleTrie {
/*******************
* Data Structures *
*******************/
......@@ -22,7 +22,7 @@ library Lib_MerkleTrie {
struct TrieNode {
bytes encoded;
Lib_RLPReader.RLPItem[] decoded;
RLPReader.RLPItem[] decoded;
}
/**********************
......@@ -73,7 +73,7 @@ library Lib_MerkleTrie {
) internal pure returns (bool _verified) {
(bool exists, bytes memory value) = get(_key, _proof, _root);
return (exists && Lib_BytesUtils.equal(_value, value));
return (exists && BytesUtils.equal(_value, value));
}
/**
......@@ -132,7 +132,7 @@ library Lib_MerkleTrie {
)
{
uint256 pathLength = 0;
bytes memory key = Lib_BytesUtils.toNibbles(_key);
bytes memory key = BytesUtils.toNibbles(_key);
bytes32 currentNodeID = _root;
uint256 currentKeyIndex = 0;
......@@ -160,7 +160,7 @@ library Lib_MerkleTrie {
} else {
// Nodes smaller than 31 bytes aren't hashed.
require(
Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
"Invalid internal node hash"
);
}
......@@ -174,7 +174,7 @@ library Lib_MerkleTrie {
// We're not at the end of the key yet.
// Figure out what the next node ID should be and continue.
uint8 branchKey = uint8(key[currentKeyIndex]);
Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
currentNodeID = _getNodeID(nextNode);
currentKeyIncrement = 1;
continue;
......@@ -183,8 +183,8 @@ library Lib_MerkleTrie {
bytes memory path = _getNodePath(currentNode);
uint8 prefix = uint8(path[0]);
uint8 offset = 2 - (prefix % 2);
bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
bytes memory pathRemainder = BytesUtils.slice(path, offset);
bytes memory keyRemainder = BytesUtils.slice(key, currentKeyIndex);
uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
......@@ -224,7 +224,7 @@ library Lib_MerkleTrie {
// If our node ID is NULL, then we're at a dead end.
bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
return (pathLength, BytesUtils.slice(key, currentKeyIndex), isFinalNode);
}
/**
......@@ -233,12 +233,12 @@ library Lib_MerkleTrie {
* @return _parsed Proof parsed into easily accessible structs.
*/
function _parseProof(bytes memory _proof) private pure returns (TrieNode[] memory _parsed) {
Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
RLPReader.RLPItem[] memory nodes = RLPReader.readList(_proof);
TrieNode[] memory proof = new TrieNode[](nodes.length);
for (uint256 i = 0; i < nodes.length; i++) {
bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
proof[i] = TrieNode({ encoded: encoded, decoded: Lib_RLPReader.readList(encoded) });
bytes memory encoded = RLPReader.readBytes(nodes[i]);
proof[i] = TrieNode({ encoded: encoded, decoded: RLPReader.readList(encoded) });
}
return proof;
......@@ -251,18 +251,18 @@ library Lib_MerkleTrie {
* @param _node Node to pull an ID for.
* @return _nodeID ID for the node, depending on the size of its contents.
*/
function _getNodeID(Lib_RLPReader.RLPItem memory _node) private pure returns (bytes32 _nodeID) {
function _getNodeID(RLPReader.RLPItem memory _node) private pure returns (bytes32 _nodeID) {
bytes memory nodeID;
if (_node.length < 32) {
// Nodes smaller than 32 bytes are RLP encoded.
nodeID = Lib_RLPReader.readRawBytes(_node);
nodeID = RLPReader.readRawBytes(_node);
} else {
// Nodes 32 bytes or larger are hashed.
nodeID = Lib_RLPReader.readBytes(_node);
nodeID = RLPReader.readBytes(_node);
}
return Lib_BytesUtils.toBytes32(nodeID);
return BytesUtils.toBytes32(nodeID);
}
/**
......@@ -271,7 +271,7 @@ library Lib_MerkleTrie {
* @return _path Node path, converted to an array of nibbles.
*/
function _getNodePath(TrieNode memory _node) private pure returns (bytes memory _path) {
return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
return BytesUtils.toNibbles(RLPReader.readBytes(_node.decoded[0]));
}
/**
......@@ -280,7 +280,7 @@ library Lib_MerkleTrie {
* @return _value Node value, as hex bytes.
*/
function _getNodeValue(TrieNode memory _node) private pure returns (bytes memory _value) {
return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
return RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
}
/**
......
......@@ -2,12 +2,12 @@
pragma solidity ^0.8.9;
/* Library Imports */
import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
import { MerkleTrie } from "./MerkleTrie.sol";
/**
* @title Lib_SecureMerkleTrie
* @title SecureMerkleTrie
*/
library Lib_SecureMerkleTrie {
library SecureMerkleTrie {
/**********************
* Internal Functions *
**********************/
......@@ -31,7 +31,7 @@ library Lib_SecureMerkleTrie {
bytes32 _root
) internal pure returns (bool _verified) {
bytes memory key = _getSecureKey(_key);
return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
return MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
}
/**
......@@ -48,7 +48,7 @@ library Lib_SecureMerkleTrie {
bytes32 _root
) internal pure returns (bool _exists, bytes memory _value) {
bytes memory key = _getSecureKey(_key);
return Lib_MerkleTrie.get(key, _proof, _root);
return MerkleTrie.get(key, _proof, _root);
}
/*********************
......
......@@ -14,13 +14,13 @@ import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { OVM_ETH } from "../L2/OVM_ETH.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { Proxy } from "../universal/Proxy.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import { Lib_ResolvedDelegateProxy } from "../legacy/Lib_ResolvedDelegateProxy.sol";
import { Lib_AddressManager } from "../legacy/Lib_AddressManager.sol";
import { ResolvedDelegateProxy } from "../legacy/ResolvedDelegateProxy.sol";
import { AddressManager } from "../legacy/AddressManager.sol";
import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol";
import { iL1ChugSplashDeployer } from "../legacy/L1ChugSplashProxy.sol";
......@@ -130,12 +130,12 @@ contract Portal_Initializer is L2OutputOracle_Initializer {
contract Messenger_Initializer is L2OutputOracle_Initializer {
OptimismPortal op;
Lib_AddressManager addressManager;
AddressManager addressManager;
L1CrossDomainMessenger L1Messenger;
L2CrossDomainMessenger L2Messenger =
L2CrossDomainMessenger(Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER);
L2CrossDomainMessenger(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER);
L2ToL1MessagePasser messagePasser =
L2ToL1MessagePasser(payable(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER));
L2ToL1MessagePasser(payable(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER));
event SentMessage(
address indexed target,
......@@ -177,7 +177,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
// Deploy the address manager
vm.prank(multisig);
addressManager = new Lib_AddressManager();
addressManager = new AddressManager();
// Setup implementation
L1CrossDomainMessenger L1MessengerImpl = new L1CrossDomainMessenger(op);
......@@ -185,7 +185,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
// Setup the address manager and proxy
vm.prank(multisig);
addressManager.setAddress("OVM_L1CrossDomainMessenger", address(L1MessengerImpl));
Lib_ResolvedDelegateProxy proxy = new Lib_ResolvedDelegateProxy(
ResolvedDelegateProxy proxy = new ResolvedDelegateProxy(
address(addressManager),
"OVM_L1CrossDomainMessenger"
);
......@@ -193,7 +193,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
L1Messenger.initialize(op);
vm.etch(
Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
address(new L2CrossDomainMessenger()).code
);
......@@ -201,16 +201,18 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
// Set the L2ToL1MessagePasser at the correct address
vm.etch(
Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER,
PredeployAddresses.L2_TO_L1_MESSAGE_PASSER,
address(new L2ToL1MessagePasser()).code
);
// Label addresses
vm.label(address(addressManager), "AddressManager");
vm.label(address(L1MessengerImpl), "L1CrossDomainMessenger_Impl");
vm.label(address(L1Messenger), "L1CrossDomainMessenger_Proxy");
vm.label(Lib_PredeployAddresses.OVM_ETH, "OVM_ETH");
vm.label(Lib_PredeployAddresses.OVM_ETH, "OVM_ETH");
vm.label(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER, "L2ToL1MessagePasser");
vm.label(Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, "L2CrossDomainMessenger");
vm.label(PredeployAddresses.LEGACY_ERC20_ETH, "LegacyERC20ETH");
vm.label(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER, "L2ToL1MessagePasser");
vm.label(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, "L2CrossDomainMessenger");
vm.label(
AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)),
"L1CrossDomainMessenger_aliased"
......@@ -331,8 +333,8 @@ contract Bridge_Initializer is Messenger_Initializer {
function setUp() public virtual override {
super.setUp();
vm.label(Lib_PredeployAddresses.L2_STANDARD_BRIDGE, "L2StandardBridge");
vm.label(Lib_PredeployAddresses.L2_STANDARD_TOKEN_FACTORY, "L2StandardTokenFactory");
vm.label(PredeployAddresses.L2_STANDARD_BRIDGE, "L2StandardBridge");
vm.label(PredeployAddresses.L2_STANDARD_TOKEN_FACTORY, "L2StandardTokenFactory");
// Deploy the L1 bridge and initialize it with the address of the
// L1CrossDomainMessenger
......@@ -357,19 +359,19 @@ contract Bridge_Initializer is Messenger_Initializer {
// Deploy the L2StandardBridge, move it to the correct predeploy
// address and then initialize it
L2StandardBridge l2B = new L2StandardBridge();
vm.etch(Lib_PredeployAddresses.L2_STANDARD_BRIDGE, address(l2B).code);
L2Bridge = L2StandardBridge(payable(Lib_PredeployAddresses.L2_STANDARD_BRIDGE));
vm.etch(PredeployAddresses.L2_STANDARD_BRIDGE, address(l2B).code);
L2Bridge = L2StandardBridge(payable(PredeployAddresses.L2_STANDARD_BRIDGE));
L2Bridge.initialize(payable(address(L1Bridge)));
// Set up the L2 mintable token factory
OptimismMintableTokenFactory factory = new OptimismMintableTokenFactory();
vm.etch(Lib_PredeployAddresses.L2_STANDARD_TOKEN_FACTORY, address(factory).code);
vm.etch(PredeployAddresses.L2_STANDARD_TOKEN_FACTORY, address(factory).code);
L2TokenFactory = OptimismMintableTokenFactory(
Lib_PredeployAddresses.L2_STANDARD_TOKEN_FACTORY
PredeployAddresses.L2_STANDARD_TOKEN_FACTORY
);
L2TokenFactory.initialize(Lib_PredeployAddresses.L2_STANDARD_BRIDGE);
L2TokenFactory.initialize(PredeployAddresses.L2_STANDARD_BRIDGE);
vm.etch(Lib_PredeployAddresses.OVM_ETH, address(new OVM_ETH()).code);
vm.etch(PredeployAddresses.LEGACY_ERC20_ETH, address(new LegacyERC20ETH()).code);
L1Token = new ERC20("Native L1 Token", "L1T");
......
......@@ -2,7 +2,7 @@
pragma solidity 0.8.10;
import { CommonTest } from "./CommonTest.t.sol";
import { CrossDomainHashing } from "../libraries/Lib_CrossDomainHashing.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";
contract CrossDomainHashing_Test is CommonTest {
function test_nonceVersioning(uint240 _nonce, uint16 _version) external {
......
......@@ -4,7 +4,7 @@ pragma solidity 0.8.10;
import { CommonTest } from "./CommonTest.t.sol";
import { GasPriceOracle } from "../L2/GasPriceOracle.sol";
import { L1Block } from "../L2/L1Block.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
contract GasPriceOracle_Test is CommonTest {
......@@ -19,11 +19,11 @@ contract GasPriceOracle_Test is CommonTest {
function setUp() external {
// place the L1Block contract at the predeploy address
vm.etch(
Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES,
PredeployAddresses.L1_BLOCK_ATTRIBUTES,
address(new L1Block()).code
);
l1Block = L1Block(Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES);
l1Block = L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES);
depositor = l1Block.DEPOSITOR_ACCOUNT();
// We are not setting the gas oracle at its predeploy
......
......@@ -4,15 +4,15 @@ pragma solidity 0.8.10;
import { Test } from "forge-std/Test.sol";
import { L1Block } from "../L2/L1Block.sol";
import { L1BlockNumber } from "../L2/L1BlockNumber.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
contract L1BlockNumberTest is Test {
L1Block lb;
L1BlockNumber bn;
function setUp() external {
vm.etch(Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES, address(new L1Block()).code);
lb = L1Block(Lib_PredeployAddresses.L1_BLOCK_ATTRIBUTES);
vm.etch(PredeployAddresses.L1_BLOCK_ATTRIBUTES, address(new L1Block()).code);
lb = L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES);
bn = new L1BlockNumber();
vm.prank(lb.DEPOSITOR_ACCOUNT());
lb.setL1BlockValues(uint64(999), uint64(2), 3, keccak256(abi.encode(1)), uint64(4));
......
......@@ -7,16 +7,16 @@ import { L2OutputOracle_Initializer } from "./L2OutputOracle.t.sol";
/* Libraries */
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { Lib_DefaultValues } from "../libraries/Lib_DefaultValues.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { Lib_CrossDomainUtils } from "../libraries/Lib_CrossDomainUtils.sol";
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { CrossDomainUtils } from "../libraries/CrossDomainUtils.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
/* Target contract dependencies */
import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { CrossDomainHashing } from "../libraries/Lib_CrossDomainHashing.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";
/* Target contract */
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
......@@ -74,7 +74,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
address(op),
abi.encodeWithSelector(
OptimismPortal.depositTransaction.selector,
Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
0,
100 + L1Messenger.baseGas(hex"ff"),
false,
......@@ -93,7 +93,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
vm.expectEmit(true, true, true, true);
emit TransactionDeposited(
AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)),
Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,
0,
0,
100 + L1Messenger.baseGas(hex"ff"),
......@@ -137,7 +137,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
// relayMessage: should send a successful call to the target contract
function test_L1MessengerRelayMessageSucceeds() external {
address target = address(0xabcd);
address sender = Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
vm.expectCall(target, hex"1111");
......@@ -171,7 +171,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
function test_L1MessengerRelayMessageToSystemContract() external {
// set the target to be the OptimismPortal
address target = address(op);
address sender = Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
bytes memory message = hex"1111";
// set the value of op.l2Sender() to be the L2 Cross Domain Messenger.
......@@ -189,7 +189,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
vm.expectRevert("xDomainMessageSender is not set");
L1Messenger.xDomainMessageSender();
address sender = Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
uint256 senderSlotIndex = 51;
bytes32 slotValue = vm.load(address(op), bytes32(senderSlotIndex));
......
......@@ -5,7 +5,7 @@ import { Bridge_Initializer } from "./CommonTest.t.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
import { L2StandardBridge } from "../L2/L2StandardBridge.sol";
import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { stdStorage, StdStorage } from "forge-std/Test.sol";
......@@ -25,12 +25,12 @@ contract L1StandardBridge_Test is Bridge_Initializer {
assertEq(
address(L1Bridge.otherBridge()),
Lib_PredeployAddresses.L2_STANDARD_BRIDGE
PredeployAddresses.L2_STANDARD_BRIDGE
);
assertEq(
address(L2Bridge),
Lib_PredeployAddresses.L2_STANDARD_BRIDGE
PredeployAddresses.L2_STANDARD_BRIDGE
);
}
......
......@@ -3,14 +3,14 @@ pragma solidity 0.8.10;
import { Messenger_Initializer } from "./CommonTest.t.sol";
import { Lib_CrossDomainUtils } from "../libraries/Lib_CrossDomainUtils.sol";
import { CrossDomainUtils } from "../libraries/CrossDomainUtils.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { CrossDomainHashing } from "../libraries/Lib_CrossDomainHashing.sol";
import { Lib_DefaultValues } from "../libraries/Lib_DefaultValues.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";
contract L2CrossDomainMessenger_Test is Messenger_Initializer {
// Receiver address for testing
......
......@@ -4,7 +4,7 @@ pragma solidity 0.8.10;
import { Bridge_Initializer } from "./CommonTest.t.sol";
import { stdStorage, StdStorage } from "forge-std/Test.sol";
import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { console } from "forge-std/console.sol";
contract L2StandardBridge_Test is Bridge_Initializer {
......@@ -52,7 +52,7 @@ contract L2StandardBridge_Test is Bridge_Initializer {
vm.expectRevert("ETH withdrawals must include sufficient ETH value.");
vm.prank(alice, alice);
L2Bridge.withdraw(
address(Lib_PredeployAddresses.OVM_ETH),
address(PredeployAddresses.LEGACY_ERC20_ETH),
100,
1000,
hex""
......
......@@ -3,7 +3,7 @@ pragma solidity 0.8.10;
import { CommonTest } from "./CommonTest.t.sol";
import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol";
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
contract L2ToL1MessagePasserTest is CommonTest {
L2ToL1MessagePasser messagePasser;
......
......@@ -2,14 +2,14 @@
pragma solidity ^0.8.9;
import { CommonTest } from "./CommonTest.t.sol";
import { OVM_ETH } from "../L2/OVM_ETH.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
contract OVM_ETH_Test is CommonTest {
OVM_ETH eth;
contract LegacyERC20ETH_Test is CommonTest {
LegacyERC20ETH eth;
function setUp() external {
eth = new OVM_ETH();
eth = new LegacyERC20ETH();
}
function test_metadata() external {
......@@ -19,42 +19,42 @@ contract OVM_ETH_Test is CommonTest {
}
function test_crossDomain() external {
assertEq(eth.l2Bridge(), Lib_PredeployAddresses.L2_STANDARD_BRIDGE);
assertEq(eth.l2Bridge(), PredeployAddresses.L2_STANDARD_BRIDGE);
assertEq(eth.l1Token(), address(0));
}
function test_transfer() external {
vm.expectRevert("OVM_ETH: transfer is disabled");
vm.expectRevert("LegacyERC20ETH: transfer is disabled");
eth.transfer(alice, 100);
}
function test_approve() external {
vm.expectRevert("OVM_ETH: approve is disabled");
vm.expectRevert("LegacyERC20ETH: approve is disabled");
eth.approve(alice, 100);
}
function test_transferFrom() external {
vm.expectRevert("OVM_ETH: transferFrom is disabled");
vm.expectRevert("LegacyERC20ETH: transferFrom is disabled");
eth.transferFrom(bob, alice, 100);
}
function test_increaseAllowance() external {
vm.expectRevert("OVM_ETH: increaseAllowance is disabled");
vm.expectRevert("LegacyERC20ETH: increaseAllowance is disabled");
eth.increaseAllowance(alice, 100);
}
function test_decreaseAllowance() external {
vm.expectRevert("OVM_ETH: decreaseAllowance is disabled");
vm.expectRevert("LegacyERC20ETH: decreaseAllowance is disabled");
eth.decreaseAllowance(alice, 100);
}
function test_mint() external {
vm.expectRevert("OVM_ETH: mint is disabled");
vm.expectRevert("LegacyERC20ETH: mint is disabled");
eth.mint(alice, 100);
}
function test_burn() external {
vm.expectRevert("OVM_ETH: burn is disabled");
vm.expectRevert("LegacyERC20ETH: burn is disabled");
eth.burn(alice, 100);
}
}
......@@ -2,7 +2,7 @@
pragma solidity 0.8.10;
import { Bridge_Initializer } from "./CommonTest.t.sol";
import { LibRLP } from "./Lib_RLP.t.sol";
import { LibRLP } from "./RLP.t.sol";
contract OptimismMintableTokenFactory_Test is Bridge_Initializer {
event StandardL2TokenCreated(address indexed _remoteToken, address indexed _localToken);
......
......@@ -6,7 +6,7 @@ import { Portal_Initializer, CommonTest, NextImpl } from "./CommonTest.t.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
import { Proxy } from "../universal/Proxy.sol";
contract OptimismPortal_Test is Portal_Initializer {
......
......@@ -6,17 +6,17 @@ import { Proxy } from "../universal/Proxy.sol";
import { ProxyAdmin } from "../universal/ProxyAdmin.sol";
import { SimpleStorage } from "./Proxy.t.sol";
import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol";
import { Lib_ResolvedDelegateProxy } from "../legacy/Lib_ResolvedDelegateProxy.sol";
import { Lib_AddressManager } from "../legacy/Lib_AddressManager.sol";
import { ResolvedDelegateProxy } from "../legacy/ResolvedDelegateProxy.sol";
import { AddressManager } from "../legacy/AddressManager.sol";
contract ProxyAdmin_Test is Test {
address alice = address(64);
Proxy proxy;
L1ChugSplashProxy chugsplash;
Lib_ResolvedDelegateProxy resolved;
ResolvedDelegateProxy resolved;
Lib_AddressManager addressManager;
AddressManager addressManager;
ProxyAdmin admin;
......@@ -31,22 +31,22 @@ contract ProxyAdmin_Test is Test {
// Deploy the legacy L1ChugSplashProxy with the admin as the owner
chugsplash = new L1ChugSplashProxy(address(admin));
// Deploy the legacy Lib_AddressManager
addressManager = new Lib_AddressManager();
// Deploy the legacy AddressManager
addressManager = new AddressManager();
// The proxy admin must be the new owner of the address manager
addressManager.transferOwnership(address(admin));
// Deploy a legacy Lib_ResolvedDelegateProxy with the name `a`.
// Whatever `a` is set to in Lib_AddressManager will be the address
// Deploy a legacy ResolvedDelegateProxy with the name `a`.
// Whatever `a` is set to in AddressManager will be the address
// that is used for the implementation.
resolved = new Lib_ResolvedDelegateProxy(address(addressManager), "a");
resolved = new ResolvedDelegateProxy(address(addressManager), "a");
// Impersonate alice for setting up the admin.
vm.startPrank(alice);
// Set the address of the address manager in the admin so that it
// can resolve the implementation address of legacy
// Lib_ResolvedDelegateProxy based proxies.
// ResolvedDelegateProxy based proxies.
admin.setAddressManager(addressManager);
// Set the reverse lookup of the Lib_ResolvedDelegateProxy
// Set the reverse lookup of the ResolvedDelegateProxy
// proxy
admin.setImplementationName(address(resolved), "a");
......@@ -70,7 +70,7 @@ contract ProxyAdmin_Test is Test {
function test_onlyOwnerSetAddressManager() external {
vm.expectRevert("UNAUTHORIZED");
admin.setAddressManager(Lib_AddressManager((address(0))));
admin.setAddressManager(AddressManager((address(0))));
}
function test_onlyOwnerSetImplementationName() external {
......
......@@ -5,23 +5,23 @@ import { Bridge_Initializer } from "./CommonTest.t.sol";
import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol";
import { L2StandardBridge } from "../L2/L2StandardBridge.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
contract SequencerFeeVault_Test is Bridge_Initializer {
SequencerFeeVault vault =
SequencerFeeVault(payable(Lib_PredeployAddresses.SEQUENCER_FEE_WALLET));
SequencerFeeVault(payable(PredeployAddresses.SEQUENCER_FEE_WALLET));
address constant recipient = address(256);
function setUp() public override {
super.setUp();
vm.etch(
Lib_PredeployAddresses.SEQUENCER_FEE_WALLET,
PredeployAddresses.SEQUENCER_FEE_WALLET,
address(new SequencerFeeVault()).code
);
vm.store(
Lib_PredeployAddresses.SEQUENCER_FEE_WALLET,
PredeployAddresses.SEQUENCER_FEE_WALLET,
bytes32(uint256(0)),
bytes32(uint256(uint160(recipient)))
);
......@@ -69,10 +69,10 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
vm.deal(address(vault), vault.MIN_WITHDRAWAL_AMOUNT() + 1);
vm.expectCall(
Lib_PredeployAddresses.L2_STANDARD_BRIDGE,
PredeployAddresses.L2_STANDARD_BRIDGE,
abi.encodeWithSelector(
L2StandardBridge.withdrawTo.selector,
Lib_PredeployAddresses.OVM_ETH,
PredeployAddresses.LEGACY_ERC20_ETH,
vault.l1FeeWallet(),
address(vault).balance,
0,
......
......@@ -11,8 +11,8 @@ import {
ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { ExcessivelySafeCall } from "excessively-safe-call/src/ExcessivelySafeCall.sol";
import { Lib_DefaultValues } from "../libraries/Lib_DefaultValues.sol";
import { CrossDomainHashing } from "../libraries/Lib_CrossDomainHashing.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";
/**
* @title CrossDomainMessenger
......@@ -153,7 +153,7 @@ abstract contract CrossDomainMessenger is
*/
function xDomainMessageSender() external view returns (address) {
require(
xDomainMsgSender != Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER,
xDomainMsgSender != DefaultValues.DEFAULT_XDOMAIN_SENDER,
"xDomainMessageSender is not set"
);
......@@ -287,7 +287,7 @@ abstract contract CrossDomainMessenger is
0,
_message
);
xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;
xDomainMsgSender = DefaultValues.DEFAULT_XDOMAIN_SENDER;
if (success == true) {
successfulMessages[versionedHash] = true;
......@@ -312,7 +312,7 @@ abstract contract CrossDomainMessenger is
function _initialize(address _otherMessenger, address[] memory _blockedSystemAddresses)
internal
{
xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;
xDomainMsgSender = DefaultValues.DEFAULT_XDOMAIN_SENDER;
otherMessenger = _otherMessenger;
for (uint256 i = 0; i < _blockedSystemAddresses.length; i++) {
......
......@@ -3,7 +3,7 @@ pragma solidity ^0.8.9;
/* Contract Imports */
import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
/**
* @custom:proxied
......
......@@ -3,7 +3,7 @@ pragma solidity ^0.8.9;
import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol";
import { Proxy } from "./Proxy.sol";
import { Lib_AddressManager } from "../legacy/Lib_AddressManager.sol";
import { AddressManager } from "../legacy/AddressManager.sol";
import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol";
/**
......@@ -65,7 +65,7 @@ contract ProxyAdmin is Owned {
* @notice The address of the address manager, this is required to manage the
* ResolvedDelegateProxy type.
*/
Lib_AddressManager public addressManager;
AddressManager public addressManager;
/**
* @custom:legacy
......@@ -106,7 +106,7 @@ contract ProxyAdmin is Owned {
*
* @param _address Address of the AddressManager.
*/
function setAddressManager(Lib_AddressManager _address) external onlyOwner {
function setAddressManager(AddressManager _address) external onlyOwner {
addressManager = _address;
}
......
......@@ -21,7 +21,7 @@ contracts=(
L2CrossDomainMessenger
L2StandardBridge
L2ToL1MessagePasser
OVM_ETH
LegacyERC20ETH
SequencerFeeVault
WETH9
ProxyAdmin
......
......@@ -16,7 +16,7 @@ export const predeploys = {
OptimismMintableTokenFactory: '0x4200000000000000000000000000000000000012',
L1BlockNumber: '0x4200000000000000000000000000000000000013',
L1Block: '0x4200000000000000000000000000000000000015',
OVM_ETH: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
LegacyERC20ETH: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
WETH9: '0x4200000000000000000000000000000000000006',
GovernanceToken: '0x4200000000000000000000000000000000000042',
}
......
......@@ -112,7 +112,7 @@ task('genesis-l2', 'create a genesis config')
hash: deployConfig.l1BlockInitialHash,
sequenceNumber: deployConfig.l1BlockInitialSequenceNumber,
},
OVM_ETH: {
LegacyERC20ETH: {
bridge: predeploys.L2StandardBridge,
remoteToken: ethers.constants.AddressZero,
_name: 'Ether',
......@@ -150,9 +150,9 @@ task('genesis-l2', 'create a genesis config')
ethers.utils.hexConcat([prefix, num])
)
// There is no proxy at OVM_ETH or the GovernanceToken
// There is no proxy at LegacyERC20ETH or the GovernanceToken
if (
addr === ethers.utils.getAddress(predeploys.OVM_ETH) ||
addr === ethers.utils.getAddress(predeploys.LegacyERC20ETH) ||
addr === ethers.utils.getAddress(predeploys.GovernanceToken)
) {
continue
......@@ -236,7 +236,7 @@ task('genesis-l2', 'create a genesis config')
const artifact = await hre.artifacts.readArtifact(name)
assertEvenLength(artifact.deployedBytecode)
const allocAddr = name === 'OVM_ETH' ? addr : toCodeAddr(addr)
const allocAddr = name === 'LegacyERC20ETH' ? addr : toCodeAddr(addr)
assertEvenLength(allocAddr)
alloc[allocAddr] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment