opensea-creatures
opensea-creatures copied to clipboard
Discrepancy Between OpenSea Creature's Code and OpenSea Polygon Documentation: Which is Correct?
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!
/**
* 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) {
I also have the same question, and whenever I add proxy judgment logic, the factory contract cannot take effect, nor can mint
@FantasyGameFoundation Hi have you solved the problem?