smart-contracts
smart-contracts copied to clipboard
Marketplace listings failing
Creating listings seems to be randomly failing since the past few days https://polygonscan.com/address/0x66592ad3fbd87b8631e40143b2f6671a9dd73283 Any ideas what could be causing this issue? I can see the "value" column randomly switched from 0 MATIC to 1 MATIC for some unknown reason.
💻 Environment Production - Tatum marketplace APIs
📝 Details
-
Creating listings seems to be failing https://polygonscan.com/address/0x66592ad3fbd87b8631e40143b2f6671a9dd73283 Any ideas what could be causing this issue? I can see the "value" column randomly switched from 0 MATIC to 1 MATIC for some unknown reason.
-
In order to solve the above issue, I created a new marketplace and transactions started going through, but with a warning that execution failed somewhere - https://polygonscan.com/address/0x1a33b3e3a6a90d86c62516197fc6784aa30f1b0d Over here, Creating a listing and sending the NFT to the marketplace works fine, but when i hit the cancel listing API, the NFT is not returned to the original wallet again
🔢 Code to reproduce bug
Create Listing -
curl --request POST \
--url https://api-eu1.tatum.io/v3/blockchain/marketplace/listing/sell \
--header 'content-type: application/json' \
--header 'x-api-key: REPLACE_KEY_VALUE' \
--data '{"chain":"MATIC","contractAddress":"0x66592ad3fbd87b8631e40143b2f6671a9dd73283","nftAddress":"0x8c0d8685afeaf558f271fd78e75e647f6357869b","seller":"0xb179603336B7580F0f845b1366D0c20A00995779","listingId":"listing3694648298","amount":"1","tokenId":"21668006","price":"1","isErc721":true,"fromPrivateKey":"###","fee":{"gasLimit":"350000","gasPrice":"50"}}'
Send NFT to marketplace -
curl --request POST \
--url https://api-eu1.tatum.io/v3/nft/transaction \
--header 'content-type: application/json' \
--header 'x-api-key: ###' \
--data '{"chain":"MATIC","to":"0x66592ad3fbd87b8631e40143b2f6671a9dd73283","tokenId":"21668006","contractAddress":"0x8c0d8685afeaf558f271fd78e75e647f6357869b","tokenPrice":"1","fromPrivateKey":"###","fee":{"gasLimit":"40000","gasPrice":"40"}}'
Cancel NFT listing -
curl --request POST \
--url https://api-eu1.tatum.io/v3/blockchain/marketplace/listing/cancel \
--header 'content-type: application/json' \
--header 'x-api-key: ###' \
--data '{"chain":"MATIC","contractAddress":"0x66592ad3fbd87b8631e40143b2f6671a9dd73283","listingId":"listing3694648298","fromPrivateKey":"###"}'
Let me know if you'd like me to provide any other details! After i switched over to a new marketplace contract, creating a listing and sending it to the marketplace worked fine (even though all transactions show a warning). If I can just get the cancel API to return the user's NFT when it's called, that should resolve all my issues.
I believe the issue i'm facing here is due to the changes that were recently made to the Tatum contracts for marketplace -
- https://github.com/tatumio/smart-contracts/commit/b49fcbe33063ed06342694264b5fe921b1510205
- https://github.com/tatumio/smart-contracts/commit/8a8ed56cd5425b64710d14cdc32ca762c456bbb6 The timing when i started facing the error and the commit was made add up, considering I didn't make any changes on my end related the API calls & everything worked fine till then.
This issue is causing users to lose their NFTs in production environment since they can't cancel listings anymore. Is there a way i can use the older version of the contracts, or would there be any manual way i can return people their NFTs from the contract after they call the cancel API? I'm open to any temporary solutions too until this issue can be properly resolved.