Omniscia Avant Protocol Audit
AvUSD Code Style Findings
AvUSD Code Style Findings
AUS-01C: Generic Typographic Mistake
Type | Severity | Location |
---|---|---|
Code Style | AvUSD.sol:L35 |
Description:
The referenced line contains a typographical mistake (i.e. private
variable without an underscore prefix) or generic documentational error (i.e. copy-paste) that should be corrected.
Example:
35revert CantRenounceOwnership();
Recommendation:
We advise this to be done so to enhance the legibility of the codebase.
Alleviation:
The misspelled error
declaration has been corrected addressing this exhibit.
AUS-02C: Inefficient Ownership Transfer
Type | Severity | Location |
---|---|---|
Code Style | AvUSD.sol:L21 |
Description:
The referenced statement will invoke the Ownable2Step::_transferOwnership
function which will inefficiently clean up the _pendingOwner
data entry.
Example:
16contract AvUSD is Ownable2Step, ERC20Burnable, ERC20Permit, IAvUSDDefinitions {17 address public minter;18
19 constructor(address admin) ERC20("avUSD", "avUSD") ERC20Permit("avUSD") {20 if (admin == address(0)) revert ZeroAddressException();21 _transferOwnership(admin);22 }
Recommendation:
We advise the Ownable::_transferOwnership
function to be invoked directly, optimizing the contract's construction gas cost.
Alleviation:
The redundant ownership transfer statement has been omitted, optimizing the code's gas cost.
AUS-03C: Non-Standard Order of Arguments
Type | Severity | Location |
---|---|---|
Code Style | AvUSD.sol:L25 |
Description:
The event arguments are ordered in a non-standard way, emitting the "new" value in the first index and the "old" value in the second index.
Example:
25emit MinterUpdated(newMinter, minter);
Recommendation:
We advise their order to be reversed in both the event's declaration and its usage in the AvUSD::setMinter
function, increasing the standardization of the Avant Protocol codebase.
Alleviation:
The order of the event
arguments has been corrected in both its emission as well as declaration within the IAvUSDDefinitions
file, addressing this exhibit.