Skip to content

Commit

Permalink
Merge pull request #90 from 1inch/audits/SC-1218-Apply-audit-suggestions
Browse files Browse the repository at this point in the history
Apply Consensys audit suggestions
  • Loading branch information
byshape authored Jul 31, 2024
2 parents 4374c1f + 1e24f9a commit ef47c45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/integration/MerkleStorageInvalidator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contract MerkleStorageInvalidatorIntTest is BaseSetup {
BaseSetup.setUp();

for (uint256 i = 0; i < SECRETS_AMOUNT; i++) {
// Note: This is not production-ready code. Use cryptographically secure random to generate secrets.
hashedSecrets[i] = keccak256(abi.encodePacked(i));
hashedPairs[i] = keccak256(abi.encodePacked(i, hashedSecrets[i]));
}
Expand Down
1 change: 1 addition & 0 deletions test/unit/EscrowFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ contract EscrowFactoryTest is BaseSetup {
function setUp() public virtual override {
BaseSetup.setUp();

// Note: This is not production-ready code. Use cryptographically secure random to generate secrets.
for (uint256 i = 0; i < SECRETS_AMOUNT; i++) {
hashedSecrets[i] = keccak256(abi.encodePacked(i));
hashedPairs[i] = keccak256(abi.encodePacked(i, hashedSecrets[i]));
Expand Down
2 changes: 2 additions & 0 deletions test/unit/MerkleStorageInvalidator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ contract MerkleStorageInvalidatorTest is BaseSetup {
bytes32[] memory hashedSecrets = new bytes32[](secretsAmount);
bytes32[] memory hashedPairs = new bytes32[](secretsAmount);

// Note: This is not production-ready code. Use cryptographically secure random to generate secrets.
for (uint256 i = 0; i < secretsAmount; i++) {
hashedSecrets[i] = keccak256(abi.encodePacked(i));
hashedPairs[i] = keccak256(abi.encodePacked(i, hashedSecrets[i]));
Expand Down Expand Up @@ -62,6 +63,7 @@ contract MerkleStorageInvalidatorTest is BaseSetup {
bytes32[] memory hashedSecrets = new bytes32[](secretsAmount);
bytes32[] memory hashedPairs = new bytes32[](secretsAmount);

// Note: This is not production-ready code. Use cryptographically secure random to generate secrets.
for (uint256 i = 0; i < secretsAmount; i++) {
hashedSecrets[i] = keccak256(abi.encodePacked(i));
hashedPairs[i] = keccak256(abi.encodePacked(i, hashedSecrets[i]));
Expand Down

0 comments on commit ef47c45

Please sign in to comment.