From cde7862858e5200521b8c69a2c9c900e286684c3 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 21 Jan 2025 14:15:54 +0900 Subject: [PATCH] update config & deploy script --- op-chain-ops/genesis/config.go | 5 +++++ .../contracts-bedrock/deploy-config/devnetL1-template.json | 1 + .../tokamak/contracts-bedrock/deploy-config/hardhat.json | 3 ++- packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol | 6 +++++- .../tokamak/contracts-bedrock/scripts/DeployConfig.s.sol | 2 ++ .../contracts-bedrock/scripts/getting-started/config.sh | 2 ++ 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 7f9f175cc..2523bf375 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -65,6 +65,8 @@ type DeployConfig struct { NativeTokenSymbol string `json:"nativeTokenSymbol"` // L1Token is the L1's address of the L2 chain's native token. NativeTokenAddress common.Address `json:"nativeTokenAddress"` + // SeigniorageReceiver is the receiver of seigniorage. + SeigniorageReceiver common.Address `json:"seigniorageReceiver"` // L1ChainID is the chain ID of the L1 chain. L1ChainID uint64 `json:"l1ChainID"` // L2ChainID is the chain ID of the L2 chain. @@ -384,6 +386,9 @@ func (d *DeployConfig) Check() error { if d.L2ChainID == 0 { return fmt.Errorf("%w: L2ChainID cannot be 0", ErrInvalidDeployConfig) } + if d.SeigniorageReceiver == (common.Address{}) { + return fmt.Errorf("%w: SeigniorageReceiver cannot be address(0)", ErrInvalidDeployConfig) + } if d.L2BlockTime == 0 { return fmt.Errorf("%w: L2BlockTime cannot be 0", ErrInvalidDeployConfig) } diff --git a/packages/tokamak/contracts-bedrock/deploy-config/devnetL1-template.json b/packages/tokamak/contracts-bedrock/deploy-config/devnetL1-template.json index 738f0ada2..4a67a7398 100644 --- a/packages/tokamak/contracts-bedrock/deploy-config/devnetL1-template.json +++ b/packages/tokamak/contracts-bedrock/deploy-config/devnetL1-template.json @@ -5,6 +5,7 @@ "nativeTokenName": "Tokamak Network Token", "nativeTokenSymbol": "TON", "nativeTokenAddress": "0x75fE809aE1C4A66c27a0239F147d0cc5710a104A", + "seigniorageReceiver": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "setPrecompileBalances": false, "maxSequencerDrift": 300, "sequencerWindowSize": 200, diff --git a/packages/tokamak/contracts-bedrock/deploy-config/hardhat.json b/packages/tokamak/contracts-bedrock/deploy-config/hardhat.json index 12b74e706..52b3e7ddf 100644 --- a/packages/tokamak/contracts-bedrock/deploy-config/hardhat.json +++ b/packages/tokamak/contracts-bedrock/deploy-config/hardhat.json @@ -67,5 +67,6 @@ "nativeTokenSymbol": "TON", "nativeTokenAddress": "0xC7844340d14deAedfDD2f2dD9360c336661b2F0A", "l1UsdcAddr": "0x2910E325cf29dd912E3476B61ef12F49cb931096", - "devnet": true + "devnet": true, + "seigniorageReceiver": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc" } \ No newline at end of file diff --git a/packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol b/packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol index 16989347d..a5a7e1770 100644 --- a/packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol +++ b/packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol @@ -1127,6 +1127,9 @@ contract Deploy is Deployer { l2NativeTokenAddress = address(token); } console.log(" [Check ]l2NativeTokenAddress", l2NativeTokenAddress); + address seigniorageReceiver = cfg.seigniorageReceiver(); + console.log(" [Check ]seigniorageReceiver", seigniorageReceiver); + _upgradeAndCallViaSafe({ _proxy: payable(systemConfigProxy), @@ -1150,7 +1153,8 @@ contract Deploy is Deployer { optimismPortal: mustGetAddress("OptimismPortalProxy"), optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"), gasPayingToken: customGasTokenAddress, - nativeTokenAddress: l2NativeTokenAddress + nativeTokenAddress: l2NativeTokenAddress, + seigniorageReceiver: seigniorageReceiver }) ) ) diff --git a/packages/tokamak/contracts-bedrock/scripts/DeployConfig.s.sol b/packages/tokamak/contracts-bedrock/scripts/DeployConfig.s.sol index 8fe04c0e9..a2f735f81 100644 --- a/packages/tokamak/contracts-bedrock/scripts/DeployConfig.s.sol +++ b/packages/tokamak/contracts-bedrock/scripts/DeployConfig.s.sol @@ -25,6 +25,7 @@ contract DeployConfig is Script { address public finalSystemOwner; address public superchainConfigGuardian; address public nativeTokenAddress; + address public seigniorageReceiver; uint256 public l1ChainID; uint256 public l2ChainID; uint256 public l2BlockTime; @@ -106,6 +107,7 @@ contract DeployConfig is Script { finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner"); superchainConfigGuardian = stdJson.readAddress(_json, "$.superchainConfigGuardian"); nativeTokenAddress = stdJson.readAddress(_json, "$.nativeTokenAddress"); + seigniorageReceiver = stdJson.readAddress(_json, "$.seigniorageReceiver"); l1ChainID = stdJson.readUint(_json, "$.l1ChainID"); l2ChainID = stdJson.readUint(_json, "$.l2ChainID"); l2BlockTime = stdJson.readUint(_json, "$.l2BlockTime"); diff --git a/packages/tokamak/contracts-bedrock/scripts/getting-started/config.sh b/packages/tokamak/contracts-bedrock/scripts/getting-started/config.sh index 5654f46d1..3b57356e7 100755 --- a/packages/tokamak/contracts-bedrock/scripts/getting-started/config.sh +++ b/packages/tokamak/contracts-bedrock/scripts/getting-started/config.sh @@ -42,6 +42,8 @@ config=$(cat << EOL "nativeTokenSymbol": "CHANGE_ME", "nativeTokenAddress": "CHANGE_ME", + "seigniorageReceiver": "$GS_ADMIN_ADDRESS", + "maxSequencerDrift": 600, "sequencerWindowSize": 3600, "channelTimeout": 300,