@@ -89,98 +89,86 @@ type chain struct {
89
89
SupportsNFTView bool
90
90
}
91
91
92
- var chains = map [int64 ]chain {
92
+ var chains = map [tableland.ChainID ]chain {
93
+ // Ethereum
93
94
1 : {
94
- ID : 1 ,
95
- Name : "Ethereum" ,
96
95
ContractAddr : common .HexToAddress ("0x012969f7e3439a9B04025b5a049EB9BAD82A8C12" ),
97
96
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/ethereum" ,
98
97
BlockExplorerURL : "https://etherscan.io" ,
99
98
SupportsNFTView : true ,
100
99
},
100
+ // Optimism
101
101
10 : {
102
- ID : 10 ,
103
- Name : "Optimism" ,
104
102
ContractAddr : common .HexToAddress ("0xfad44BF5B843dE943a09D4f3E84949A11d3aa3e6" ),
105
103
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/optimism" ,
106
104
BlockExplorerURL : "https://optimistic.etherscan.io" ,
107
105
SupportsNFTView : false ,
108
106
},
107
+ // Polygon
109
108
137 : {
110
- ID : 137 ,
111
- Name : "Polygon" ,
112
109
ContractAddr : common .HexToAddress ("0x5c4e6A9e5C1e1BF445A062006faF19EA6c49aFeA" ),
113
110
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/polygon" ,
114
111
BlockExplorerURL : "https://polygonscan.com" ,
115
112
SupportsNFTView : false ,
116
113
},
114
+ // Arbitrum One
117
115
42161 : {
118
- ID : 42161 ,
119
- Name : "Arbitrum" ,
120
116
ContractAddr : common .HexToAddress ("0x9aBd75E8640871A5a20d3B4eE6330a04c962aFfd" ),
121
117
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/arbitrum" ,
122
118
BlockExplorerURL : "https://arbiscan.io" ,
123
119
SupportsNFTView : false ,
124
120
},
121
+ // Arbitrum Nova
125
122
42170 : {
126
- ID : 42170 ,
127
- Name : "Arbitrum Nova" ,
128
123
ContractAddr : common .HexToAddress ("0x1a22854c5b1642760a827f20137a67930ae108d2" ),
129
124
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/arbitrum" ,
130
125
BlockExplorerURL : "https://nova.arbiscan.io" ,
131
126
SupportsNFTView : false ,
132
127
},
128
+ // Filecoin
133
129
314 : {
134
- ID : 314 ,
135
- Name : "Filecoin" ,
136
130
ContractAddr : common .HexToAddress ("0x59EF8Bf2d6c102B4c42AEf9189e1a9F0ABfD652d" ),
137
131
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/Filecoin" ,
138
132
BlockExplorerURL : "https://filfox.info/en" ,
139
133
SupportsNFTView : false ,
140
134
},
135
+ // Goerli
141
136
5 : {
142
- ID : 5 ,
143
- Name : "Ethereum Goerli" ,
144
137
ContractAddr : common .HexToAddress ("0xDA8EA22d092307874f30A1F277D1388dca0BA97a" ),
145
138
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/ethereum" ,
146
139
BlockExplorerURL : "https://goerli.etherscan.io" ,
147
140
SupportsNFTView : true ,
148
141
},
142
+ // Sepolia
149
143
11155111 : {
150
- ID : 11155111 ,
151
- Name : "Ethereum Sepolia" ,
152
144
ContractAddr : common .HexToAddress ("0xc50C62498448ACc8dBdE43DA77f8D5D2E2c7597D" ),
153
145
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/ethereum" ,
154
146
BlockExplorerURL : "https://sepolia.etherscan.io" ,
155
147
SupportsNFTView : true ,
156
148
},
149
+ // Optimism Goerli
157
150
420 : {
158
- ID : 420 ,
159
- Name : "Optimism Goerli" ,
160
151
ContractAddr : common .HexToAddress ("0xC72E8a7Be04f2469f8C2dB3F1BdF69A7D516aBbA" ),
161
152
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/optimism" ,
162
153
BlockExplorerURL : "https://blockscout.com/optimism/goerli" ,
163
154
SupportsNFTView : false ,
164
155
},
156
+ // Arbitrum Goerli
165
157
421613 : {
166
- ID : 421613 ,
167
- Name : "Arbitrum Goerli" ,
168
158
ContractAddr : common .HexToAddress ("0x033f69e8d119205089Ab15D340F5b797732f646b" ),
169
159
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/arbitrum" ,
170
160
BlockExplorerURL : "https://goerli-rollup-explorer.arbitrum.io" ,
171
161
SupportsNFTView : false ,
172
162
},
163
+ // Filecoin Calibration
173
164
314159 : {
174
- ID : 314159 ,
175
- Name : "Filecoin Calibration" ,
176
165
ContractAddr : common .HexToAddress ("0x030BCf3D50cad04c2e57391B12740982A9308621" ),
177
166
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/Filecoin" ,
178
167
BlockExplorerURL : "https://calibration.filfox.info/en" ,
179
168
SupportsNFTView : false ,
180
169
},
170
+ // Polygon Mumbai
181
171
80001 : {
182
- ID : 80001 ,
183
- Name : "Polygon Mumbai" ,
184
172
ContractAddr : common .HexToAddress ("0x4b48841d4b32C4650E4ABc117A03FE8B51f38F68" ),
185
173
TBLDocsURL : "https://docs.tableland.xyz/fundamentals/chains/polygon" ,
186
174
BlockExplorerURL : "https://mumbai.polygonscan.com" ,
@@ -202,12 +190,13 @@ type webhookContentData struct {
202
190
// getTableNFTViews returns the NFT views for the given table IDs.
203
191
func getTableNFTViews (tableIDs tables.TableIDs , chainID tableland.ChainID ) string {
204
192
var tableNFTURLs []string
193
+ ch := chains [chainID ]
205
194
for _ , tableID := range tableIDs {
206
- if ! chains [ int64 ( chainID )] .SupportsNFTView {
195
+ if ! ch .SupportsNFTView {
207
196
tableNFTURLs = append (tableNFTURLs , tableID .String ())
208
197
} else {
209
- blockExplorerURL := chains [ int64 ( chainID )] .BlockExplorerURL
210
- contractAddr := chains [ int64 ( chainID )] .ContractAddr
198
+ blockExplorerURL := ch .BlockExplorerURL
199
+ contractAddr := ch .ContractAddr
211
200
tableNFTURLs = append (tableNFTURLs ,
212
201
fmt .Sprintf ("[%s](%s/nft/%s/%s)" , tableID .String (),
213
202
blockExplorerURL , contractAddr , tableID .String ()))
@@ -224,8 +213,8 @@ func content(r eventprocessor.Receipt) (string, error) {
224
213
return "" , fmt .Errorf ("failed to parse template: %v" , err )
225
214
}
226
215
227
- txnURL := chains [int64 ( r .ChainID ) ].BlockExplorerURL + "/tx/" + r .TxnHash
228
- docsURL := chains [int64 ( r .ChainID ) ].TBLDocsURL
216
+ txnURL := chains [r .ChainID ].BlockExplorerURL + "/tx/" + r .TxnHash
217
+ docsURL := chains [r .ChainID ].TBLDocsURL
229
218
err = tmpl .Execute (& c , webhookContentData {
230
219
ChainID : r .ChainID ,
231
220
TBLDocsURL : docsURL ,
0 commit comments