code-423n4 / 2021-09-sushitrident-findings

0 stars 0 forks source link

Docs disagrees with index pool code #184

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

tensors

Vulnerability details

The competition docs state that index pools should have equal weights for all tokens:

"So, if the pool creator makes a pool of four tokens, each token will have 25% of the pool; five tokens, each token will have 20% of the pool; and so on. "

but the actual code is more general than that, allowing arbitrary combinations of weights:

https://github.com/sushiswap/trident/blob/7098ef9ad97fa11d350a15d97740e97ad2ca4649/contracts/pool/IndexPool.sol#L62

I recommend a brief fix to the documentation.

maxsam4 commented 3 years ago

Apparently the competition docs for IndexPool are completely wrong. Apologies.

The code is right though.

alcueca commented 3 years ago

Wrong documentation is a Sev 1, I don't make the rules :man_shrugging: