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:
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:
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:
- L2ERC20Bridge.sol:36
- L1ERC20Bridge.sol:59
- L1ERC20Bridge.sol:79
- L2ETHBridge.sol:31
- L1EthBridge.sol:49-50
- Governance.sol:97
- DiamondInit.sol:55
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:
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
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: