Skip to content

Commit 0058e4a

Browse files
committed
Merge remote-tracking branch 'origin/celo-contracts/v3.0.0--1' into Kourin1996/celo-rebase-13-contracts-devnet
2 parents 092af07 + dcfd0f3 commit 0058e4a

File tree

13 files changed

+1
-241
lines changed

13 files changed

+1
-241
lines changed

packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
99
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
1010

1111
interface IOptimismPortal2 {
12-
error CustomGasTokenNotSupported();
1312
error AlreadyFinalized();
1413
error BadTarget();
1514
error Blacklisted();

packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
1010
import { ConfigType } from "interfaces/L2/IL1BlockInterop.sol";
1111

1212
interface IOptimismPortalInterop {
13-
error CustomGasTokenNotSupported();
1413
error AlreadyFinalized();
1514
error BadTarget();
1615
error Blacklisted();

packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
55

66
/// @notice This interface corresponds to the Custom Gas Token version of the SystemConfig contract.
77
interface ISystemConfig {
8-
error CustomGasTokenNotSupported();
9-
108
enum UpdateType {
119
BATCHER,
1210
FEE_SCALARS,

packages/contracts-bedrock/interfaces/L1/ISystemConfigInterop.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
55
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
66

77
interface ISystemConfigInterop {
8-
error CustomGasTokenNotSupported();
9-
108
event ConfigUpdate(uint256 indexed version, ISystemConfig.UpdateType indexed updateType, bytes data);
119
event Initialized(uint8 version);
1210
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

packages/contracts-bedrock/scripts/deploy/Deploy.s.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ contract Deploy is Deployer {
312312
artifacts.save("MipsSingleton", address(dio.mipsSingleton()));
313313
artifacts.save("OPContractsManager", address(dio.opcm()));
314314
artifacts.save("DelayedWETHImpl", address(dio.delayedWETHImpl()));
315+
artifacts.save("SystemConfigImpl", address(dio.systemConfigImpl()));
315316

316317
// Get a contract set from the implementation addresses which were just deployed.
317318
Types.ContractSet memory impls = Types.ContractSet({

packages/contracts-bedrock/src/L1/OptimismPortal2.sol

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"
4848
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
4949
import { IL1Block } from "interfaces/L2/IL1Block.sol";
5050

51-
/// @notice This is temporary. Error thrown when a chain uses a custom gas token.
52-
error CustomGasTokenNotSupported();
53-
5451
/// @custom:proxied true
5552
/// @title OptimismPortal2
5653
/// @notice The OptimismPortal is a low-level contract responsible for passing messages between L1
@@ -240,9 +237,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
240237
if (token == Constants.ETHER) {
241238
return address(this).balance;
242239
} else {
243-
// Temporary revert till we support custom gas tokens
244-
if (true) revert CustomGasTokenNotSupported();
245-
246240
return _balance;
247241
}
248242
}
@@ -450,9 +444,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
450444
// to accomplish this, `callWithMinGas` will revert.
451445
success = SafeCall.callWithMinGas(_tx.target, _tx.gasLimit, _tx.value, _tx.data);
452446
} else {
453-
// Temporary revert till we support custom gas tokens
454-
if (true) revert CustomGasTokenNotSupported();
455-
456447
// Cannot call the token contract directly from the portal. This would allow an attacker
457448
// to call approve from a withdrawal and drain the balance of the portal.
458449
if (_tx.target == token) revert BadTarget();
@@ -522,9 +513,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
522513
public
523514
metered(_gasLimit)
524515
{
525-
// Temporary revert till we support custom gas tokens
526-
// if (true) revert CustomGasTokenNotSupported();
527-
528516
// Can only be called if an ERC20 token is used for gas paying on L2
529517
(address token,) = gasPayingToken();
530518
if (token == Constants.ETHER) revert OnlyCustomGasToken();
@@ -575,9 +563,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
575563
{
576564
(address token,) = gasPayingToken();
577565

578-
// Temporary revert till we support custom gas tokens
579-
if (token != Constants.ETHER) revert CustomGasTokenNotSupported();
580-
581566
if (token != Constants.ETHER && msg.value != 0) revert NoValue();
582567

583568
_depositTransaction({
@@ -640,9 +625,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
640625
/// @notice Sets the gas paying token for the L2 system. This token is used as the
641626
/// L2 native asset. Only the SystemConfig contract can call this function.
642627
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external {
643-
// Temporary revert till we support custom gas tokens
644-
// if (true) revert CustomGasTokenNotSupported();
645-
646628
if (msg.sender != address(systemConfig)) revert Unauthorized();
647629

648630
// Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas.

packages/contracts-bedrock/src/L1/SystemConfig.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import { ISemver } from "interfaces/universal/ISemver.sol";
1515
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
1616
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
1717

18-
/// @dev This is temporary. Error thrown when a chain uses a custom gas token.
19-
error CustomGasTokenNotSupported();
20-
2118
/// @custom:proxied true
2219
/// @title SystemConfig
2320
/// @notice The SystemConfig contract is used to manage configuration of an Optimism network.
@@ -318,9 +315,6 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken {
318315
/// @param _token Address of the gas paying token.
319316
function _setGasPayingToken(address _token) internal virtual {
320317
if (_token != address(0) && _token != Constants.ETHER && !isCustomGasToken()) {
321-
// Temporary revert till we support custom gas tokens
322-
// if (true) revert CustomGasTokenNotSupported();
323-
324318
require(
325319
ERC20(_token).decimals() == GAS_PAYING_TOKEN_DECIMALS, "SystemConfig: bad decimals of gas paying token"
326320
);

packages/contracts-bedrock/src/L1/SystemConfigInterop.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import { IOptimismPortalInterop as IOptimismPortal } from "interfaces/L1/IOptimi
1616
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
1717
import { ConfigType } from "interfaces/L2/IL1BlockInterop.sol";
1818

19-
/// @dev This is temporary. Error thrown when a chain uses a custom gas token.
20-
error CustomGasTokenNotSupported();
21-
2219
/// @custom:proxied true
2320
/// @title SystemConfigInterop
2421
/// @notice The SystemConfig contract is used to manage configuration of an Optimism network.
@@ -85,8 +82,6 @@ contract SystemConfigInterop is SystemConfig {
8582
/// @param _token Address of the gas paying token.
8683
function _setGasPayingToken(address _token) internal override {
8784
if (_token != address(0) && _token != Constants.ETHER && !isCustomGasToken()) {
88-
// Temporary revert till we support custom gas tokens
89-
if (true) revert CustomGasTokenNotSupported();
9085

9186
require(
9287
ERC20(_token).decimals() == GAS_PAYING_TOKEN_DECIMALS, "SystemConfig: bad decimals of gas paying token"

packages/contracts-bedrock/test/L1/L1CrossDomainMessenger.t.sol

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -869,26 +869,8 @@ contract L1CrossDomainMessenger_Test is CommonTest {
869869
assertEq(l1CrossDomainMessenger.paused(), superchainConfig.paused());
870870
}
871871

872-
/// @dev Temporary test that checks that correct calls to sendMessage when using a custom gas token revert with the
873-
/// expected error.
874-
/// @dev Should be removed when/if Custom Gas Token functionality is allowed again.
875-
function test_sendMessage_customGasToken_reverts() external {
876-
skipIfForkTest("Custom gas token is still supported on forked tests");
877-
878-
// Mock the gasPayingToken function to return a custom gas token
879-
vm.mockCall(
880-
address(systemConfig), abi.encodeCall(systemConfig.gasPayingToken, ()), abi.encode(address(1), uint8(18))
881-
);
882-
883-
vm.prank(alice);
884-
vm.expectRevert(IOptimismPortal2.CustomGasTokenNotSupported.selector);
885-
l1CrossDomainMessenger.sendMessage(recipient, hex"ff", uint32(100));
886-
}
887-
888872
/// @dev Tests that sendMessage succeeds with a custom gas token when the call value is zero.
889873
function test_sendMessage_customGasTokenButNoValue_succeeds() external {
890-
vm.skip(true, "Custom gas token not supported");
891-
892874
// Mock the gasPayingToken function to return a custom gas token
893875
vm.mockCall(
894876
address(systemConfig), abi.encodeCall(systemConfig.gasPayingToken, ()), abi.encode(address(1), uint8(18))

0 commit comments

Comments
 (0)