Platform: Code4rena
Start Date: 19/04/2022
Pot Size: $30,000 USDC
Total HM: 10
Participants: 43
Period: 3 days
Judges: moose-code, JasoonS
Total Solo HM: 7
Id: 90
League: ETH
Rank: 31/43
Findings: 1
Award: $62.99
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0xDjango, 0xkatana, Dravee, Kenshin, Tadashi, TerrierLover, abhinavmir, defsec, ellahi, fatima_naz, foobar, gzeon, hyh, joestakey, kebabsec, kenta, minhquanym, oyc_109, rayn, robee, sseefried, xpriment626, z3s
62.9884 USDC - $62.99
A test suite would have been very useful. A comprehensive test suite has two major benefits:
In general, it was quite hard to work out how all these contracts were used together in practice. Tests would have aided my understanding. Failing that, a worked example of just which functions were called in each contract would have been useful. The documentation provided here was imprecise. A more precise example of what would have been useful appears below. (Be aware, I don't know if this is correct. It's just an example to give a flavour of the level of precision that would be useful)
IndexLogic
contract.mint
function passing their address as _recipient
parameter.A weight between 0 and 255 is too low precision in order to guarantee that the weights in an index always add up to 255. This can lead to incorrect calculations of the value/price of the index.
Consider the following scenario:
Then we would get weights:
(1 * 255) / 10000 = 0
(9999 * 255) / 1000 = 254
These do not add up to 255
Manual inspection
Use a value larger than uint8
to represent weights. There is little reason to restrict oneself to a small integer. Also, consider using a fractional value instead.