From cf15d6a919ba02bf83f972119ce14d23439a9836 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 18 May 2023 13:28:07 +0800 Subject: [PATCH] feat(all): rename `treasure` to `treasury` --- core/state_transition.go | 4 ++-- core/taiko_genesis.go | 2 -- params/config.go | 2 +- params/taiko_config.go | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 0f7cf9b45a2f..5adbc38b3bd6 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -404,10 +404,10 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { fee := new(big.Int).SetUint64(st.gasUsed()) fee.Mul(fee, effectiveTip) st.state.AddBalance(st.evm.Context.Coinbase, fee) - // CHANGE(taiko): basefee is not burnt, but sent to a treasure instead. + // CHANGE(taiko): basefee is not burnt, but sent to a treasury instead. if st.evm.ChainConfig().Taiko && st.evm.Context.BaseFee != nil { st.state.AddBalance( - st.evm.ChainConfig().Treasure, + st.evm.ChainConfig().Treasury, new(big.Int).Mul(st.evm.Context.BaseFee, new(big.Int).SetUint64(st.gasUsed())), ) } diff --git a/core/taiko_genesis.go b/core/taiko_genesis.go index 15c9ff144673..657ee8823d82 100644 --- a/core/taiko_genesis.go +++ b/core/taiko_genesis.go @@ -17,11 +17,9 @@ func TaikoGenesisBlock(networkID uint64) *Genesis { switch networkID { case params.TaikoInternal1NetworkID.Uint64(): chainConfig.ChainID = params.TaikoInternal1NetworkID - chainConfig.Treasure = common.HexToAddress("0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f") allocJSON = taikoGenesis.Internal1GenesisAllocJSON case params.TaikoInternal2NetworkID.Uint64(): chainConfig.ChainID = params.TaikoInternal2NetworkID - chainConfig.Treasure = common.HexToAddress("0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f") allocJSON = taikoGenesis.Internal2GenesisAllocJSON case params.SnæfellsjökullNetworkID.Uint64(): chainConfig.ChainID = params.SnæfellsjökullNetworkID diff --git a/params/config.go b/params/config.go index 4c137b05eb67..48fe13e25e95 100644 --- a/params/config.go +++ b/params/config.go @@ -459,7 +459,7 @@ type ChainConfig struct { // CHANGE(taiko): Taiko network flag. Taiko bool `json:"taiko"` - Treasure common.Address `json:"treasure"` + Treasury common.Address `json:"treasury"` } // EthashConfig is the consensus engine configs for proof-of-work based sealing. diff --git a/params/taiko_config.go b/params/taiko_config.go index 21cfc1fd9bc1..0d49f1af52e1 100644 --- a/params/taiko_config.go +++ b/params/taiko_config.go @@ -34,4 +34,5 @@ var TaikoChainConfig = &ChainConfig{ TerminalTotalDifficulty: common.Big0, TerminalTotalDifficultyPassed: true, Taiko: true, + Treasury: common.HexToAddress("0x1000777700000000000000000000000000000001"), // TODO: update this value }