-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from gildlab/15-10-2024-add-assume-to-avoid-k…
…ey-collisions Add missing vm.assume(alice != bob) to testMintSomeoneElse
- Loading branch information
Showing
21 changed files
with
334 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-License-Identifier: CAL | ||
pragma solidity =0.8.25; | ||
|
||
import {Vm} from "forge-std/Test.sol"; | ||
|
||
library LibUniqueAddressesGenerator { | ||
// Generates two unique addresses from the provided fuzzed keys | ||
function generateUniqueAddresses(Vm vm, uint256 SECP256K1_ORDER, uint256 fuzzedKeyAlice, uint256 fuzzedKeyBob) | ||
internal | ||
pure | ||
returns (address, address) | ||
{ | ||
// Ensure the fuzzed key is within the valid range for secp256k1 | ||
address alice = vm.addr((fuzzedKeyAlice % (SECP256K1_ORDER - 1)) + 1); | ||
address bob = vm.addr((fuzzedKeyBob % (SECP256K1_ORDER - 1)) + 1); | ||
vm.assume(alice != bob); | ||
|
||
return (alice, bob); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.