We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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;
The text was updated successfully, but these errors were encountered:
peritoflores issue #92
82a06ca
Duplicate of #11
Sorry, something went wrong.
PierrickGT
No branches or pull requests
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
Recommended
Make the following changes
#L14
#L26
#L262
#L361
#L373
The text was updated successfully, but these errors were encountered: