Add entropy to MerkleLockup CREATE2 salt #311
Replies: 3 comments 1 reply
-
I'm quite curious to hear pros/cons on if this would defeat (somewhat) the purpose of CREATE2 being easier to reproduce/deploy deterministically. |
Beta Was this translation helpful? Give feedback.
-
I suggest taking a practical approach and treating this as a problem that can be solved off-chain. On-chain storage should be reserved for critical features and security requirements. The UI could detect if two campaigns are identical and employ one of the following techniques:
It is also worth noting that:
|
Beta Was this translation helpful? Give feedback.
-
I'm closing this discussion now on the basis of the rationale shared above, but this should definitely be mentioned as a protocol assumption in |
Beta Was this translation helpful? Give feedback.
-
Currently in v2.2, the following parameters are used to generate salt:
Despite
name
andipfsCID
being considered to be unique for each campaign, it does not eliminate the case when all the details could be the same for two distinct campaigns. As an example, a third-party integrator can choose to use the samename
for all the campaigns created through them.A potential solution is to include a
nonce
in the salt that gets auto-incremented for new deployments (similar to how gnosis safe works). It will require adding one storage in theSablierV2MerkleLockupFactory
mapped against the caller address.Another solution is to include
block.timestamp
in the salt generation. It reduces the likelihood of collision but still doesn't rectify it completely as two campaigns can still be included in the same block.Should we pursue this in the future or the cost of developing this could be higher than the likelihood of this collision? cc @sablier-labs/engineers
Related:
Beta Was this translation helpful? Give feedback.
All reactions