seen-haus / seen-contracts

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

ITR-01C: Improper Initialization #25

Closed JayWelsh closed 2 years ago

JayWelsh commented 2 years ago

ITR-01C: Improper Initialization

Type Severity Location
Standard Conformity Informational ItemsTicketer.sol:L46

Description:

The ERC1155Upgradeable contract is initialized with its unchained counterpart.

Example:

contract ItemsTicketer is StringUtils, IEscrowTicketer, MarketClientBase, ERC1155Upgradeable {

    // Ticket ID => Ticket
    mapping (uint256 => EscrowTicket) internal tickets;

    // Consignment ID => Ticket Claimable Count (does not change after ticket burns)
    mapping (uint256 => uint256) internal consignmentIdToTicketClaimableCount;

    /// @dev Next ticket number
    uint256 internal nextTicket;

    /**
     * @notice Initializer
     */
    function initialize()
    public {
        __ERC1155_init_unchained(ESCROW_TICKET_URI);
    }

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 as part of https://github.com/seen-haus/seen-contracts/issues/30

JayWelsh commented 2 years ago

Relevant PR: https://github.com/seen-haus/seen-contracts/pull/35