mars icon indicating copy to clipboard operation
mars copied to clipboard

Feat:decode opensea seaport contract log event

Open GrapeBaBa opened this issue 2 years ago • 6 comments

GrapeBaBa avatar Sep 17 '22 03:09 GrapeBaBa

@GrapeBaBa Hi, Any references for this feature?

BohuTANG avatar Sep 17 '22 07:09 BohuTANG

@GrapeBaBa Hi, Any references for this feature?

I need statistic volume which I think I need transfer price. It seems in another log topic which emit by seaport contract. I found this discussion https://github.com/ProjectOpenSea/seaport/discussions/546

GrapeBaBa avatar Sep 17 '22 10:09 GrapeBaBa

Thanks. It's not hard. Like this tx from opensea: https://etherscan.io/tx/0xe0b9b25822b2adc8ae16d7ad8bec975a690df84d0ad9c16c9400ef3835b8146f#eventlog

The transfer price is 12 ETH

BohuTANG avatar Sep 17 '22 12:09 BohuTANG

The event log protocol defined here:

https://github.com/ProjectOpenSea/seaport/blob/171f2cd7faf13b2bf0455851499f1981274977f7/contracts/lib/ConsiderationConstants.sol#L131-L140

d55d0508062d939a1097fea2fc66527ed0b130d14ebe2112f16b77c13a824e02.            -- orderHash
000000000000000000000000fa90d99d10c5d94d0e67b2d0f706020b722a529a      -- fulfiller
0000000000000000000000000000000000000000000000000000000000000080 -- offer offset
0000000000000000000000000000000000000000000000000000000000000120  -- consideration offset
0000000000000000000000000000000000000000000000000000000000000001  -- offer.length (1)
0000000000000000000000000000000000000000000000000000000000000002 -- offerItemType
00000000000000000000000049cf6f5d44e70224e2e23fdcdd2c053f30ada28b.       -- offerToken
0000000000000000000000000000000000000000000000000000000000001903 -- offerIdentifier
0000000000000000000000000000000000000000000000000000000000000001 -- offerAmount
0000000000000000000000000000000000000000000000000000000000000003  ... ...

BohuTANG avatar Sep 17 '22 13:09 BohuTANG

Yes, I can try to implement it. However I didn't think about whether to add fields to the token_transfer table or add a new order table.

GrapeBaBa avatar Sep 18 '22 02:09 GrapeBaBa

Hello, how about adding a new table: opensea?

BohuTANG avatar Sep 18 '22 03:09 BohuTANG