Skip to content

Commit 6c44b0b

Browse files
authored
remove CGT code (#13686)
* remove CGT code * fixes * fixes * remove CGT code * fixes * fixes * restore L2 tests * make _balance a spacer, inline unnecessary internal function * add version tests * add version tests * add version tests * add version tests * ... * fixes * fixes
1 parent bfb9de2 commit 6c44b0b

32 files changed

+120
-2166
lines changed

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

Lines changed: 0 additions & 15 deletions
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();
@@ -24,13 +23,10 @@ interface IOptimismPortal2 {
2423
error InvalidMerkleProof();
2524
error InvalidProof();
2625
error LargeCalldata();
27-
error NoValue();
2826
error NonReentrant();
29-
error OnlyCustomGasToken();
3027
error OutOfGas();
3128
error ProposalNotValidated();
3229
error SmallGasLimit();
33-
error TransferFailed();
3430
error Unauthorized();
3531
error UnexpectedList();
3632
error UnexpectedString();
@@ -46,18 +42,8 @@ interface IOptimismPortal2 {
4642

4743
receive() external payable;
4844

49-
function balance() external view returns (uint256);
5045
function blacklistDisputeGame(IDisputeGame _disputeGame) external;
5146
function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view;
52-
function depositERC20Transaction(
53-
address _to,
54-
uint256 _mint,
55-
uint256 _value,
56-
uint64 _gasLimit,
57-
bool _isCreation,
58-
bytes memory _data
59-
)
60-
external;
6147
function depositTransaction(
6248
address _to,
6349
uint256 _value,
@@ -109,7 +95,6 @@ interface IOptimismPortal2 {
10995
returns (IDisputeGame disputeGameProxy, uint64 timestamp); // nosemgrep
11096
function respectedGameType() external view returns (GameType);
11197
function respectedGameTypeUpdatedAt() external view returns (uint64);
112-
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external;
11398
function setRespectedGameType(GameType _gameType) external;
11499
function superchainConfig() external view returns (ISuperchainConfig);
115100
function systemConfig() external view returns (ISystemConfig);

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ interface IOptimismPortalInterop {
2525
error InvalidMerkleProof();
2626
error InvalidProof();
2727
error LargeCalldata();
28-
error NoValue();
2928
error NonReentrant();
30-
error OnlyCustomGasToken();
3129
error OutOfGas();
3230
error ProposalNotValidated();
3331
error SmallGasLimit();
34-
error TransferFailed();
3532
error Unauthorized();
3633
error UnexpectedList();
3734
error UnexpectedString();
@@ -47,18 +44,8 @@ interface IOptimismPortalInterop {
4744

4845
receive() external payable;
4946

50-
function balance() external view returns (uint256);
5147
function blacklistDisputeGame(IDisputeGame _disputeGame) external;
5248
function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view;
53-
function depositERC20Transaction(
54-
address _to,
55-
uint256 _mint,
56-
uint256 _value,
57-
uint64 _gasLimit,
58-
bool _isCreation,
59-
bytes memory _data
60-
)
61-
external;
6249
function depositTransaction(
6350
address _to,
6451
uint256 _value,
@@ -111,7 +98,6 @@ interface IOptimismPortalInterop {
11198
function respectedGameType() external view returns (GameType);
11299
function respectedGameTypeUpdatedAt() external view returns (uint64);
113100
function setConfig(ConfigType _type, bytes memory _value) external;
114-
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external;
115101
function setRespectedGameType(GameType _gameType) external;
116102
function superchainConfig() external view returns (ISuperchainConfig);
117103
function systemConfig() external view returns (ISystemConfig);

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

Lines changed: 0 additions & 7 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,
@@ -22,7 +20,6 @@ interface ISystemConfig {
2220
address disputeGameFactory;
2321
address optimismPortal;
2422
address optimismMintableERC20Factory;
25-
address gasPayingToken;
2623
}
2724

2825
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
@@ -47,9 +44,6 @@ interface ISystemConfig {
4744
function gasLimit() external view returns (uint64);
4845
function eip1559Denominator() external view returns (uint32);
4946
function eip1559Elasticity() external view returns (uint32);
50-
function gasPayingToken() external view returns (address addr_, uint8 decimals_);
51-
function gasPayingTokenName() external view returns (string memory name_);
52-
function gasPayingTokenSymbol() external view returns (string memory symbol_);
5347
function initialize(
5448
address _owner,
5549
uint32 _basefeeScalar,
@@ -62,7 +56,6 @@ interface ISystemConfig {
6256
Addresses memory _addresses
6357
)
6458
external;
65-
function isCustomGasToken() external view returns (bool);
6659
function l1CrossDomainMessenger() external view returns (address addr_);
6760
function l1ERC721Bridge() external view returns (address addr_);
6861
function l1StandardBridge() external view returns (address addr_);

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

Lines changed: 0 additions & 6 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);
@@ -29,10 +27,6 @@ interface ISystemConfigInterop {
2927
function gasLimit() external view returns (uint64);
3028
function eip1559Denominator() external view returns (uint32);
3129
function eip1559Elasticity() external view returns (uint32);
32-
function gasPayingToken() external view returns (address addr_, uint8 decimals_);
33-
function gasPayingTokenName() external view returns (string memory name_);
34-
function gasPayingTokenSymbol() external view returns (string memory symbol_);
35-
function isCustomGasToken() external view returns (bool);
3630
function l1CrossDomainMessenger() external view returns (address addr_);
3731
function l1ERC721Bridge() external view returns (address addr_);
3832
function l1StandardBridge() external view returns (address addr_);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ contract Deploy is Deployer {
530530
l1StandardBridge: artifacts.mustGetAddress("L1StandardBridgeProxy"),
531531
disputeGameFactory: artifacts.mustGetAddress("DisputeGameFactoryProxy"),
532532
optimismPortal: artifacts.mustGetAddress("OptimismPortalProxy"),
533-
optimismMintableERC20Factory: artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy"),
534-
gasPayingToken: customGasTokenAddress
533+
optimismMintableERC20Factory: artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy")
535534
})
536535
)
537536
)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,6 @@ contract DeployOPChain is Script {
563563
systemConfig.optimismMintableERC20Factory() == address(_doo.optimismMintableERC20FactoryProxy()),
564564
"SYSCON-210"
565565
);
566-
(address gasPayingToken,) = systemConfig.gasPayingToken();
567-
require(gasPayingToken == Constants.ETHER, "SYSCON-220");
568566
}
569567

570568
function assertValidL1CrossDomainMessenger(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {

packages/contracts-bedrock/snapshots/.gas-snapshot

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchm
44
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5144)
55
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
66
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
7-
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369264)
8-
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967493)
9-
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564413)
10-
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076606)
11-
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467092)
12-
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512819)
13-
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72667)
7+
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356487)
8+
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954716)
9+
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 551636)
10+
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4063829)
11+
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450322)
12+
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496221)
13+
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 59849)

