Skip to content

Commit

Permalink
Require a positive balance for the fee token. (#1033)
Browse files Browse the repository at this point in the history
(cherry picked from commit 613200a)
  • Loading branch information
InoMurko committed Jul 31, 2023
1 parent 3eafab1 commit adfe25e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions l2geth/core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ The state transitioning model does all the necessary work to work out a valid ne
3) Create a new state object if the recipient is \0*32
4) Value transfer
== If contract creation ==
4a) Attempt to run transaction data
4b) If valid, use result as code for the new state object
4a) Attempt to run transaction data
4b) If valid, use result as code for the new state object
== end ==
5) Run Script section
6) Derive new state root
Expand Down Expand Up @@ -277,7 +279,7 @@ func (st *StateTransition) buyGas() error {
if !st.isEthereumL2 {
bobaval = new(big.Int).Div(bobaval, st.bobaPriceRatioDivisor)
}
if st.state.GetBobaBalance(st.msg.From()).Cmp(bobaval) < 0 {
if st.state.GetBobaBalance(st.msg.From()).Cmp(bobaval) <= 0 {
if !st.isEthereumL2 {
return errInsufficientL1NativeTokenBalanceForGas
}
Expand Down

0 comments on commit adfe25e

Please sign in to comment.