From ef629bcb5b14bf55129097ebc4ae32cf99fba4a8 Mon Sep 17 00:00:00 2001 From: 0xchin Date: Tue, 26 Nov 2024 11:30:29 -0300 Subject: [PATCH] fix: ensure one time address == precomputed address --- src/contracts/Grateful.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/contracts/Grateful.sol b/src/contracts/Grateful.sol index b488c35..6114a97 100644 --- a/src/contracts/Grateful.sol +++ b/src/contracts/Grateful.sol @@ -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); }