wearable-contracts

0.0.1-rc7 • Public • Published

Set Up a Factory

A factory contract is used to sell wearables at OpenSea. The interface is defined here.

Every optionId is the index of a wearableId in the wearables array of an ERC721Collection

ERC721CollectionFactory.sol

function _wearableByOptionId(uint256 _optionId) internal view returns (string memory){
    /* solium-disable-next-line */
    (bool success, bytes memory data) = address(erc721Collection).staticcall(
        abi.encodeWithSelector(
            erc721Collection.wearables.selector,
            _optionId
        )
    );
 
    require(success, "Invalid wearable");
    return abi.decode(data, (string));
}

OpenSea uses the Wyvern Protocol https://docs.opensea.io/docs/opensea-partners-program. Only one address will be allowed to create option orders. A proxy to this address will be created once the address first interacts with OpenSea.

The contracts for the ProxyRegistry can be seen here. Calling proxies on the Mainnet contract, the user can check if a proxy address was created for her address.

Readme

Keywords

none

Package Sidebar

Install

npm i wearable-contracts

Weekly Downloads

7

Version

0.0.1-rc7

License

ISC

Unpacked Size

893 kB

Total Files

53

Last publish

Collaborators

  • imazzara