Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDCPAY not working with SeaPort SmartContracts. #11

Open
xcantera opened this issue Aug 31, 2022 · 17 comments
Open

XDCPAY not working with SeaPort SmartContracts. #11

xcantera opened this issue Aug 31, 2022 · 17 comments

Comments

@xcantera
Copy link

XDCPay version(latest 6.2.11)

The problem with XDCpay is still the same.
XDCpay has missing functions that metamask has.

You have here the smart contract: https://github.com/PrimeNumbersNFT/seaport

Try to list an NFT on our marketplace and you will be able to see the error. (If you need an NFT, post your wallet and I will send one)
https://mint.primenumbers.es/marketplace

I will do a post on xdc.dev with images.

Error: inpage.js:10454 MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.', data: {…}} (anonymous) @ inpage.js:10454 (anonymous) @ inpage.js:10785 _runReturnHandlers @ inpage.js:10784 _processRequest @ inpage.js:10779 await in _processRequest (async) _handle @ inpage.js:10751 handle @ inpage.js:10715 MetamaskInpageProvider.sendAsync @ inpage.js:10579 (anonymous) @ _app-666da02be6f83b3c.js:1 (anonymous) @ _app-666da02be6f83b3c.js:1 send @ _app-666da02be6f83b3c.js:1 (anonymous) @ _app-666da02be6f83b3c.js:1 a @ _app-666da02be6f83b3c.js:1 Promise.then (async) u @ _app-666da02be6f83b3c.js:1 a @ _app-666da02be6f83b3c.js:1 Promise.then (async) u @ _app-666da02be6f83b3c.js:1 (anonymous) @ _app-666da02be6f83b3c.js:1 p @ _app-666da02be6f83b3c.js:1 _signTypedData @ _app-666da02be6f83b3c.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 o @ 365-06c93b9b2c7ee58f.js:1 Promise.then (async) u @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 i @ 365-06c93b9b2c7ee58f.js:1 e.signOrder @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 i @ 365-06c93b9b2c7ee58f.js:1 createOrder @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 o @ 365-06c93b9b2c7ee58f.js:1 Promise.then (async) u @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ 365-06c93b9b2c7ee58f.js:1 r @ 365-06c93b9b2c7ee58f.js:1 t.executeAllActions @ 365-06c93b9b2c7ee58f.js:1 executeAllActions @ 365-06c93b9b2c7ee58f.js:1 (anonymous) @ [id]-e8d3356def383579.js:1 s @ main-845832186e6f0106.js:1 (anonymous) @ main-845832186e6f0106.js:1 P.forEach.e.<computed> @ main-845832186e6f0106.js:1 we @ [id]-e8d3356def383579.js:1 i @ [id]-e8d3356def383579.js:1 Promise.then (async) we @ [id]-e8d3356def383579.js:1 i @ [id]-e8d3356def383579.js:1 Promise.then (async) we @ [id]-e8d3356def383579.js:1 i @ [id]-e8d3356def383579.js:1 (anonymous) @ [id]-e8d3356def383579.js:1 (anonymous) @ [id]-e8d3356def383579.js:1 (anonymous) @ [id]-e8d3356def383579.js:1 Oe @ framework-81da43a8dcd978d9.js:1 Ae @ framework-81da43a8dcd978d9.js:1 (anonymous) @ framework-81da43a8dcd978d9.js:1 Or @ framework-81da43a8dcd978d9.js:1 Dr @ framework-81da43a8dcd978d9.js:1 (anonymous) @ framework-81da43a8dcd978d9.js:1 Zi @ framework-81da43a8dcd978d9.js:1 Le @ framework-81da43a8dcd978d9.js:1 jr @ framework-81da43a8dcd978d9.js:1 Hn @ framework-81da43a8dcd978d9.js:1 Qn @ framework-81da43a8dcd978d9.js:1 [id]-e8d3356def383579.js:1 {code: -32603}

@dominicxu93
Copy link

looking into it

@blocksscandev
Copy link

Get ready for the new browser extension with improved and latest functionalities of Metamask.
BlocksScan to release the Beta version of extension wallet in upcoming weeks for the community.

@dominicxu93
Copy link

can you give us a full error message? we saw “ ... ” in data
Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.', data: {…}} (anonymous)

@gzliudan
Copy link

gzliudan commented Sep 6, 2022

@xcantera Please mint a NFT to me: xdcd4ce02705041f04135f1949bc835c1fe0885513c . And please tell me how to reproduce this problem step one by one. I will try to locate the problem reason.

@xcantera
Copy link
Author

xcantera commented Sep 6, 2022

I just sent an NFT to you. https://mint.primenumbers.es/prime-number/2081

Connect your XDC pay to https://mint.primenumbers.es/. Go to "New Contract" tab. And click your NFT. Then click sell, choose a price in $XDC (list it above 10k $XDC to don't get sniped). You will see the error.

@xcantera
Copy link
Author

