Omniscia Nori Audit
LockedNORI Code Style Findings
LockedNORI Code Style Findings
LNO-01C: Deprecated Function Invocation
Type | Severity | Location |
---|---|---|
Standard Conformity | ![]() | LockedNORI.sol:L386-L388 |
Description:
The _setupRole
function has been officially deprecated by OpenZeppelin.
Example:
contracts/LockedNORI.sol
386_setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); // todo why doesnt grantRole work387_setupRole(TOKEN_GRANTER_ROLE, _msgSender()); // todo why doesnt grantRole work388_setupRole(PAUSER_ROLE, _msgSender()); // todo why doesnt grantRole work
Recommendation:
We advise the _grantRole
function to be utilized directly.
Alleviation:
The _grantRole
function is now utilized instead in the contract thereby alleviating this exhibit.
LNO-02C: Redundant Interface Declaration
Type | Severity | Location |
---|---|---|
Code Style | ![]() | LockedNORI.sol:L366, L378-L380 |
Description:
The input argument of the initialize
function is declared as IERC777Upgradeable
yet is re-cast internally.
Example:
contracts/LockedNORI.sol
365// todo document expected initialzation state366function initialize(IERC777Upgradeable bridgedPolygonNoriAddress)367 public368 initializer369{370 address[] memory operators = new address[](1);371 operators[0] = _msgSender();372 __Context_init_unchained();373 __ERC165_init_unchained();374 __AccessControl_init_unchained();375 __AccessControlEnumerable_init_unchained();376 __Pausable_init_unchained();377 __ERC777_init_unchained("Locked BridgedPolygonNORI", "lNORI", operators);378 _bridgedPolygonNori = BridgedPolygonNORI(379 address(bridgedPolygonNoriAddress)380 );381 _ERC1820_REGISTRY.setInterfaceImplementer(382 address(this),383 ERC777_TOKENS_RECIPIENT_HASH,384 address(this)385 );386 _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); // todo why doesnt grantRole work387 _setupRole(TOKEN_GRANTER_ROLE, _msgSender()); // todo why doesnt grantRole work388 _setupRole(PAUSER_ROLE, _msgSender()); // todo why doesnt grantRole work389}
Recommendation:
We advise it to be set as the final interface type directly.
Alleviation:
The input argument has its type now optimally declared.