Omniscia Arcade XYZ Audit
OwnableERC721 Code Style Findings
OwnableERC721 Code Style Findings
OER-01C: Potential Optimization of Project Structure
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | OwnableERC721.sol:L44-L46 |
Description:
The OwnableERC721
contract is meant to be inherited by the AssetVault
implementation which in turn is meant to be deployed once as a template
that the VaultFactory
will utilize.
Example:
20/// @dev The ERC721 token that contract owners should have ownership of.21address public ownershipToken;
Recommendation:
We advise template flow to be revised by having the VaultFactory
deploy an instance of AssetVault
during its VaultFactory::constructor
and assign it in its template
data entry. This will permit the ownershipToken
of OwnableERC721
as well as the whitelist
member of AssetVault
to be set as immutable
, greatly optimizing the gas cost of the contracts across the board.
Any immutable
variable is compatible with proxy systems given that their values are "baked in" the bytecode of the deployed instance. We advise this and the relevant exhibit of AssetVault
to be applied in tandem if the optimizations are ultimately desired.
Alleviation (7a4e1dc948e94ded7385dbb74818bcf93ecc207c):
The Arcade XYZ team evaluated this exhibit and assessed that the flexibility of the VaultFactory
will be greatly diminishing if the immutable
based optimization is applied, a trait that the Arcade XYZ team does not wish to forfeit.
As such, we consider this exhibit safely acknowledged.