library OpenSeaGasFreeListing {
  /**
  @notice Returns whether the operator is an OpenSea proxy for the owner, thus
  allowing it to list without the token owner paying gas.
  @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
  this function returns true.
    */
  function isApprovedForAll(address owner, address operator) internal view returns (bool) {
    OSProxy registry;
    assembly {
      switch chainid()
      case 1 {
        // mainnet
        registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1
      }
      case 4 {
        // rinkeby
        registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317
      }
    }

    return address(registry) != address(0) && address(registry.proxies(owner)) == operator;
  }
}
function isApprovedForAll(address owner, address operator) internal view returns (bool) {
  OSProxy registry;
  assembly {
    switch chainid()
    case 1 {
      // mainnet
      registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1
    }
    case 4 {
      // rinkeby
      registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317
    }
  }

  return address(registry) != address(0) && address(registry.proxies(owner)) == operator;
}

/**
 @notice Returns whether the operator is an OpenSea proxy for the owner, thus
 allowing it to list without the token owner paying gas.
 @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
 this function returns true.
 */