Skip to content

Commit

Permalink
[KGA-64] dev: remove dead code in exec_create (#1611)
Browse files Browse the repository at this point in the history
Removes a portion of dead code that cheks the return value of the
`add_transfer` function in `exec_create`. Because the case where the
sender doesn't have enough balance is manually handled before, this
branch can not be executed.

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1611)
<!-- Reviewable:end -->
  • Loading branch information
enitrat authored Nov 15, 2024
1 parent 0fbea3a commit 36f8cdc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cairo_zero/kakarot/instructions/system_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,9 @@ namespace SystemOperations {
State.update_account(target_account);

let transfer = model.Transfer(evm.message.address, target_account.address, [value]);
let success = State.add_transfer(transfer);
if (success == 0) {
Stack.push_uint128(0);
return child_evm;
}

// @dev: This transfer cannot fail, as the balance was checked before.
let _success = State.add_transfer(transfer);

return child_evm;
}
Expand Down

0 comments on commit 36f8cdc

Please sign in to comment.