Omniscia 0xPhase Audit
ICreditAccount Code Style Findings
ICreditAccount Code Style Findings
ICA-01C: Multiple Top-Level Declarations
Type | Severity | Location |
---|---|---|
Code Style | ICreditAccount.sol:L14, L35 |
Description:
The referenced file contains multiple top-level declarations that decrease the legibility of the codebase.
Example:
account/ICreditAccount.sol
14interface ICreditAccount {15 /// @notice Event emitted when a credit account is created16 /// @param creator The account that created the credit account17 /// @param tokenId The id of the created account18 event CreditAccountCreated(address indexed creator, uint256 tokenId);19
20 /// @notice Gets or creates the user's account21 /// @param owner The owner address22 /// @return tokenId The id of the account23 function getAccount(address owner) external returns (uint256 tokenId);24
25 /// @notice Gets the user's account or returns 0 if no account present26 /// @param owner The owner address27 /// @return tokenId The id of the account28 function viewAccount(address owner) external view returns (uint256 tokenId);29
30 /// @notice Returns the next token index31 /// @return The next token index32 function index() external view returns (uint256);33}34
35abstract contract CreditAccountStorageV1 is
Recommendation:
We advise all highlighted top-level declarations to be split into their respective code files, avoiding unnecessary imports as well as increasing the legibility of the codebase.
Alleviation (3dd3d7bf0c2693b2f9c23bacedfa420393f7ea84):
The CreditAccountStorageV1
implementation was relocated to its dedicated file per our recommendation, optimizing the code's maintainability.