Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

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

Open
devstein opened this issue Feb 13, 2022 · 2 comments

Comments

@devstein
Copy link

devstein commented Feb 13, 2022

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 devstein changed the title Discrepancy Between OpenSea Creature and Polygon Documentation Discrepancy Between OpenSea Creature's Code and Polygon Documentation: Which is Correct? Feb 13, 2022
@devstein devstein changed the title Discrepancy Between OpenSea Creature's Code and Polygon Documentation: Which is Correct? Discrepancy Between OpenSea Creature's Code and OpenSea Polygon Documentation: Which is Correct? Feb 13, 2022
@FantasyGameFoundation
Copy link

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

@stpoa
Copy link

stpoa commented May 20, 2022

@FantasyGameFoundation Hi have you solved the problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants