eip-7708 fix: don't emit log when calling to self

This commit is contained in:
Jared Wasinger 2026-02-02 16:43:08 -05:00
parent 097fe511dc
commit 012efa11ab

View file

@ -145,7 +145,7 @@ func CanTransfer(db vm.StateDB, addr common.Address, amount *uint256.Int) bool {
func Transfer(db vm.StateDB, sender, recipient common.Address, amount *uint256.Int, blockNumber *big.Int, rules *params.Rules) {
db.SubBalance(sender, amount, tracing.BalanceChangeTransfer)
db.AddBalance(recipient, amount, tracing.BalanceChangeTransfer)
if rules.IsAmsterdam && !amount.IsZero() {
if rules.IsAmsterdam && !amount.IsZero() && sender != recipient {
db.AddLog(types.EthTransferLog(blockNumber, sender, recipient, amount))
}
}