Skip to content

Commit

Permalink
fix: ensure one time address == precomputed address
Browse files Browse the repository at this point in the history
  • Loading branch information
0xChin committed Nov 26, 2024
1 parent f40c1f6 commit ef629bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/contracts/Grateful.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ contract Grateful is IGrateful, Ownable2Step, ReentrancyGuard {
oneTimePayments[_precomputed] = true;
oneTime =
new OneTime{salt: bytes32(_salt)}(IGrateful(address(this)), _tokens, _merchant, _amount, _paymentId, _yieldFunds);

if (address(oneTime) != _precomputed) {
revert Grateful_PrecomputedAddressMismatch();
}

emit OneTimePaymentCreated(_merchant, _tokens, _amount);
}

Expand Down

0 comments on commit ef629bc

Please sign in to comment.