Skip to content
New issue

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

QA Report #391

Open
code423n4 opened this issue Sep 25, 2022 · 0 comments
Open

QA Report #391

code423n4 opened this issue Sep 25, 2022 · 0 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

code423n4 commented Sep 25, 2022

1. Address(0) check in submitAndGive() in frxETHMinter.sol

In https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L109

submitAndGive() expects recipient address. It is a good practice to check for address(0) to protect from unnecessary complications.
Consider adding require(recipient != address(0));

2. Withheld ratio can be set to 100%

In https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L159

In the setWithholdRatio function, the withhold ratio can be set to 100%, When the ratio is 100%, if someone makes a very large ETH deposit then the entirity of the ETH will be added to currentWithheldETH and non will be added for validators.

It is recommended to set the withHeld ratio is limited to some reasonable amount rather than 100%.

3. Public Constants are not necessary

In https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L38-L39

Some constants used for internal calculation are made public. It is recommended to set them to private since they dont need to be exposed through public funcitons. This also increases codesize.

4. The minters_array will contain more elements than the number of minters

in https://github.com/code-423n4/2022-09-frax/blob/main/src/ERC20/ERC20PermitPermissionedMint.sol#L86

When calling removeMinter, the minter is not removed from minters_array, instead it is replaced by zero address. this will cause the array to grow very large as more minters are added and removed.

5. Operation on an unbounded loop

In https://github.com/code-423n4/2022-09-frax/blob/main/src/OperatorRegistry.sol#L61

It is generally recommended to put a reasonable limit on the loop size rather than having unbounded loop as argument on a function.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Sep 25, 2022
code423n4 added a commit that referenced this issue Sep 25, 2022
code423n4 added a commit that referenced this issue Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

1 participant