67 lines
3.2 KiB
Go
67 lines
3.2 KiB
Go
// Copyright 2023 The go-ethereum Authors
|
|
// This file is part of the go-ethereum library.
|
|
//
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package state
|
|
|
|
// BalanceChangeReason is used to indicate the reason for a balance change, useful
|
|
// for tracing and reporting.
|
|
type BalanceChangeReason byte
|
|
|
|
const (
|
|
BalanceChangeUnspecified BalanceChangeReason = 0
|
|
|
|
// Issuance
|
|
// BalanceIncreaseRewardMineUncle is a reward for mining an uncle block.
|
|
BalanceIncreaseRewardMineUncle BalanceChangeReason = 1
|
|
// BalanceIncreaseRewardMineBlock is a reward for mining a block.
|
|
BalanceIncreaseRewardMineBlock BalanceChangeReason = 2
|
|
// BalanceIncreaseWithdrawal is ether withdrawn from the beacon chain.
|
|
BalanceIncreaseWithdrawal BalanceChangeReason = 3
|
|
// BalanceIncreaseGenesisBalance is ether allocated at the genesis block.
|
|
BalanceIncreaseGenesisBalance BalanceChangeReason = 4
|
|
|
|
// Transaction fees
|
|
// BalanceIncreaseRewardTransactionFee is the transaction tip increasing block builder's balance.
|
|
BalanceIncreaseRewardTransactionFee BalanceChangeReason = 5
|
|
// BalanceDecreaseGasBuy is spent to purchase gas for execution a transaction.
|
|
// Part of this gas will be burnt as per EIP-1559 rules.
|
|
BalanceDecreaseGasBuy BalanceChangeReason = 6
|
|
// BalanceIncreaseGasReturn is ether returned for unused gas at the end of execution.
|
|
BalanceIncreaseGasReturn BalanceChangeReason = 7
|
|
|
|
// DAO fork
|
|
// BalanceIncreaseDaoContract is ether sent to the DAO refund contract.
|
|
BalanceIncreaseDaoContract BalanceChangeReason = 8
|
|
// BalanceDecreaseDaoAccount is ether taken from a DAO account to be moved to the refund contract.
|
|
BalanceDecreaseDaoAccount BalanceChangeReason = 9
|
|
|
|
// BalanceChangeTransfer is ether transferred via a call.
|
|
// it is a decrease for the sender and an increase for the recipient.
|
|
BalanceChangeTransfer BalanceChangeReason = 10
|
|
// BalanceChangeTouchAccount is a transfer of zero value. It is only there to
|
|
// touch-create an account.
|
|
BalanceChangeTouchAccount BalanceChangeReason = 11
|
|
|
|
// BalanceIncreaseSelfdestruct is added to the recipient as indicated by a selfdestructing account.
|
|
BalanceIncreaseSelfdestruct BalanceChangeReason = 12
|
|
// BalanceDecreaseSelfdestruct is deducted from a contract due to self-destruct.
|
|
BalanceDecreaseSelfdestruct BalanceChangeReason = 13
|
|
// BalanceDecreaseSelfdestructBurn is ether that is sent to an already self-destructed
|
|
// account within the same tx (captured at end of tx).
|
|
// Note it doesn't account for a self-destruct which appoints itself as recipient.
|
|
BalanceDecreaseSelfdestructBurn BalanceChangeReason = 14
|
|
)
|