lindy-labs / opus_contracts

Opus Source Code
https://opus.money
Other
0 stars 0 forks source link

fix: duplicate address in allocation #535

Closed tserg closed 8 months ago

tserg commented 9 months ago

Instead of preventing duplicate addresses (user error), I think it is sufficient to ensure that the percentage value is not overwritten (which affects correctness).

Resolves https://github.com/code-423n4/2024-01-opus-findings/issues/122

milancermak commented 9 months ago

IMO this suggested fix goes against the expected use of the function and the Allocator's functionality. In the test case, new recipient 1's allocation will be 41.115 but that's not obvious and probably not intended. An error like that can easily sneak in via a copy-paste mistake when preparing a update script.

If we're going to fix it, I'd rather prevent this address duplication issue.