Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit adb2eae

Browse files
committed
Modify parsing if contract is proxy
1 parent bfcbdf9 commit adb2eae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

shared/Governance.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ export const createAndExecuteProposal = async ({
6363

6464
for (let i = 0; i < targets.length; i++) {
6565
let abi = await getABIFromPolygonscan(targets[i]);
66+
// is proxy contract, need to fetch implementation
67+
if (JSON.stringify(abi).includes("implementation")) {
68+
let proxy = new ethers.Contract(targets[i], abi, user);
69+
console.log(await proxy.implementation())
70+
abi = await getABIFromPolygonscan(await proxy.implementation());
71+
}
6672
let iface = new ethers.utils.Interface(abi);
6773
let events = result.logs.map((log) => {
6874
try {

0 commit comments

Comments
 (0)