PoolTogether Aave v3 contest - peritoflores's results

A protocol for no loss prize savings on Ethereum.

General Information

Platform: Code4rena

Start Date: 29/04/2022

Pot Size: $22,000 USDC

Total HM: 6

Participants: 40

Period: 3 days

Judge: Justin Goro

Total Solo HM: 2

Id: 114

League: ETH

PoolTogether

Findings Distribution

Researcher Performance

Rank: 37/40

Findings: 1

Award: $28.35

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

28.3489 USDC - $28.35

Labels

bug
G (Gas Optimization)

External Links

Gas Optimization for PoolTogether Apr-2022 by PeritoFlores

[G-01] Remove OZ SafeMath library to save gas

As you are using the version 0.8 of solidity compiler there is no need to use OZ SafeMath library.

The built-in checks of overflow/underflow in the compiler is much cheaper.

Sample issue

https://issueantenna.com/repo/code-423n4/2022-01-insure-findings/issues/38

Make the following changes

#L14

[-] import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol";

#L26

[-] using SafeMath for uint256;

#L262

[-] uint256 _balanceDiff = _afterBalance.sub(_beforeBalance); [+] uint256 _balanceDiff = _afterBalance-_beforeBalance;

#L361

[-] return _supply == 0 ? _tokens : _tokens.mul(_supply).div(aToken.balanceOf(address(this))); [+] return _supply == 0 ? _tokens : _tokens*_supply/aToken.balanceOf(address(this));

#L373

[-] return _supply == 0 ? _shares : _shares.mul(aToken.balanceOf(address(this))).div(_supply); [+] return _supply == 0 ? _shares : _shares*(aToken.balanceOf(address(this))/_supply;

#0 - PierrickGT

2022-05-04T19:46:20Z

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter