Skip to content

Commit

Permalink
update config & deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-learner committed Jan 21, 2025
1 parent 7a26670 commit cde7862
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"nativeTokenName": "Tokamak Network Token",
"nativeTokenSymbol": "TON",
"nativeTokenAddress": "0x75fE809aE1C4A66c27a0239F147d0cc5710a104A",
"seigniorageReceiver": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"setPrecompileBalances": false,
"maxSequencerDrift": 300,
"sequencerWindowSize": 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
"nativeTokenSymbol": "TON",
"nativeTokenAddress": "0xC7844340d14deAedfDD2f2dD9360c336661b2F0A",
"l1UsdcAddr": "0x2910E325cf29dd912E3476B61ef12F49cb931096",
"devnet": true
"devnet": true,
"seigniorageReceiver": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc"
}
6 changes: 5 additions & 1 deletion packages/tokamak/contracts-bedrock/scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -1150,7 +1153,8 @@ contract Deploy is Deployer {
optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
gasPayingToken: customGasTokenAddress,
nativeTokenAddress: l2NativeTokenAddress
nativeTokenAddress: l2NativeTokenAddress,
seigniorageReceiver: seigniorageReceiver
})
)
)
Expand Down
2 changes: 2 additions & 0 deletions packages/tokamak/contracts-bedrock/scripts/DeployConfig.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ config=$(cat << EOL
"nativeTokenSymbol": "CHANGE_ME",
"nativeTokenAddress": "CHANGE_ME",
"seigniorageReceiver": "$GS_ADMIN_ADDRESS",
"maxSequencerDrift": 600,
"sequencerWindowSize": 3600,
"channelTimeout": 300,
Expand Down

0 comments on commit cde7862

Please sign in to comment.