This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,26 @@ export const createAndExecuteProposal = async ({
78
78
// get ABI
79
79
let abi = await getABIFromPolygonscan ( target ) ;
80
80
let iface = new ethers . utils . Interface ( abi ) ;
81
- let events = result . logs . map ( ( log ) => iface . parseLog ( log ) ) ;
81
+ let events = result . logs . map ( ( log ) => {
82
+ try {
83
+ return iface . parseLog ( log ) ;
84
+ } catch ( e ) {
85
+ // no matching event
86
+ }
87
+ } ) ;
88
+ console . log ( `### TARGET ${ target } EVENTS ###` ) ;
82
89
console . log ( events ) ;
90
+ console . log ( `###################################` ) ;
83
91
} ) ;
84
92
85
- let timelockEvents = result . logs . map ( ( log ) => timeLock . interface . parseLog ( log ) ) ;
93
+ let timelockEvents = result . logs . map ( ( log ) => {
94
+ try {
95
+ return timeLock . interface . parseLog ( log ) ;
96
+ } catch ( e ) {
97
+ // no matching event
98
+ }
99
+ } ) ;
100
+ console . log ( `### TIMELOCK EVENTS ###` ) ;
86
101
console . log ( timelockEvents ) ;
87
102
88
103
return proposalId ;
Original file line number Diff line number Diff line change
1
+ import fetch from 'node-fetch' ;
2
+
1
3
export async function getABIFromPolygonscan ( address : string ) {
2
4
if ( process . env . POLYGONSCAN_API_KEY == undefined ) {
3
5
console . log ( 'Require polygonscan key, exiting...' ) ;
You can’t perform that action at this time.
0 commit comments