Platform: Code4rena
Start Date: 17/06/2021
Pot Size: $60,000 USDC
Total HM: 12
Participants: 12
Period: 7 days
Judge: LSDan
Total Solo HM: 8
Id: 14
League: ETH
Rank: 3/12
Findings: 2
Award: $6,263.37
🌟 Selected for report: 2
🚀 Solo Findings: 1
🌟 Selected for report: tensors
5827.0101 USDC - $5,827.01
tensors
Because mantissa calculations are not used in this case to account for decimals, the arithmetic can zero out the number of shares or tokens that should be given.
For example, say I deposit 1 token, expecting 1 share in return. On L95, if the totalunderlying assets is increased to be larger than the number of total shares, then the division would output 0 and I wouldn't get any shares.
Implement mantissa calculations like in the contract for the AAVE yield.
#0 - PierrickGT
2021-07-02T15:13:30Z
135.4239 USDC - $135.42
tensors
Changing the functions in SushiYieldSource.sol to external can save gas.
https://github.com/pooltogether/sushi-pooltogether/blob/master/contracts/SushiYieldSource.sol
Change public
to external
#0 - asselstine
2021-06-24T23:54:11Z
🌟 Selected for report: tensors
300.9419 USDC - $300.94
tensors
##Impact Uninitialized variables initialize to 0 automatically. No need to explicitly initialize it.
##Proof of concept https://github.com/pooltogether/aave-yield-source/blob/bc65c875f62235b7af55ede92231a495ba091a47/contracts/yield-source/ATokenYieldSource.sol#L141
##Recommended mitigation steps
Replace with: uint256 shares;
#0 - PierrickGT
2021-06-28T09:40:36Z