Skip to content

Commit

Permalink
feat: include msg.sender in create2 salt
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Jun 18, 2024
1 parent f940d22 commit fa7eb77
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SablierV2MerkleLockupFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ contract SablierV2MerkleLockupFactory is ISablierV2MerkleLockupFactory {
// Hash the parameters to generate a salt.
bytes32 salt = keccak256(
abi.encodePacked(
msg.sender,
baseParams.asset,
baseParams.cancelable,
baseParams.expiration,
Expand Down Expand Up @@ -76,6 +77,7 @@ contract SablierV2MerkleLockupFactory is ISablierV2MerkleLockupFactory {
// Hash the parameters to generate a salt.
bytes32 salt = keccak256(
abi.encodePacked(
msg.sender,
baseParams.asset,
baseParams.cancelable,
baseParams.expiration,
Expand Down
2 changes: 2 additions & 0 deletions test/Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ abstract contract Base_Test is
{
bytes32 salt = keccak256(
abi.encodePacked(
users.alice,
address(asset_),
defaults.CANCELABLE(),
expiration,
Expand Down Expand Up @@ -330,6 +331,7 @@ abstract contract Base_Test is
{
bytes32 salt = keccak256(
abi.encodePacked(
users.alice,
address(asset_),
defaults.CANCELABLE(),
expiration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { MerkleLockup_Integration_Test } from "../../MerkleLockup.t.sol";
contract CreateMerkleLL_Integration_Test is MerkleLockup_Integration_Test {
function setUp() public override {
MerkleLockup_Integration_Test.setUp();

// Make alice the caller of createMerkleLT.
resetPrank(users.alice);
}

function test_RevertWhen_CampaignNameTooLong() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { MerkleLockup_Integration_Test } from "../../MerkleLockup.t.sol";
contract CreateMerkleLT_Integration_Test is MerkleLockup_Integration_Test {
function setUp() public override {
MerkleLockup_Integration_Test.setUp();

// Make alice the caller of createMerkleLT.
resetPrank(users.alice);
}

function test_RevertWhen_CampaignNameTooLong() external {
Expand Down

0 comments on commit fa7eb77

Please sign in to comment.