seen-haus / seen-contracts

Seen Haus contract suite
GNU General Public License v3.0
8 stars 2 forks source link

SHN-01C: Improper Initialization #30

Closed JayWelsh closed 2 years ago

JayWelsh commented 2 years ago

SHN-01C: Improper Initialization

Type Severity Location
Standard Conformity Informational SeenHausNFT.sol:L42

Description:

The ERC1155Upgradeable contract is initialized with its unchained counterpart.

Example:

contract SeenHausNFT is ISeenHausNFT, MarketClientBase, ERC1155Upgradeable {

    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @dev token id => Token struct
    mapping (uint256 => Token) internal tokens;

    // Next token number
    uint256 internal nextToken;

    /**
     * @notice Initializer
     */
    function initialize(address _initOwner)
    public {
        __ERC1155_init_unchained("");
        _transferOwnership(_initOwner);
    }

Recommendation:

We advise the normal counterpart to be initialized instead. While it bears no effect as the dependencies of ERC1155Upgradeable have no logic in their initializers, its still more standardized to do it this way.

JayWelsh commented 2 years ago

Resolved by https://github.com/seen-haus/seen-contracts/pull/35