Update state_transition.go

This commit is contained in:
Shawn 2024-02-05 13:52:21 -08:00
parent 993e208db9
commit eb71626cb3

View file

@ -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{