Omniscia Alliance Block Audit
RouterFacet Manual Review Findings
RouterFacet Manual Review Findings
RFT-01M: Inexplicable Functionality
| Type | Severity | Location |
|---|---|---|
| Logical Fault | Minor | RouterFacet.sol:L43-L48 |
Description:
The else branch of the initRouter function does not construct a wrapper implementation yet utilizes the input _albtToken as such.
Example:
contracts/facets/RouterFacet.sol
36if(_chainId != 1) {37 WrappedToken wrappedAlbt = new WrappedToken("Wrapped AllianceBlock Token", "WALBT", 18);38 rs.albtToken = address(wrappedAlbt);39 rs.nativeToWrappedToken[1][nativeAlbt] = rs.albtToken;40 rs.wrappedToNativeToken[rs.albtToken].chainId = 1;41 rs.wrappedToNativeToken[rs.albtToken].token = nativeAlbt;42 emit WrappedTokenDeployed(1, nativeAlbt, rs.albtToken);43} else {44 rs.albtToken = _albtToken;45 rs.nativeToWrappedToken[1][nativeAlbt] = rs.albtToken;46 rs.wrappedToNativeToken[rs.albtToken].chainId = 1;47 rs.wrappedToNativeToken[rs.albtToken].token = nativeAlbt;48}Recommendation:
We strongly recommend additional documentation to be provided for the linked statements as they appear incorrect.
Alleviation:
The else branch was adjusted to not update the nativeToWrapped and wrappedToNative prefixed mappings as they were considered redundant, making the else branch more legible. We still recommend comments to be added surrounding the if clause however to ensure proper validation of its intended purpose by its readers.