code-423n4 / 2021-11-streaming-findings

0 stars 0 forks source link

`* 10 / 10000` can be simpler and save some gas #261

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L711-L711

uint112 feeAmt = amount * 10 / 10000; // 10bps fee

Recommendation

Change to:

uint112 feeAmt = amount / 1000; // 10bps fee
0xean commented 2 years ago

dupe of #188