packages/contracts-bedrock/snapshots/abi/OptimismPortal2.json

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,6 @@
1919
"stateMutability": "payable",
2020
"type": "receive"
2121
},
22-
{
23-
"inputs": [],
24-
"name": "balance",
25-
"outputs": [
26-
{
27-
"internalType": "uint256",
28-
"name": "",
29-
"type": "uint256"
30-
}
31-
],
32-
"stateMutability": "view",
33-
"type": "function"
34-
},
3522
{
3623
"inputs": [
3724
{
@@ -63,44 +50,6 @@
6350
"stateMutability": "view",
6451
"type": "function"
6552
},
66-
{
67-
"inputs": [
68-
{
69-
"internalType": "address",
70-
"name": "_to",
71-
"type": "address"
72-
},
73-
{
74-
"internalType": "uint256",
75-
"name": "_mint",
76-
"type": "uint256"
77-
},
78-
{
79-
"internalType": "uint256",
80-
"name": "_value",
81-
"type": "uint256"
82-
},
83-
{
84-
"internalType": "uint64",
85-
"name": "_gasLimit",
86-
"type": "uint64"
87-
},
88-
{
89-
"internalType": "bool",
90-
"name": "_isCreation",
91-
"type": "bool"
92-
},
93-
{
94-
"internalType": "bytes",
95-
"name": "_data",
96-
"type": "bytes"
97-
}
98-
],
99-
"name": "depositERC20Transaction",
100-
"outputs": [],
101-
"stateMutability": "nonpayable",
102-
"type": "function"
103-
},
10453
{
10554
"inputs": [
10655
{
@@ -602,34 +551,6 @@
602551
"stateMutability": "view",
603552
"type": "function"
604553
},
605-
{
606-
"inputs": [
607-
{
608-
"internalType": "address",
609-
"name": "_token",
610-
"type": "address"
611-
},
612-
{
613-
"internalType": "uint8",
614-
"name": "_decimals",
615-
"type": "uint8"
616-
},
617-
{
618-
"internalType": "bytes32",
619-
"name": "_name",
620-
"type": "bytes32"
621-
},
622-
{
623-
"internalType": "bytes32",
624-
"name": "_symbol",
625-
"type": "bytes32"
626-
}
627-
],
628-
"name": "setGasPayingToken",
629-
"outputs": [],
630-
"stateMutability": "nonpayable",
631-
"type": "function"
632-
},
633554
{
634555
"inputs": [
635556
{
@@ -846,11 +767,6 @@
846767
"name": "ContentLengthMismatch",
847768
"type": "error"
848769
},
849-
{
850-
"inputs": [],
851-
"name": "CustomGasTokenNotSupported",
852-
"type": "error"
853-
},
854770
{
855771
"inputs": [],
856772
"name": "EmptyItem",
@@ -896,21 +812,11 @@
896812
"name": "LargeCalldata",
897813
"type": "error"
898814
},
899-
{
900-
"inputs": [],
901-
"name": "NoValue",
902-
"type": "error"
903-
},
904815
{
905816
"inputs": [],
906817
"name": "NonReentrant",
907818
"type": "error"
908819
},
909-
{
910-
"inputs": [],
911-
"name": "OnlyCustomGasToken",
912-
"type": "error"
913-
},
914820
{
915821
"inputs": [],
916822
"name": "OutOfGas",
@@ -926,11 +832,6 @@
926832
"name": "SmallGasLimit",
927833
"type": "error"
928834
},
929-
{
930-
"inputs": [],
931-
"name": "TransferFailed",
932-
"type": "error"
933-
},
934835
{
935836
"inputs": [],
936837
"name": "Unauthorized",

0 commit comments

Comments
 (0)