Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/types/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ type storedReceiptRLP struct {
}

// v7StoredReceiptRLP is the storage encoding of a receipt used in database version 7.
// This version was introduced when AltFee feature was added (2024-11).
// This version was introduced when AltFee feature was added.
// It includes L1Fee and all AltFee fields (FeeTokenID, FeeRate, TokenScale, FeeLimit).
type v7StoredReceiptRLP struct {
PostStateOrStatus []byte
Expand Down
8 changes: 4 additions & 4 deletions rollup/fees/rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ func TokenRate(state StateDB, tokenID uint16) (*big.Int, *big.Int, error) {
}

func EthToAlt(state StateDB, tokenID uint16, amount *big.Int) (*big.Int, error) {
rate, tokenSacle, err := TokenRate(state, tokenID)
rate, scale, err := TokenRate(state, tokenID)
if err != nil {
return nil, err
}
return types.EthToAlt(amount, rate, tokenSacle)
return types.EthToAlt(amount, rate, scale)
}

func AltToETH(state StateDB, tokenID uint16, amount *big.Int) (*big.Int, error) {
rate, tokenScale, err := TokenRate(state, tokenID)
rate, scale, err := TokenRate(state, tokenID)
if err != nil {
return nil, err
}
return types.AltToEth(amount, rate, tokenScale)
return types.AltToEth(amount, rate, scale)
}
2 changes: 1 addition & 1 deletion rollup/fees/token_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func changeAltTokenBalanceByState(state StateDB, tokenAddress common.Address, ba
amountBytes := common.LeftPadBytes(newBalance.Bytes(), 32)
amountHash := common.BytesToHash(amountBytes)

// Calculate the storage slot for the user's balance
// Change user balance
state.SetState(tokenAddress, storageSlot, amountHash)

return nil
Expand Down