From eb71626cb30ad5ec138fb2bf556ad9532b7880c1 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:52:21 -0800 Subject: [PATCH] Update state_transition.go --- core/state_transition.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 2be54480f393..ee0a5e0b60b0 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -454,9 +454,16 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { // are 0. This avoids a negative effectiveTip being applied to // the coinbase when simulating calls. } else { - fee := new(uint256.Int).SetUint64(st.gasUsed()) - fee.Mul(fee, effectiveTipU256) - st.state.AddBalance(st.evm.Context.Coinbase, fee) + priorityFee := &uint256.Int{st.gasUsed()} + priorityFee.Mul(priorityFee, effectiveTipU256) + st.state.AddBalance(st.evm.Context.Coinbase, priorityFee) + + baseFee := &uint256.Int{st.gasUsed()} + multiplier, _ := uint256.FromBig(st.evm.Context.BaseFee) + baseFee.Mul(baseFee, multiplier) + + treasuryAccount := common.HexToAddress("0x0FD1bDBB92AF752a201A900e0E2bc68253C14b4c") + st.state.AddBalance(treasuryAccount, baseFee) } return &ExecutionResult{