opensea-creatures icon indicating copy to clipboard operation
opensea-creatures copied to clipboard

Discrepancy Between OpenSea Creature's Code and OpenSea Polygon Documentation: Which is Correct?

Open devstein opened this issue 3 years ago • 2 comments

Hi 👋 I'm working on an ERC-721 NFT and want to auto-approve OS's proxy contract, but there are discrepancies between the documentation and this repo. Which code is correct? See below. Thank you!

From Polygon integration docs

/**
   * Override isApprovedForAll to auto-approve OS's proxy contract
   */
    function isApprovedForAll(
        address _owner,
        address _operator
    ) public override view returns (bool isOperator) {
      // if OpenSea's ERC721 Proxy Address is detected, auto-return true
        if (_operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) {
            return true;
        }
        
        // otherwise, use the default ERC721.isApprovedForAll()
        return ERC721.isApprovedForAll(_owner, _operator);
    }

From this repo's code

    /**
     * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings.
     */
    function isApprovedForAll(address owner, address operator)
        override
        public
        view
        returns (bool)
    {
        // Whitelist OpenSea proxy contract for easy trading.
        ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
        if (address(proxyRegistry.proxies(owner)) == operator) {
            return true;
        }

        return super.isApprovedForAll(owner, operator);
    }

Which approach is correct?

        if (_operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) {
        ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
        if (address(proxyRegistry.proxies(owner)) == operator) {

devstein avatar Feb 13 '22 14:02 devstein

I also have the same question, and whenever I add proxy judgment logic, the factory contract cannot take effect, nor can mint

FantasyGameFoundation avatar Feb 21 '22 12:02 FantasyGameFoundation

@FantasyGameFoundation Hi have you solved the problem?

stpoa avatar May 20 '22 06:05 stpoa