Use fixed compiler versions instead of floating version
Events Not Emitted for Important State Changes
Event is Missing Indexed Fields
Low Risk Issues
Missing Zero Address Check
Issue
I recommend adding check of 0-address for input validation of critical address parameters.
Not doing so might lead to non-functional contract and have to redeploy the contract, when it is updated to 0-address accidentally.
For functions other than constructor(), lack of 0-address check might cause loss of funds for the user.
I suggest to lock your pragma and aviod using floating pragma.
// bad
pragma solidity ^0.8.10;
// good
pragma solidity 0.8.10;
Events Not Emitted for Important State Changes
Issue
It is best practice to emit an event when we there is important state changes like update a
dynamic array or mapping because it allows monitoring activities with off-chain monitoring tools.
Table of Contents
Low Risk Issues
Non-critical Issues
Low Risk Issues
Missing Zero Address Check
Issue
I recommend adding check of 0-address for input validation of critical address parameters. Not doing so might lead to non-functional contract and have to redeploy the contract, when it is updated to 0-address accidentally. For functions other than constructor(), lack of 0-address check might cause loss of funds for the user.
PoC
Total of 9 instances found.
ERC20PermitPermissionedMint.sol:constructor(): "timelock_address" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/ERC20/ERC20PermitPermissionedMint.sol#L34
OperatorRegistry.sol:constructor(): "timelock_address" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/OperatorRegistry.sol#L41
frxETHMinter.sol:constructor(): "depositContract" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L60
frxETHMinter.sol:constructor(): "frxETHAddress" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L61
frxETHMinter.sol:constructor(): "sfrxETHToken" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L62
frxETHMinter.sol:submitAndDeposit(): "recipient" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L70
frxETHMinter.sol:moveWithheldETH(): "to" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L170
sfrxETH.sol:depositWithSignature(): "receiver" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/sfrxETH.sol#L70
sfrxETH.sol:mintWithSignature(): "receiver" address https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/sfrxETH.sol#L86
Mitigation
Add 0-address check for above addresses.
Non-critical Issues
Use fixed compiler versions instead of floating version
Issue
it is best practice to lock your pragma instead of using floating pragma. the use of floating pragma has a risk of accidentally get deployed using latest complier which may have higher risk of undiscovered bugs. Reference: https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/
PoC
Total of 6 instances found.
Mitigation
I suggest to lock your pragma and aviod using floating pragma.
Events Not Emitted for Important State Changes
Issue
It is best practice to emit an event when we there is important state changes like update a dynamic array or mapping because it allows monitoring activities with off-chain monitoring tools.
PoC
Total of 1 instance found.
Mitigation
Emit an event when there is important state changes.
Event is Missing Indexed Fields
Issue
Each event should have 3 indexed fields if there are 3 or more fields.
PoC
Total of 19 instances found.
Mitigation
Add up to 3 indexed fields when possible.