Skip to content

Commit 6175c85

Browse files
committed
update
1 parent 35de40c commit 6175c85

File tree

1 file changed

+55
-24
lines changed

1 file changed

+55
-24
lines changed

receipts/token_transfers_test.go

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,74 @@ import (
1313

1414
func TestFetchReceiptTokenTransfers(t *testing.T) {
1515

16-
t.Run("ERC20 Transfer on Arbitrum", func(t *testing.T) {
17-
// https://arbiscan.io/tx/0xb88cc2fea7cd26c88e169f6244fea76f590fc0797ba4c424669d1b74643f1dc9
18-
provider, err := ethrpc.NewProvider("https://nodes.sequence.app/arbitrum")
19-
require.NoError(t, err)
16+
// TODO: lets find a very simple metamask erc20 transfer, and check it in the test
17+
// https://arbiscan.io/tx/0x6753a97203d159702e594662729b06608cf3b9c99c0cce177b9d7b66e6456150
2018

21-
txnHash := common.HexToHash("0xb88cc2fea7cd26c88e169f6244fea76f590fc0797ba4c424669d1b74643f1dc9")
19+
// TODO2: a txn with a bunch of different erc20 transfers inside of it, ie. batch send
20+
// this is a sequence v2 send of usdc and magic on arbitrum.. batch send
21+
// https://arbiscan.io/tx/0x65c70290232207a21ef6805ae50622def8d52b7a8f381e1c3eac24d5423e0657
2222

23-
// TODO: lets find a very simple metamask erc20 transfer, and check it in the test
24-
// TODO2: find a batch of different erc20 transfers to test against.. for example
25-
// its possible there can be multiple erc20 transfers in a single tx that come and go from an individual
26-
// so what we want to see is the delta, the diff, etc. .. aka, the "Result" .. aka... "TokenTransferResult"
27-
// and not just all of the TokenTransferLogs ..
28-
// TODO3: vault bridge USDC .. lets check the token transfer event, prob just erc20 too
23+
// TODO3: a trails intent call, with bunch of other actions inside of the txn, including erc20 transfers
24+
// https://arbiscan.io/tx/0xb88cc2fea7cd26c88e169f6244fea76f590fc0797ba4c424669d1b74643f1dc9
25+
// .. lets get another one using zerox + cctp for example
2926

30-
receipt, transfers, err := receipts.FetchReceiptTokenTransfers(context.Background(), provider, txnHash)
31-
require.NoError(t, err)
32-
require.NotNil(t, receipt)
33-
require.Greater(t, len(transfers), 0)
27+
// TODO4: vault bridge USDC .. lets check the token transfer event, prob just erc20 too
28+
// https://katanascan.com/tx/0x7bcd0068a5c3352cf4e1d75c7c4f78d99f02b8b2f5f96b2c407972f43e724f52
3429

35-
spew.Dump(transfers)
36-
37-
})
30+
// TODO5: polygon POL LogTransfer event
31+
// https://polygonscan.com/tx/0x252419983224542bfb07dab75808fa57186a7a269d0d267ae655eb7ef037fdd5
3832

39-
t.Run("Polygon POL LogTransfer", func(t *testing.T) {
40-
t.Skip("POL")
33+
// TODO6: bunch of logs for the same erc20 token, and we need to sum it up, ie. a big uniswap call
34+
// and we have to do a delta/diff, and return the "result" maybe "TokenTransferResult" ?
35+
// https://etherscan.io/tx/0xb11ff491495e145b07a1d3cc304f7d04b235b80af51b50da9a54095a6882fca4
4136

42-
// txnHash := https://polygonscan.com/tx/0x252419983224542bfb07dab75808fa57186a7a269d0d267ae655eb7ef037fdd5
43-
provider, err := ethrpc.NewProvider("https://nodes.sequence.app/polygon")
37+
// Test 1: Simple ERC20 Transfer via EOA, which shows just a simple transfer event
38+
// https://arbiscan.io/tx/0x6753a97203d159702e594662729b06608cf3b9c99c0cce177b9d7b66e6456150
39+
t.Run("Simple ERC20 Transfer via EOA", func(t *testing.T) {
40+
provider, err := ethrpc.NewProvider("https://nodes.sequence.app/arbitrum")
4441
require.NoError(t, err)
4542

46-
txnHash := common.HexToHash("0x252419983224542bfb07dab75808fa57186a7a269d0d267ae655eb7ef037fdd5")
47-
43+
txnHash := common.HexToHash("0x6753a97203d159702e594662729b06608cf3b9c99c0cce177b9d7b66e6456150")
4844
receipt, transfers, err := receipts.FetchReceiptTokenTransfers(context.Background(), provider, txnHash)
4945
require.NoError(t, err)
5046
require.NotNil(t, receipt)
5147
require.Greater(t, len(transfers), 0)
5248

5349
spew.Dump(transfers)
5450
})
51+
52+
//--
53+
54+
// t.Run("Simple ERC20 Transfer", func(t *testing.T) {
55+
// // https://arbiscan.io/tx/0xb88cc2fea7cd26c88e169f6244fea76f590fc0797ba4c424669d1b74643f1dc9
56+
// provider, err := ethrpc.NewProvider("https://nodes.sequence.app/arbitrum")
57+
// require.NoError(t, err)
58+
59+
// txnHash := common.HexToHash("0xb88cc2fea7cd26c88e169f6244fea76f590fc0797ba4c424669d1b74643f1dc9")
60+
61+
// receipt, transfers, err := receipts.FetchReceiptTokenTransfers(context.Background(), provider, txnHash)
62+
// require.NoError(t, err)
63+
// require.NotNil(t, receipt)
64+
// require.Greater(t, len(transfers), 0)
65+
66+
// spew.Dump(transfers)
67+
68+
// })
69+
70+
// t.Run("Polygon POL LogTransfer", func(t *testing.T) {
71+
// t.Skip("POL")
72+
73+
// // txnHash := https://polygonscan.com/tx/0x252419983224542bfb07dab75808fa57186a7a269d0d267ae655eb7ef037fdd5
74+
// provider, err := ethrpc.NewProvider("https://nodes.sequence.app/polygon")
75+
// require.NoError(t, err)
76+
77+
// txnHash := common.HexToHash("0x252419983224542bfb07dab75808fa57186a7a269d0d267ae655eb7ef037fdd5")
78+
79+
// receipt, transfers, err := receipts.FetchReceiptTokenTransfers(context.Background(), provider, txnHash)
80+
// require.NoError(t, err)
81+
// require.NotNil(t, receipt)
82+
// require.Greater(t, len(transfers), 0)
83+
84+
// spew.Dump(transfers)
85+
// })
5586
}

0 commit comments

Comments
 (0)