Skip to content

Commit

Permalink
[KGA-46]fix: Selfdestruct send to burn address (#1618)
Browse files Browse the repository at this point in the history
code-423n4/2024-09-kakarot-findings#83

Selftdestruct send to the burn address
  • Loading branch information
obatirou authored Nov 20, 2024
1 parent 63f6320 commit ae79059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cairo_zero/kakarot/instructions/system_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,9 @@ namespace SystemOperations {

// If the account was created in the same transaction and recipient is self, the native token is burnt
tempvar is_recipient_not_self = is_not_zero(recipient - evm.message.address.evm);

if (self_account.created != FALSE) {
tempvar recipient = is_recipient_not_self * recipient;
tempvar recipient = (1 - is_recipient_not_self) * Constants.BURN_ADDRESS +
is_recipient_not_self * recipient;
} else {
tempvar recipient = recipient;
}
Expand Down

0 comments on commit ae79059

Please sign in to comment.