Content
@
0 reply
0 recast
0 reaction
Damian
@drdr
Rounding errors are taking the 2nd place in DeFi Attack Vectors. Three easy things to do: 1⃣ for simple formulas make sure that you select correct rounding direction (profitable for the protocol),
1 reply
0 recast
0 reaction
Damian
@drdr
2⃣ for complex formulas use `roundme` tool to know the rounding direction for all operations: github.com/crytic/roundme, 3⃣ don't forget edge cases (e.g. require that both values - redeemToken and assetToken - are greater than 0).
0 reply
0 recast
0 reaction