code-423n4 / 2022-05-backd-findings

0 stars 0 forks source link

QA Report #149

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

No check on address zero can cause logic errors and lost of funds https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/tokenomics/InflationManager.sol#L221 https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/tokenomics/InflationManager.sol#L221 https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/zaps/PoolMigrationZap.sol#L52

Add more comments on burnFees function and natspec comments https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/RewardHandler.sol#L35

Very hard to read code and its very packed together.its so compacted that my vscode visual extension cant read if its state or memory variable https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/RewardHandler.sol#L36-L48 —-------------------------------------- if (IERC20(token).allowance(address(this), spender) > 0) return; IERC20(token).safeApprove(spender, type(uint256).max); Just space it out to make it more readable https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/RewardHandler.sol#L63

https://github.com/code-423n4/2022-05-backd/blob/8121e5244ca29f87b0763d05a69e7fc654d14f45/protocol/contracts/zaps/PoolMigrationZap.sol#L52-L66 if allowance is more then zero then it will return nothing and first return something to help a function that calls this function if this allowance is more than zero it will return nothing and it you cant approve anything its dead code

GalloDaSballo commented 2 years ago

Agree with observation about address 0 and adding comments. Rest is opinion, and in lack of a suggested refactoring this is a low quality submission