xcantera commented Sep 6, 2022

With Metamask works perfect

@gzliudan
Copy link

gzliudan commented Sep 6, 2022

I saw the error is message is 'The method does not exist / is not available.' when I use XDC pay. And there's no error when I use metamask. I will troubleshooting this error tomorrow again.

@xcantera
Copy link
Author

xcantera commented Sep 6, 2022 via email

@gzliudan
Copy link

gzliudan commented Sep 7, 2022

After capture network packet by mitmproxy, I found:

1. when connect with XDCPay

1.1 web browser

Web browser reports a error on console, and not pop signature window

{code: -32601, message: 'The method does not exist / is not available.', data: {…}}

1.2 mitmproxy loged an 405 error

1.2.1 Request

Header

POST https://xdcpayrpc.blocksscan.io/ HTTP/2.0
content-length: 2841
sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"
accept: application/json
content-type: application/json
sec-ch-ua-mobile: ?0
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
sec-ch-ua-platform: "Windows"
origin: chrome-extension://bocpokimicclpaiekenaeelehdjllofo
sec-fetch-site: none
sec-fetch-mode: cors
sec-fetch-dest: empty
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
cookie: _ga=GA1.2.1653263497.1660968185

Body

{
    "id": 2836584675,
    "jsonrpc": "2.0",
    "method": "eth_signTypedData_v4",
    "params": [
        "0xd4ce02705041f04135f1949bc835c1fe0885513c",
        "{\"types\":{\"OrderComponents\":[{\"name\":\"offerer\",\"type\":\"address\"},{\"name\":\"zone\",\"type\":\"address\"},{\"name\":\"offer\",\"type\":\"OfferItem[]\"},{\"name\":\"consideration\",\"type\":\"ConsiderationItem[]\"},{\"name\":\"orderType\",\"type\":\"uint8\"},{\"name\":\"startTime\",\"type\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\"},{\"name\":\"zoneHash\",\"type\":\"bytes32\"},{\"name\":\"salt\",\"type\":\"uint256\"},{\"name\":\"conduitKey\",\"type\":\"bytes32\"},{\"name\":\"counter\",\"type\":\"uint256\"}],\"OfferItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"}],\"ConsiderationItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\"}],\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}]},\"domain\":{\"name\":\"Seaport\",\"version\":\"1.1\",\"chainId\":\"50\",\"verifyingContract\":\"0x00000000006c3852cbef3e08e8df289169ede581\"},\"primaryType\":\"OrderComponents\",\"message\":{\"offerer\":\"0xd4ce02705041f04135f1949bc835c1fe0885513c\",\"zone\":\"0x0000000000000000000000000000000000000000\",\"offer\":[{\"itemType\":\"2\",\"token\":\"0xf87f7dd4e47dd5bcac902c381ea0d2730db5c6ad\",\"identifierOrCriteria\":\"2081\",\"startAmount\":\"1\",\"endAmount\":\"1\"}],\"consideration\":[{\"itemType\":\"0\",\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"8910000000000000000000000000000\",\"endAmount\":\"8910000000000000000000000000000\",\"recipient\":\"0xd4ce02705041f04135f1949bc835c1fe0885513c\"},{\"itemType\":\"0\",\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"990000000000000000000000000000\",\"endAmount\":\"990000000000000000000000000000\",\"recipient\":\"0x129f3071bdfa4660a8d9e85c57570c839a80658f\"}],\"orderType\":\"0\",\"startTime\":\"1662520337\",\"endTime\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"zoneHash\":\"0x3000000000000000000000000000000000000000000000000000000000000000\",\"salt\":\"238893535571409156148541525525842694454\",\"conduitKey\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"counter\":\"0\"}}"
    ]
}

1.2.2 Response

Header

HTTP/2.0 405
date: Wed, 07 Sep 2022 03:12:20 GMT
content-type: text/plain; charset=utf-8
content-length: 135
access-control-allow-origin: *
vary: Origin
x-rpc-proxy: rpc-proxy
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=I55glPxIBflBCu%2BJP9iOBjyLm98rCf26niUOhlRg68toGMBUwuElJWJSp5sbjTTxlgvTw5D4tmBtlrp9dc0ofTpKgSm2Az6kVRXUwzN7wOC79VHdfHWyDBdEvxkUd2PpiMzPd8cMpnpfKQ%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 746c43205f843d82-HKG
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

Body

{"jsonrpc":"2.0","id":2836584675,"error":{"code":-32601,"message":"You are not authorized to make this request: eth_signTypedData_v4"}}

2. when connect with MetaMask

No error occured, MetaMask pops a signature window, web app executes successfully. And MetaMask didn't call method eth_signTypedData_v4.

3. conclusion

Maybe sync the version of XDCPay with MetaMask can resolve this problem.

@AnilChinchawale
Copy link
Member

Hello,

We would like to inform you that eth_signTypedData_v4 has been enabled in XDCPay, Can you check now.

