Skip to content

Commit

Permalink
Merge pull request #2 from GenerationSoftware/audit-issue-2
Browse files Browse the repository at this point in the history
exclude second that verification ends at
  • Loading branch information
trmid authored Oct 21, 2024
2 parents 025e5e9 + c3a1e94 commit db4ad38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/WorldIdVerifiedPrizeVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ contract WorldIdVerifiedPrizeVault is Ownable, ERC4626, Claimable {
/// @inheritdoc ERC4626
/// @dev limited by the per-account limiter and world ID verification
function maxDeposit(address _receiver) public view override returns (uint256) {
if (worldIdAddressBook.addressVerifiedUntil(_receiver) < block.timestamp) {
if (worldIdAddressBook.addressVerifiedUntil(_receiver) <= block.timestamp) {
return 0;
} else {
uint256 _receiverBalance = balanceOf(_receiver);
Expand Down
4 changes: 2 additions & 2 deletions test/WorldIdVerifiedPrizeVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ contract WorldIdVerifiedPrizeVaultTest is Test {
prizeToken.approve(address(worldVault), 100e18);
worldVault.deposit(1e18, alice);

vm.warp(worldIdAddressBook.addressVerifiedUntil(alice) + 1);
vm.warp(worldIdAddressBook.addressVerifiedUntil(alice));

// alice cannot make new deposits or mints
vm.expectRevert(
Expand All @@ -381,7 +381,7 @@ contract WorldIdVerifiedPrizeVaultTest is Test {

// others cannot transfer shares to alice
vm.startPrank(bob);
worldIdAddressBook.setAccountVerification(block.timestamp);
worldIdAddressBook.setAccountVerification(block.timestamp + 1);
prizeToken.mint(bob, 100e18);
prizeToken.approve(address(worldVault), 100e18);
worldVault.deposit(1e18, bob);
Expand Down
2 changes: 1 addition & 1 deletion test/WorldIdVerifiedPrizeVaultInvariant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract PrizeVaultInvariant is Test {
function invariantCantDepositMoreThanMax() external useCurrentTime {
address alice = vaultHarness.alice();
WorldIdVerifiedPrizeVaultWrapper worldVault = vaultHarness.worldVault();
if (vaultHarness.worldIdAddressBook().addressVerifiedUntil(alice) >= block.timestamp) {
if (vaultHarness.worldIdAddressBook().addressVerifiedUntil(alice) > block.timestamp) {
uint256 balance = worldVault.balanceOf(alice);
uint256 maxDepositLimit = worldVault.accountDepositLimit();
if (balance >= maxDepositLimit) {
Expand Down

0 comments on commit db4ad38

Please sign in to comment.