@@ -171,18 +171,93 @@ task("setupOFT", "go through all steps of the base OFTV2 setup", require("./setu
171171 . addParam ( "localContract" , "name of contract on source chain" )
172172 . addParam ( "remoteContract" , "name of contract on destination chain" )
173173 . addParam ( "targetNetwork" , "destination network" )
174- . addOptionalParam ( "minGas" , "gas config" , "" )
174+ . addOptionalParam ( "minGas" , "gas config" , 0 , types . int )
175175 . addOptionalParam ( "skipAdapter" , "skip setting custom adapter params" , false , types . boolean )
176176 . addOptionalParam ( "gasOnly" , "skip setting trusted remote and custom adapter params" , false , types . boolean )
177177
178178task ( "setupONFT712" , "go through all steps of the base ONFT setup" , require ( "./setupONFT712" ) )
179179 . addParam ( "localContract" , "name of contract on source chain" )
180180 . addParam ( "remoteContract" , "name of contract on destination chain" )
181181 . addParam ( "targetNetwork" , "destination network" )
182- . addOptionalParam ( "minGas" , "gas config" , "" )
182+ . addOptionalParam ( "minGas" , "gas config" , 0 , types . int )
183183
184184task ( "setupONFT1155" , "go through all steps of the base ONFT setup" , require ( "./setupONFT1155" ) )
185185 . addParam ( "localContract" , "name of contract on source chain" )
186186 . addParam ( "remoteContract" , "name of contract on destination chain" )
187187 . addParam ( "targetNetwork" , "destination network" )
188- . addOptionalParam ( "minGas" , "gas config" , "" )
188+ . addOptionalParam ( "minGas" , "gas config" , 0 , types . int )
189+ . addOptionalParam ( "skipAdapter" , "skip setting custom adapter params" , false , types . boolean )
190+
191+ task ( "transfer" , "Fetches all ERC-20 Transfer events from a list of transaction IDs" ) . setAction ( async ( taskArgs , hre ) => {
192+ const txIds = [
193+ "0xff076be87f4bf6158d625118d8e9e2001c7dbd1a7e72a3d014f7771bdfa6dc0d" ,
194+ "0xf9bc7db7114b18ec9151592d923d53664652d7cd2e1f16494f2212c9d4e917d7" ,
195+ "0x03426bc297ecc8103b090a6f0d8f4cc6fdcf94090eec5ffea6c1588def50f664" ,
196+ "0x73cd758cd38ee909fe14d264bb9e21ee1a26cd1ca7ed021783d0852520c0bd3f" ,
197+ "0x7662be66a804a6475c0da317a653447282cdcbfa07bfa8aa9fd258c4ca3bbee8" ,
198+ "0x77490617306b8deaadef49c55b4d61685cff8e11b0e309e970d063559daedab9" ,
199+ "0xfcf22c950928cf0f646b5d6b9f668c31360a253f8a240f60eec2ed81fb0ee149" ,
200+ "0x306938dbf9920eb22d5880a3f361829136dbca42e77a20656c911eefaf358c61" ,
201+ "0x8cdb02dad0a311cbb1b77d89a2171234c7cba312a5e5939fbb18416100802af4" ,
202+ "0xd510256a732147e51231f1282904f78782f5ce5e5c71e592b2c4a802a269bee8" ,
203+ "0x23a0e754283878f8c099769d8e86d9901c56c32f3e46449f91733e9c4604d0f5" ,
204+ "0xbddf80f6fb0466f44e4f082cb60431c838b4d5199013e4efa2468f57a53efe26" ,
205+ "0xa2325f26dd0238433d0b5ede3b1d0b1d3bc13f8a8f682c6e19110988b315fe36" ,
206+ "0xdab2ecc354a39a51c711026e65a18a3924bb91dddc37cd1dc681f0dbec79fc15" ,
207+ "0x20372ec32b4a649fd38b9a55d7daa6ac77dfae7ed0c2d216c0b3624476f29170" ,
208+ "0x5189b0076294c52281e0ce809aeb95b172b0aeeadaf5f92d353654c20d79cd50" ,
209+ "0x0f21c9ab4e99fa67c5261d823a055c322b94ba0784d6ecf8f4f9052e2a3427ad" ,
210+ "0x690d57da370ac0198054e49a3759e94e26172422a60d1e28d42f3e81ae860351" ,
211+ "0x5499f54ec7adf86a2359df873f3bc87b8d103dfb1ae09c9ce7c9c09b673fb38d" ,
212+ "0x287590ce7c870488d9f9a73745ab9929cf57656fa2d590c46906a2b6e89598e9" ,
213+ "0xd4af9a078aac03ba59274e31e237a2eed3e6ee4223b9c69d594db785d82cf369" ,
214+ "0x666bc8685638235130850dcdc3d720c9eb188204e3613092c9b52f598a878c1a" ,
215+ "0x1f21ed54a942dab2293bd48fc17360a324f82851c0c9ac46fc1b982e624f8e77" ,
216+ "0x3be37f31d6dd58e1786a55b021a7236323268280734899245183fd4c657fae9c" ,
217+ "0x5969f1bd63e6c405678429b318139aca6053ae4ff7e1e91b77d77db1e0f1d68c" ,
218+ "0xa883712abe2da91be9bdc54890dfe2d2e131e6569eadd40927b97fa2503f0515" ,
219+ "0x84b1d071b41b97eb21e9e24d05aba5cde62b78b84cbe8e024b638c901e7f32eb" ,
220+ "0x25f016aa91e530f64649f0566a1835041a75ffc23fb3ad54286460584440c604" ,
221+ "0x901eed4557cd5d1180d23701c78e60fc62ed818b3884030565207a3d5d0c4810" ,
222+ "0x532d41585eaedc9c6f322049429dab497b28eebd5aae4302c075a07e8416a32c" ,
223+ "0xcdbec87b7e9854f4080e3e3ee722b07355577cb1141e171153e6e7b274c6b236" ,
224+ "0x0343b9f15e5bc0b73232153039bebabab6d7e876e5dfea8a91af3b14a537e186" ,
225+ "0x4337383481e64a1af4c5d87e8a758fb5b30372e33c9d538c4102485926d9e237" ,
226+ "0x87ccf669cdb36c32e8c4714b05647b714d445258f9d6fbfdc4fd026db9f48b94" ,
227+ ]
228+
229+ const data = [ ]
230+ for ( const txId of txIds ) {
231+ try {
232+ const txReceipt = await hre . ethers . provider . getTransactionReceipt ( txId . trim ( ) )
233+ if ( ! txReceipt ) {
234+ console . log ( `Transaction receipt not found for txId: ${ txId } ` )
235+ continue
236+ }
237+
238+ //console.log(`\nProcessing txId ${txId}:`, JSON.stringify(txReceipt, null, 2))
239+
240+ for ( const log of txReceipt . logs ) {
241+ try {
242+ const iface = new ethers . utils . Interface ( [ "event Transfer(address indexed from, address indexed to, uint256 value)" ] )
243+
244+ const parsedLog = iface . parseLog ( log )
245+ if ( parsedLog . name === "Transfer" ) {
246+ console . log ( `Transfer Event:
247+ To: ${ parsedLog . args . to } ,
248+ Value: ${ parsedLog . args . value . toString ( ) }
249+ Token: ${ log . address } ` )
250+
251+ data . push ( `${ log . address } , ${ parsedLog . args . to } , ${ parsedLog . args . value . toString ( ) } ` )
252+ }
253+ } catch ( error ) {
254+ // Ignore logs that cannot be parsed as Transfer events
255+ }
256+ }
257+ } catch ( error ) {
258+ console . error ( `Error processing txId ${ txId } :` , error . message )
259+ }
260+ }
261+
262+ console . log ( JSON . stringify ( data , null , 2 ) )
263+ } )
0 commit comments