Skip to content

Commit

Permalink
Merge pull request #54 from semiotic-ai/36-l-02-unnecessary-event-emi…
Browse files Browse the repository at this point in the history
…ssion

fix(escrow-contract): add requirement for thaw request amount to be g…
  • Loading branch information
ColePBryan authored Aug 18, 2023
2 parents beb6f9e + 4213755 commit 4675520
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ contract Escrow {
// Custom error to indicate insufficient escrow balance
error InsufficientEscrow(uint256 available, uint256 required);

// Custom error to indicate insufficient thaw amount (must be greater than 0)
error InsufficientThawAmount();

// Custom error to indicate escrow is still thawing
error EscrowStillThawing(
uint256 currentTimestamp,
Expand Down Expand Up @@ -205,6 +208,9 @@ contract Escrow {
* not have enough escrow (greater than `amount`)
*/
function thaw(address receiver, uint256 amount) external {
if(amount <= 0) {
revert InsufficientThawAmount();
}
EscrowAccount storage account = escrowAccounts[msg.sender][
receiver
];
Expand Down

0 comments on commit 4675520

Please sign in to comment.