diff --git a/fvm/evm/emulator/config.go b/fvm/evm/emulator/config.go index f6bc573f592..c6efaa322ba 100644 --- a/fvm/evm/emulator/config.go +++ b/fvm/evm/emulator/config.go @@ -50,7 +50,7 @@ func (c *Config) ChainRules() gethParams.Rules { // and set a proper height for the specific release based on the Flow EVM heights // so it could gets activated at a desired time. var DefaultChainConfig = &gethParams.ChainConfig{ - ChainID: types.FlowEVMTestnetChainID, // default is testnet + ChainID: types.FlowEVMPreviewNetChainID, // Fork scheduling based on block heights HomesteadBlock: bigZero, diff --git a/fvm/evm/emulator/emulator_test.go b/fvm/evm/emulator/emulator_test.go index d7d2f7f4f01..48d0087fdb5 100644 --- a/fvm/evm/emulator/emulator_test.go +++ b/fvm/evm/emulator/emulator_test.go @@ -248,7 +248,7 @@ func TestContractInteraction(t *testing.T) { nonce += 1 ret := new(big.Int).SetBytes(res.ReturnedValue) - require.Equal(t, types.FlowEVMTestnetChainID, ret) + require.Equal(t, types.FlowEVMPreviewNetChainID, ret) }) }) @@ -328,7 +328,7 @@ func TestContractInteraction(t *testing.T) { tx := account.SignTx( t, gethTypes.NewTx(&gethTypes.DynamicFeeTx{ - ChainID: types.FlowEVMTestnetChainID, + ChainID: types.FlowEVMPreviewNetChainID, Nonce: account.Nonce(), GasTipCap: big.NewInt(2), GasFeeCap: big.NewInt(3), diff --git a/fvm/evm/types/chainIDs.go b/fvm/evm/types/chainIDs.go index 50394f38a22..d979bc732a3 100644 --- a/fvm/evm/types/chainIDs.go +++ b/fvm/evm/types/chainIDs.go @@ -7,15 +7,19 @@ import ( ) var ( - FlowEVMTestnetChainID = big.NewInt(646) - FlowEVMMainnetChainID = big.NewInt(747) + FlowEVMPreviewNetChainID = big.NewInt(646) + FlowEVMTestNetChainID = big.NewInt(545) + FlowEVMMainNetChainID = big.NewInt(747) ) func EVMChainIDFromFlowChainID(flowChainID flow.ChainID) *big.Int { - // default evm chain ID is testnet - chainID := FlowEVMTestnetChainID - if flowChainID == flow.Mainnet { - chainID = FlowEVMMainnetChainID + // default evm chain ID is previewNet + switch flowChainID { + case flow.Mainnet: + return FlowEVMMainNetChainID + case flow.Testnet: + return FlowEVMTestNetChainID + default: + return FlowEVMPreviewNetChainID } - return chainID } diff --git a/fvm/evm/types/emulator.go b/fvm/evm/types/emulator.go index 79b8e87960e..9a18805f309 100644 --- a/fvm/evm/types/emulator.go +++ b/fvm/evm/types/emulator.go @@ -39,7 +39,7 @@ type BlockContext struct { // NewDefaultBlockContext returns a new default block context func NewDefaultBlockContext(BlockNumber uint64) BlockContext { return BlockContext{ - ChainID: FlowEVMTestnetChainID, + ChainID: FlowEVMPreviewNetChainID, BlockNumber: BlockNumber, DirectCallBaseGasUsage: DefaultDirectCallBaseGasUsage, DirectCallGasPrice: DefaultDirectCallGasPrice,