Skip to content

Latest commit

 

History

History
40 lines (20 loc) · 1.79 KB

Funen-Q.md

File metadata and controls

40 lines (20 loc) · 1.79 KB
  1. Need to validate the amount of withdraw can't be zero

Need require check if the amount was not zero on fn finalizeDeposit() and fn withdraw() since it was validate if sender can't deposit or withdraw any zero amount

File :

1.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/zksync/contracts/bridge/L2ETHBridge.sol#L41

2.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/zksync/contracts/bridge/L2ETHBridge.sol#L59

3.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/zksync/contracts/bridge/L2ERC20Bridge.sol#L50

4.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/zksync/contracts/bridge/L2ERC20Bridge.sol#L87

  1. Use require rather than assert

The require function should be used to check return values from calls to external contracts or to guarantee that valid conditions, such as inputs or contract state variables, are satisfied.

File : https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/zksync/facets/DiamondCut.sol#L16

  1. Innacurate comment

FIles :

1.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/zksync/DiamondInit.sol#L24

Just only @return bytes32 , doesn't need to say @return Magic bytes32 for better code readibility

  1. Missing comment for reason string

File :

1.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/common/AllowList.sol#L33

//owner can't be zero addresses

2.) https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/common/AllowList.sol#L38

//not owner