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

fulfillOrder throws CALL_EXCEPTION and exits the process.

Open omnigolp opened this issue 4 years ago • 7 comments

I want to fulfill the sell order of this asset: https://opensea.io/assets/0x09f717f77b5e7f2d2f37604fec3d0e3d53eb9808/1 What can I do to prevent this error? How can I fulfill an existing order? This happens with all assets. If I use the same privateKey in the frontend, it works fine. Why does it exit the nodejs process and how can I prevent that? I catch the error but the process ends before the catch.

Code:

try {
    const result = await seaport.fulfillOrder({
        order: order,
        accountAddress: accountAddress,
    });
    console.log(result);
} catch (e) {
    console.log("Error: ", e);
}

The accountAddress is my address as String starting with 0x, the order is from the API and can be seen below.

The error:

Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="isApprovedForAll(address,address)", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version
=abi/5.7.0)
    at Logger.makeError (/home/admin/opensea/node_modules/@ethersproject/logger/lib/index.js:238:21)
    at Logger.throwError (/home/admin/opensea/node_modules/@ethersproject/logger/lib/index.js:247:20)
    at Interface.decodeFunctionResult (/home/admin/opensea/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface.js:388:23)
    at Contract.<anonymous> (/home/admin/opensea/node_modules/@ethersproject/contracts/lib/index.js:395:56)
    at step (/home/admin/opensea/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Object.next (/home/admin/opensea/node_modules/@ethersproject/contracts/lib/index.js:29:53)
    at fulfilled (/home/admin/opensea/node_modules/@ethersproject/contracts/lib/index.js:20:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  reason: null,
  code: 'CALL_EXCEPTION',
  method: 'isApprovedForAll(address,address)',
  data: '0x',
  errorArgs: null,
  errorName: null,
  errorSignature: null,
  address: '0x09f717f77B5e7f2D2F37604fEC3D0e3D53eB9808',
  args: [
    '0xd30abf4af986ab17d196b8ed52afdfa1e89728fb',
    '0x1e0049783f008a0085193e00003d00cd54003c71'
  ],
  transaction: {
    data: '0xe985e9c5000000000000000000000000d30abf4af986ab17d196b8ed52afdfa1e89728fb0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71',
    to: '0x09f717f77B5e7f2D2F37604fEC3D0e3D53eB9808'
  }
}

The order:

{
    "createdDate": "2022-10-03T12:05:35.986385",
    "closingDate": "2022-11-03T12:02:04",
    "listingTime": 1664798524,
    "expirationTime": 1667476924,
    "orderHash": "0x263a7d72ff09b7fb1d9dc91abec0281c79e99bc39f3cd86061985ef8e9119c7b",
    "maker": {
        "address": "0x5e07fb29aa7fb940188ef1654d13818dbc5afcd9",
        "config": "",
        "profileImgUrl": "https://storage.googleapis.com/opensea-static/opensea-profile/20.png",
        "user": {}
    },
    "taker": null,
    "protocolData": {
        "parameters": {
            "offerer": "0x5e07fb29aa7fb940188ef1654d13818dbc5afcd9",
            "offer": [
                {
                    "itemType": 3,
                    "token": "0x09f717f77B5e7f2D2F37604fEC3D0e3D53eB9808",
                    "identifierOrCriteria": "1",
                    "startAmount": "1",
                    "endAmount": "1"
                }
            ],
            "consideration": [
                {
                    "itemType": 0,
                    "token": "0x0000000000000000000000000000000000000000",
                    "identifierOrCriteria": "0",
                    "startAmount": "22662500000000000",
                    "endAmount": "22662500000000000",
                    "recipient": "0x5e07fB29aA7fB940188eF1654D13818Dbc5aFCd9"
                },
                {
                    "itemType": 0,
                    "token": "0x0000000000000000000000000000000000000000",
                    "identifierOrCriteria": "0",
                    "startAmount": "647500000000000",
                    "endAmount": "647500000000000",
                    "recipient": "0x0000a26b00c1F0DF003000390027140000fAa719"
                },
                {
                    "itemType": 0,
                    "token": "0x0000000000000000000000000000000000000000",
                    "identifierOrCriteria": "0",
                    "startAmount": "2590000000000000",
                    "endAmount": "2590000000000000",
                    "recipient": "0x77ae6c82b3a115E586318c2C9DB22BD951Fc188C"
                }
            ],
            "startTime": "1664798524",
            "endTime": "1667476924",
            "orderType": 3,
            "zone": "0x004C00500000aD104D7DBd00e3ae0A5C00560C00",
            "zoneHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "salt": "0x360c6ebe00000000000000000000000000000000000000005a9717eaa7ede4fb",
            "conduitKey": "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",
            "totalOriginalConsiderationItems": 3,
            "counter": 0
        },
        "signature": "0x5573c8a54c96f563de22a89678e996b62fb6acee1f2493a1a5b570f7396a31e4204fc060b151c11c158c605764ff77508f3dd11d3ec696374c668b48db270b351b"
    },
    "protocolAddress": "0x00000000006c3852cbef3e08e8df289169ede581",
    "currentPrice": "25900000000000000",
    "makerFees": [
        {
            "account": {
                "address": "0x77ae6c82b3a115e586318c2c9db22bd951fc188c",
                "config": "",
                "profileImgUrl": "https://storage.googleapis.com/opensea-static/opensea-profile/22.png",
                "user": null
            },
            "basisPoints": "1000"
        },
        {
            "account": {
                "address": "0x0000a26b00c1f0df003000390027140000faa719",
                "config": "",
                "profileImgUrl": "https://storage.googleapis.com/opensea-static/opensea-profile/29.png",
                "user": null
            },
            "basisPoints": "250"
        }
    ],
    "takerFees": [],
    "side": "ask",
    "orderType": "basic",
    "cancelled": false,
    "finalized": false,
    "markedInvalid": false,
    "clientSignature": "0x5573c8a54c96f563de22a89678e996b62fb6acee1f2493a1a5b570f7396a31e4204fc060b151c11c158c605764ff77508f3dd11d3ec696374c668b48db270b351b",
    "makerAssetBundle": {
        "maker": null,
        "assets": [
            {
                "tokenId": "1",
                "tokenAddress": "0x09f717f77b5e7f2d2f37604fec3d0e3d53eb9808",
                "name": "Green Capacitor",
                "description": "In the attempt to help Nova Gaïa, the Assembly of Women (WoW) have sent help through the form of capacitors - devices that can store electrical energy. Charged, physical contact or close proximity may cause a sudden discharge that could either be hazardous or beneficial. What is the true nature of these capacitors?",
                "owner": {
                    "user": {
                        "username": "NullAddress"
                    },
                    "profile_img_url": "https://storage.googleapis.com/opensea-static/opensea-profile/1.png",
                    "address": "0x0000000000000000000000000000000000000000",
                    "config": ""
                },
                "assetContract": {
                    "name": "Unidentified contract",
                    "description": "In the attempt to help Nova Gaïa, the Assembly of Women (WoW) have sent help through the form of capacitors - devices that can store electrical energy. \r\n\r\nCharged, physical contact or close proximity may cause a sudden discharge that could either be hazardous or beneficial. What is the true nature of these capacitors?",
                    "type": "semi-fungible",
                    "schemaName": "ERC1155",
                    "address": "0x09f717f77b5e7f2d2f37604fec3d0e3d53eb9808",
                    "tokenSymbol": "",
                    "buyerFeeBasisPoints": 0,
                    "sellerFeeBasisPoints": 1250,
                    "openseaBuyerFeeBasisPoints": 0,
                    "openseaSellerFeeBasisPoints": 250,
                    "devBuyerFeeBasisPoints": 0,
                    "devSellerFeeBasisPoints": 1000,
                    "imageUrl": "https://i.seadn.io/gcs/files/884383be5ee3b66e14b3cb029d69e5f2.gif?w=500&auto=format",
                    "externalLink": "http://worldofwomen.art"
                },
                "collection": {
                    "createdDate": "2022-07-06T08:39:43.827Z",
                    "name": "WoW - Capacitors",
                    "description": "In the attempt to help Nova Gaïa, the Assembly of Women (WoW) have sent help through the form of capacitors - devices that can store electrical energy. \r\n\r\nCharged, physical contact or close proximity may cause a sudden discharge that could either be hazardous or beneficial. What is the true nature of these capacitors?",
                    "slug": "wow-capacitors",
                    "hidden": false,
                    "featured": false,
                    "featuredImageUrl": "https://i.seadn.io/gcs/files/15f41415485bbd2c3fbd52916e5f8412.png?w=500&auto=format",
                    "displayData": {
                        "card_display_style": "cover"
                    },
                    "paymentTokens": [],
                    "openseaBuyerFeeBasisPoints": 0,
                    "openseaSellerFeeBasisPoints": 250,
                    "devBuyerFeeBasisPoints": 0,
                    "devSellerFeeBasisPoints": 1000,
                    "payoutAddress": "0x77ae6c82b3a115e586318c2c9db22bd951fc188c",
                    "imageUrl": "https://i.seadn.io/gcs/files/884383be5ee3b66e14b3cb029d69e5f2.gif?w=500&auto=format",
                    "largeImageUrl": "https://i.seadn.io/gcs/files/15f41415485bbd2c3fbd52916e5f8412.png?w=500&auto=format",
                    "externalLink": "http://worldofwomen.art",
                    "wikiLink": null,
                    "fees": {
                        "openseaFees": {},
                        "sellerFees": {}
                    }
                },
                "orders": null,
                "sellOrders": null,
                "buyOrders": null,
                "imageUrl": "https://lh3.googleusercontent.com/aWOk42uDYiagkwrVB3PmgedMUaweXj_aXsRQdDqvVj0K-JQHbm_dDeq_wvcQv80XyLRWcf3JE-Qm7vz-gDUM5NHCOjpU1Ob7LQuFPL4=s250",
                "imagePreviewUrl": "https://lh3.googleusercontent.com/aWOk42uDYiagkwrVB3PmgedMUaweXj_aXsRQdDqvVj0K-JQHbm_dDeq_wvcQv80XyLRWcf3JE-Qm7vz-gDUM5NHCOjpU1Ob7LQuFPL4=s250",
                "imageUrlOriginal": "https://opensea-private.mypinata.cloud/ipfs/QmeaMorwmPbXkzBmmZqBDmsmr66AnrRn6gVVB1eDqcC3AB",
                "imageUrlThumbnail": "https://lh3.googleusercontent.com/aWOk42uDYiagkwrVB3PmgedMUaweXj_aXsRQdDqvVj0K-JQHbm_dDeq_wvcQv80XyLRWcf3JE-Qm7vz-gDUM5NHCOjpU1Ob7LQuFPL4=s128",
                "externalLink": "https://worldofwomen.art",
                "openseaLink": "https://opensea.io/assets/ethereum/0x09f717f77b5e7f2d2f37604fec3d0e3d53eb9808/1",
                "numSales": 1158,
                "lastSale": null,
                "backgroundColor": null,
                "transferFee": null,
                "transferFeePaymentToken": null
            }
        ],
        "assetContract": {
            "name": "Unidentified contract",
            "description": "In the attempt to help Nova Gaïa, the Assembly of Women (WoW) have sent help through the form of capacitors - devices that can store electrical energy. \r\n\r\nCharged, physical contact or close proximity may cause a sudden discharge that could either be hazardous or beneficial. What is the true nature of these capacitors?",
            "type": "semi-fungible",
            "schemaName": "ERC1155",
            "address": "0x09f717f77b5e7f2d2f37604fec3d0e3d53eb9808",
            "tokenSymbol": "",
            "buyerFeeBasisPoints": 0,
            "sellerFeeBasisPoints": 1250,
            "openseaBuyerFeeBasisPoints": 0,
            "openseaSellerFeeBasisPoints": 250,
            "devBuyerFeeBasisPoints": 0,
            "devSellerFeeBasisPoints": 1000,
            "imageUrl": "https://i.seadn.io/gcs/files/884383be5ee3b66e14b3cb029d69e5f2.gif?w=500&auto=format",
            "externalLink": "http://worldofwomen.art"
        },
        "name": null,
        "slug": null,
        "description": null,
        "externalLink": null,
        "permalink": "https://opensea.io/bundles/None",
        "sellOrders": null
    },
    "takerAssetBundle": {
        "maker": null,
        "assets": [
            {
                "tokenId": "0",
                "tokenAddress": "0x0000000000000000000000000000000000000000",
                "name": "Ether",
                "description": "",
                "owner": {
                    "user": {
                        "username": "NullAddress"
                    },
                    "profile_img_url": "https://storage.googleapis.com/opensea-static/opensea-profile/1.png",
                    "address": "0x0000000000000000000000000000000000000000",
                    "config": ""
                },
                "assetContract": {
                    "name": "Ether",
                    "description": "This is the collection of owners of Ether",
                    "type": "fungible",
                    "schemaName": "ERC20",
                    "address": "0x0000000000000000000000000000000000000000",
                    "tokenSymbol": "ETH",
                    "buyerFeeBasisPoints": 0,
                    "sellerFeeBasisPoints": 250,
                    "openseaBuyerFeeBasisPoints": 0,
                    "openseaSellerFeeBasisPoints": 250,
                    "devBuyerFeeBasisPoints": 0,
                    "devSellerFeeBasisPoints": 0,
                    "imageUrl": null,
                    "externalLink": null
                },
                "collection": {
                    "createdDate": "2019-08-02T23:41:09.501Z",
                    "name": "Ether",
                    "description": "This is the collection of owners of Ether",
                    "slug": "ether",
                    "hidden": true,
                    "featured": false,
                    "featuredImageUrl": null,
                    "displayData": {},
                    "paymentTokens": [],
                    "openseaBuyerFeeBasisPoints": 0,
                    "openseaSellerFeeBasisPoints": 250,
                    "devBuyerFeeBasisPoints": 0,
                    "devSellerFeeBasisPoints": 0,
                    "payoutAddress": null,
                    "imageUrl": null,
                    "largeImageUrl": null,
                    "externalLink": null,
                    "wikiLink": null,
                    "fees": {
                        "openseaFees": {},
                        "sellerFees": {}
                    }
                },
                "orders": null,
                "sellOrders": null,
                "buyOrders": null,
                "imageUrl": "https://openseauserdata.com/files/6f8e2979d428180222796ff4a33ab929.svg",
                "imagePreviewUrl": "https://openseauserdata.com/files/6f8e2979d428180222796ff4a33ab929.svg",
                "imageUrlOriginal": "https://openseauserdata.com/files/6f8e2979d428180222796ff4a33ab929.svg",
                "imageUrlThumbnail": "https://openseauserdata.com/files/6f8e2979d428180222796ff4a33ab929.svg",
                "externalLink": null,
                "openseaLink": "https://opensea.io/assets/ethereum/0x0000000000000000000000000000000000000000/0",
                "numSales": 0,
                "lastSale": null,
                "backgroundColor": null,
                "transferFee": null,
                "transferFeePaymentToken": null
            }
        ],
        "assetContract": {
            "name": "Ether",
            "description": "This is the collection of owners of Ether",
            "type": "fungible",
            "schemaName": "ERC20",
            "address": "0x0000000000000000000000000000000000000000",
            "tokenSymbol": "ETH",
            "buyerFeeBasisPoints": 0,
            "sellerFeeBasisPoints": 250,
            "openseaBuyerFeeBasisPoints": 0,
            "openseaSellerFeeBasisPoints": 250,
            "devBuyerFeeBasisPoints": 0,
            "devSellerFeeBasisPoints": 0,
            "imageUrl": null,
            "externalLink": null
        },
        "name": "Ether",
        "slug": null,
        "description": null,
        "externalLink": null,
        "permalink": "https://opensea.io/bundles/None",
        "sellOrders": null
    }
}

omnigolp avatar Oct 03 '22 12:10 omnigolp

My dependencies are the following:

  "dependencies": {
    "@opensea/stream-js": "^0.0.20",
    "@truffle/hdwallet-provider": "^2.0.16",
    "argparse": "^2.0.1",
    "bignumber.js": "^9.1.0",
    "nodemailer": "^6.8.0",
    "opensea-js": "^4.0.12",
    "pg": "^8.8.0",
    "simple-node-logger": "^21.8.12",
    "ws": "^8.9.0"
  },

omnigolp avatar Oct 03 '22 12:10 omnigolp

@sunwrobert No, I pass everything. The parameter in the SDK says order: OrderV2, this is what the getOrders api returns. I will test protocolData

omnigolp avatar Oct 03 '22 13:10 omnigolp

@sunwrobert No, I pass everything. The parameter in the SDK says order: OrderV2, this is what the getOrders api returns. I will test protocolData

Sorry, my mistake. Thought this was seaport-js initially. Yeah you'll need to pass in the whole order.

Is your node provider connected to the right network/chain?

sunwrobert avatar Oct 03 '22 13:10 sunwrobert

@sunwrobert Ok, just tried it, returns Error: Unsupported protocol. Yeah, I use the SDK, but I can also try the seaport. I use my own full node, but I can try infura.

omnigolp avatar Oct 03 '22 13:10 omnigolp

@sunwrobert Genius, thank you very very much, it works with infura, so there is a problem with my server.

omnigolp avatar Oct 03 '22 13:10 omnigolp

Glad it worked out!

sunwrobert avatar Oct 03 '22 13:10 sunwrobert

@sunwrobert When the error happened, do you know why nodejs exited and how to prevent it? This probably won't occur now, but I want to understand it.

omnigolp avatar Oct 03 '22 13:10 omnigolp