Skip to content

Commit 8e9d5ab

Browse files
hthieu1110n0izn0iz
andauthored
fix: handle NFT transfer from Opensea on Polygon (#1229)
* fix: handle transfer NFT from polygon * fix: update polygon substream module * chore: set right start block * add season 2 wth * fix: handle safeTransferFrom * adjust season 2 * feat: add season pepe test --------- Co-authored-by: n0izn0iz <n0izn0iz@users.noreply.github.com>
1 parent f7cded0 commit 8e9d5ab

File tree

7 files changed

+99
-19
lines changed

7 files changed

+99
-19
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ require (
7272
github.com/CosmWasm/wasmvm v1.3.1 // indirect
7373
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
7474
github.com/armon/go-metrics v0.4.1 // indirect
75-
github.com/aws/aws-sdk-go v1.44.233 // indirect
75+
github.com/aws/aws-sdk-go v1.53.15 // indirect
7676
github.com/benbjohnson/clock v1.3.0 // indirect
7777
github.com/beorn7/perks v1.0.1 // indirect
7878
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ
301301
github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
302302
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
303303
github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
304-
github.com/aws/aws-sdk-go v1.44.233 h1:KB3p/yL32oG/aF4Ld0Ui9CU0tdezvhX6Xdqpb8vyP3U=
305-
github.com/aws/aws-sdk-go v1.44.233/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
304+
github.com/aws/aws-sdk-go v1.53.15 h1:FtZmkg7xM8RfP2oY6p7xdKBYrRgkITk9yve2QV7N938=
305+
github.com/aws/aws-sdk-go v1.53.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
306306
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
307307
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
308308
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=

go/internal/substreams/ethereum/handlers/handler.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func (h *Handler) HandleETHTx(tx *pb.Tx) error {
7575
if !bytes.Equal(log.Topics[0], transferTopic) {
7676
return nil
7777
}
78-
7978
from := DecodeTopicToAddr(log.Topics[1])
8079
to := DecodeTopicToAddr(log.Topics[2])
8180
nftID, err := DecodeTopicToInt(log.Topics[3])
@@ -166,7 +165,7 @@ func (h *Handler) HandleETHTx(tx *pb.Tx) error {
166165
if err := h.handleMintWithMetadata(contractABI, tx, args); err != nil {
167166
return errors.Wrap(err, "failed to handle mint and mint with meta data")
168167
}
169-
case "transferFrom":
168+
case "transferFrom", "safeTransferFrom":
170169
if err := h.handleTransferFrom(contractABI, tx, args); err != nil {
171170
return errors.Wrap(err, "failed to handle transfer")
172171
}
Binary file not shown.

go/pkg/p2e/seasons.go

+92-13
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,96 @@ var THE_RIOT_ETHEREUM_SEASONS = []Season{
209209
StartsAt: "2024-02-07T00:00:00",
210210
EndsAt: "2024-02-11T00:00:00",
211211
},
212-
// Season 1b
213-
{
214-
ID: "Season 1b - ETH",
215-
GameID: THE_RIOT_GAME_ID,
216-
Denom: "tori",
217-
Decimals: 6,
218-
TotalPrize: 1,
219-
BossName: "Tori Pup",
220-
BossImage: "https://bafkreidzf2kol7hi3lae33fpu6iryfw7mgbp5fbqnyewq64kagykc266h4.ipfs.cf-ipfs.com/",
221-
TopN: 500,
222-
StartsAt: "2024-02-11T00:00:00",
223-
EndsAt: "2024-02-20T00:00:00",
224-
},
212+
// Season 1b
213+
{
214+
ID: "Season 1b - ETH",
215+
GameID: THE_RIOT_GAME_ID,
216+
Denom: "tori",
217+
Decimals: 6,
218+
TotalPrize: 1,
219+
BossName: "Tori Pup",
220+
BossImage: "https://bafkreidzf2kol7hi3lae33fpu6iryfw7mgbp5fbqnyewq64kagykc266h4.ipfs.cf-ipfs.com/",
221+
TopN: 500,
222+
StartsAt: "2024-02-11T00:00:00",
223+
EndsAt: "2024-02-20T00:00:00",
224+
},
225+
// Pre-Season 1 official
226+
{
227+
ID: "Pre-Official season 1",
228+
GameID: THE_RIOT_GAME_ID,
229+
BossName: `== $*=|'¤?")à-£_%`,
230+
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
231+
StartsAt: "2024-02-20T00:00:00",
232+
EndsAt: "2024-03-05T00:00:00",
233+
IsPre: true,
234+
},
235+
// Season 1 official
236+
{
237+
ID: "Season 1 official - ETH",
238+
GameID: THE_RIOT_GAME_ID,
239+
Denom: "tori",
240+
Decimals: 6,
241+
TotalPrize: 1_000_000,
242+
BossName: "Dr. Murphy",
243+
BossImage: "https://bafybeidh7eq25gobfdikufdiehuki6tmdtyai3ccs2x2htavlqkj5lx4si.ipfs.cf-ipfs.com/",
244+
TopN: 500,
245+
StartsAt: "2024-03-05T00:00:00",
246+
EndsAt: "2024-04-12T00:00:00",
247+
},
248+
// Pre-Season 2
249+
{
250+
ID: "Pre-Official season 2",
251+
GameID: THE_RIOT_GAME_ID,
252+
BossName: `== $*=|'¤?")à-£_%`,
253+
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
254+
StartsAt: "2024-04-12T00:00:00",
255+
EndsAt: "2024-06-05T00:00:00",
256+
IsPre: true,
257+
},
258+
// Season 2
259+
{
260+
ID: "Season 2 official - ETH",
261+
GameID: THE_RIOT_GAME_ID,
262+
Denom: "tori",
263+
Decimals: 6,
264+
TotalPrize: 1_200_000,
265+
BossName: "Mr. Jones",
266+
BossImage: "https://bafybeidmr5xascx6pt67qkkarzicpfw7s4pluudbr7a4ekzvcax7g7dawi.ipfs.cf-ipfs.com/",
267+
TopN: 500,
268+
StartsAt: "2024-06-05T00:00:00",
269+
EndsAt: "2024-06-11T00:00:00",
270+
},
271+
// Pre-Season 2
272+
{
273+
ID: "Season 2 - Pre",
274+
GameID: THE_RIOT_GAME_ID,
275+
BossName: `== $*=|'¤?")à-£_%`,
276+
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
277+
StartsAt: "2024-06-11T00:00:00",
278+
EndsAt: "2024-07-01T00:00:00",
279+
IsPre: true,
280+
},
281+
// Season PepeTest
282+
{
283+
ID: "Season PepeTest",
284+
GameID: THE_RIOT_GAME_ID,
285+
Denom: "tori",
286+
Decimals: 6,
287+
TotalPrize: 1_000,
288+
BossName: "PepeTest",
289+
BossImage: "https://bafkreihruz6slyifkknubjr7t3xa555cbc3m3xr7jkapcvlpr2566cywqu.ipfs.cf-ipfs.com/",
290+
TopN: 500,
291+
StartsAt: "2024-07-01T00:00:00",
292+
EndsAt: "2024-07-04T00:00:00",
293+
},
294+
// After PepeTest
295+
{
296+
ID: "Season After PepeTest",
297+
GameID: THE_RIOT_GAME_ID,
298+
BossName: `== $*=|'¤?")à-£_%`,
299+
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
300+
StartsAt: "2024-07-04T00:00:00",
301+
EndsAt: "2025-01-01T00:00:00",
302+
IsPre: true,
303+
},
225304
}

networks.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8761,7 +8761,8 @@
87618761
"toriBridgedTokenAddress": "0x69ded9b7658507ca8c5a6f1f6ff53276802ec228",
87628762
"riotOriginalCollectionIdGen0": "eth-0x8f8304ea566affeb96ad0ffb593bbebd8876d124",
87638763
"riotContractAddressGen0": "0x0e8021622cff2950a35369b336004dea0cd63b5d",
8764-
"riotBridgedNFTAddressGen0": "0xe23b470c8b10f7c98c5016d47bd4f98ce4f819f8"
8764+
"riotBridgedNFTAddressGen0": "0xe23b470c8b10f7c98c5016d47bd4f98ce4f819f8",
8765+
"riotNFTAddressGen0": "0xe23b470c8b10f7c98c5016d47bd4f98ce4f819f8"
87658766
},
87668767
{
87678768
"id": "polygon-mumbai",

packages/networks/polygon/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ export const polygonNetwork: EthereumNetworkInfo = {
3030
"eth-0x8f8304ea566affeb96ad0ffb593bbebd8876d124",
3131
riotContractAddressGen0: "0x0e8021622cff2950a35369b336004dea0cd63b5d",
3232
riotBridgedNFTAddressGen0: "0xe23b470c8b10f7c98c5016d47bd4f98ce4f819f8",
33+
riotNFTAddressGen0: "0xe23b470c8b10f7c98c5016d47bd4f98ce4f819f8",
3334
};

0 commit comments

Comments
 (0)