wearable-contracts
v0.0.1-rc7
Published
Decentraland wereable contracts
Downloads
2
Readme
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.