Skip to content

Latest commit

 

History

History
156 lines (92 loc) · 8.73 KB

0x1f8b-Q.md

File metadata and controls

156 lines (92 loc) · 8.73 KB

Low

1. Outdated packages

Some used packages are out of date, it is good practice to use the latest version of these packages:

"@openzeppelin/contracts": "4.6.0",
"@openzeppelin/contracts-upgradeable": "4.6.0",

Reference:

Affected source code:

2. Integer overflow by unsafe casting

Keep in mind that the version of solidity used, despite being greater than 0.8, does not prevent integer overflows during casting, it only does so in mathematical operations.

It is necessary to safely convert between the different numeric types.

Recommendation:

Use a safeCast from Open Zeppelin.

        checkpoint.votes = uint192(_newTotalVotes);

Affected source code:

3. Lack of checks supportsInterface

The EIP-165 standard helps detect that a smart contract implements the expected logic, prevents human error when configuring smart contract bindings, so it is recommended to check that the received argument is a contract and supports the expected interface.

Reference:

Affected source code:


Non critical

4. Avoid hardcoded values

It is not good practice to hardcode values, but if you are dealing with addresses much less, these can change between implementations, networks or projects, so it is convenient to remove these values from the source code.

Affected source code:

5. Open TODO

The code that contains "open todos" reflects that the development is not finished and that the code can change a posteriori, prior release, with or without audit.

Affected source code:

// TODO: estimVerifier.sol#L132ate gas for L1 execute

// TODO: Restore after stable priority op fee modeling. (SMA-1230)

// TODO: Restore after fee modeling will be stable. (SMA-1230)

// TODO: The verifier integration is not finished yet, change the structure for compatibility later

// TODO:

// TODO: change constant to the real root hash of empty Merkle tree (SMA-184)

// require(serialized_proof.length == 44); TODO

// TODO: not use array while there is only D_next

// TODO:

// require(vk.num_inputs > 0); // TODO

// TODO we may use batched lagrange compputation

// TODO add one into non-residues during codegen?

// TODO

6. Use abstract for base contracts

abstract contracts are contracts that have at least one function without its implementation. An instance of an abstract cannot be created.

Reference:

Affected source code: