-
We're trying to monitor event transactions directly and, in a similar way as we were for Wyvern, decode the event logs of a Seaport transaction. Event signature:
The new contract is using a couple of
Causes:
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
I think I made a little progress with the below ABI, but haven't quite figured it out yet. Getting overflow errors from ethers.
|
Beta Was this translation helpful? Give feedback.
-
The above causes the following:
|
Beta Was this translation helpful? Give feedback.
-
@dsgriffin did you manage to solve this? I'm trying to decode a NFT sale event but can't figure how to |
Beta Was this translation helpful? Give feedback.
-
I got something that worked, but it is odd. When I try to parse the item as a tuple the dynamic arrays are read with dynamic offsets, so the event does not parse. However, by treating them as sequential arrays, I get something that worked. In web3.py this looks like
|
Beta Was this translation helpful? Give feedback.
-
Yes. I managed to decode the packets. I think I posted the code. Let me
find it.
在 2022年7月25日 週一 03:27,Praful Rana ***@***.***> 寫道:
… anyone figure this out?
—
Reply to this email directly, view it on GitHub
<#546 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWGAGL3SDJMNJ7P2Z7S3MDVVWKJ5ANCNFSM52JX3GAA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Look at the previous comment for how I decoded the packet. The odd thing
is that the arrays don't seem to have dynamic offsets.
I don't know how this fits the ethereum abi spec but it seems to work.
|
Beta Was this translation helpful? Give feedback.
-
@prafulrana @thezenvan find a working example on my repo here: |
Beta Was this translation helpful? Give feedback.
-
A little late, but for people who are still looking. This is what i figured out for now.. const subscription = await web3.eth.subscribe("logs", {
topics: [
"0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31",
],
});
subscription.on("data", (event) => {
// Filter only by seaport 1.5 address
if (event.address != "0x00000000000000adc04c56bf30ac9d3c0aaf14dc") return;
let transaction = web3.eth.abi.decodeLog(
[
{
indexed: false,
internalType: "bytes32",
name: "orderHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "offerer",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "zone",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "recipient",
type: "address",
},
{
components: [
{
internalType: "enum ItemType",
name: "itemType",
type: "uint8",
},
{
internalType: "address",
name: "token",
type: "address",
},
{
internalType: "uint256",
name: "identifier",
type: "uint256",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
indexed: false,
internalType: "struct SpentItem[]",
name: "offer",
type: "tuple[]",
},
{
components: [
{
internalType: "enum ItemType",
name: "itemType",
type: "uint8",
},
{
internalType: "address",
name: "token",
type: "address",
},
{
internalType: "uint256",
name: "identifier",
type: "uint256",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
{
internalType: "address payable",
name: "recipient",
type: "address",
},
],
indexed: false,
internalType: "struct ReceivedItem[]",
name: "consideration",
type: "tuple[]",
},
],
event.data,
[event.topics[0], event.topics[1], event.topics[2]]
);
console.log(transaction);
}); This logs: {
"0": "0x8aa0ea168908d7e95a40b6dd5049ba456a04a057fa3cf8f1090e668baaabeab4",
"1": "0x82aC08E774De674d37447D630129De8960097BA9",
"2": "0x0000000000000000000000000000000000000000",
"3": "0xBBf11C2c0D0190B734934b64Fa56D6EF5Ea8ee9e",
"4": [
[
"2",
"0xDC901017d1C8C9e5745a0A52e3237804dA32790C",
"3012",
"1"
]
],
"5": [
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"81900000000000000000",
"0x82aC08E774De674d37447D630129De8960097BA9"
],
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"2250000000000000000",
"0x0000a26b00c1F0DF003000390027140000fAa719"
],
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"5850000000000000000",
"0x2F01f6b99b4e84E8c05E6cEfC1a1700DE6298341"
]
],
"__length__": 6,
"orderHash": "0x8aa0ea168908d7e95a40b6dd5049ba456a04a057fa3cf8f1090e668baaabeab4",
"offerer": "0x82aC08E774De674d37447D630129De8960097BA9",
"zone": "0x0000000000000000000000000000000000000000",
"recipient": "0xBBf11C2c0D0190B734934b64Fa56D6EF5Ea8ee9e",
"offer": [
[
"2",
"0xDC901017d1C8C9e5745a0A52e3237804dA32790C",
"3012",
"1"
]
],
"consideration": [
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"81900000000000000000",
"0x82aC08E774De674d37447D630129De8960097BA9"
],
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"2250000000000000000",
"0x0000a26b00c1F0DF003000390027140000fAa719"
],
[
"0",
"0x0000000000000000000000000000000000000000",
"0",
"5850000000000000000",
"0x2F01f6b99b4e84E8c05E6cEfC1a1700DE6298341"
]
]
} |
Beta Was this translation helpful? Give feedback.
@prafulrana @thezenvan find a working example on my repo here:
NFT Sales Twitter Bot