@gzliudan
Copy link

gzliudan commented Sep 7, 2022

Web browser report a different error on console now:

{code: -32603, message: 'Internal JSON-RPC error.', data: {…}}

I will check jsonrpc with mitmproxy.

@gzliudan
Copy link

gzliudan commented Sep 7, 2022

The JSONRPC is:

Request

Header

POST https://xdcpayrpc.blocksscan.io/ HTTP/2.0
content-length: 2853
sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"
accept: application/json
content-type: application/json
sec-ch-ua-mobile: ?0
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
sec-ch-ua-platform: "Windows"
origin: chrome-extension://bocpokimicclpaiekenaeelehdjllofo
sec-fetch-site: none
sec-fetch-mode: cors
sec-fetch-dest: empty
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
cookie: _ga=GA1.2.1653263497.1660968185

Body

{
    "id": 1424328464,
    "jsonrpc": "2.0",
    "method": "eth_signTypedData_v4",
    "params": [
        "0xd4ce02705041f04135f1949bc835c1fe0885513c",
        "{\"types\":{\"OrderComponents\":[{\"name\":\"offerer\",\"type\":\"address\"},{\"name\":\"zone\",\"type\":\"address\"},{\"name\":\"offer\",\"type\":\"OfferItem[]\"},{\"name\":\"consideration\",\"type\":\"ConsiderationItem[]\"},{\"name\":\"orderType\",\"type\":\"uint8\"},{\"name\":\"startTime\",\"type\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\"},{\"name\":\"zoneHash\",\"type\":\"bytes32\"},{\"name\":\"salt\",\"type\":\"uint256\"},{\"name\":\"conduitKey\",\"type\":\"bytes32\"},{\"name\":\"counter\",\"type\":\"uint256\"}],\"OfferItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"}],\"ConsiderationItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\"}],\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}]},\"domain\":{\"name\":\"Seaport\",\"version\":\"1.1\",\"chainId\":\"50\",\"verifyingContract\":\"0x00000000006c3852cbef3e08e8df289169ede581\"},\"primaryType\":\"OrderComponents\",\"message\":{\"offerer\":\"0xd4ce02705041f04135f1949bc835c1fe0885513c\",\"zone\":\"0x0000000000000000000000000000000000000000\",\"offer\":[{\"itemType\":\"2\",\"token\":\"0xf87f7dd4e47dd5bcac902c381ea0d2730db5c6ad\",\"identifierOrCriteria\":\"2081\",\"startAmount\":\"1\",\"endAmount\":\"1\"}],\"consideration\":[{\"itemType\":\"0\",\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"8910000000000000000000000000000000\",\"endAmount\":\"8910000000000000000000000000000000\",\"recipient\":\"0xd4ce02705041f04135f1949bc835c1fe0885513c\"},{\"itemType\":\"0\",\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"990000000000000000000000000000000\",\"endAmount\":\"990000000000000000000000000000000\",\"recipient\":\"0x129f3071bdfa4660a8d9e85c57570c839a80658f\"}],\"orderType\":\"0\",\"startTime\":\"1662534125\",\"endTime\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"zoneHash\":\"0x3000000000000000000000000000000000000000000000000000000000000000\",\"salt\":\"135652900358114786678234649842301917894\",\"conduitKey\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"counter\":\"0\"}}"
    ]
}

Response

Header

HTTP/2.0 200
date: Wed, 07 Sep 2022 07:02:08 GMT
content-type: application/json
access-control-allow-origin: *
access-control-allow-origin: *
vary: Origin
vary: Origin
x-rpc-proxy: rpc-proxy
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=UQCQTwBYW0lYW%2BUBbNF8DHVgsNLTXQADVIHOujH0zFtCI7bLjLDFsQlndzJp5gTHJvDfxEB%2Bgb5oTjdwjAbW9Lt1ayF7uAK5V1t9%2BOMsoQrGLHEWFN0tr18PpgBtbaJPkP%2Ft5KYgyvuqoQ%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 746d93bc6ab96e63-HKG
content-encoding: br
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

Body

{
    "error": {
        "code": -32601,
        "message": "The method eth_signTypedData_v4_ does not exist/is not available"
    },
    "jsonrpc": "2.0"
}

Since MetaMash has no issue, I think maybe it's time to upgrade XDCPay now.

@xcantera
Copy link
Author

xcantera commented Sep 7, 2022 via email

@gzliudan
Copy link

gzliudan commented Sep 7, 2022

Please notice the latest response of JSONRPC has no id key, maybe this is the reason of 32603 (Internal JSON-RPC error).
According to the specification of JSONRPC, there should has an id key in response. So please check the implement of JSONRPC also.

@AnilChinchawale
Copy link
Member

Sure let us check issue from JSONRPC

@xcantera
Copy link
Author

xcantera commented Oct 8, 2022

Please we need this update!!

@Mitali-88
Copy link

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

No branches or pull requests

6 participants