Skip to content

Commit

Permalink
fix: update generate aragon artifact function to create correct abi s…
Browse files Browse the repository at this point in the history
…ignature
  • Loading branch information
0xGabi committed Oct 28, 2023
1 parent 8eed455 commit 01119d7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/internal/utils/artifact/generateAragonArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ export function generateAragonArtifact(
abi: ethers.utils.Fragment[],
flatCode: string
): AragonArtifact {
const abiBySignature = keyBy(
new ethers.utils.Interface(abi).functions,
(functionFragment: ethers.utils.FunctionFragment) =>
functionFragment.format()
)
const iface = new ethers.utils.Interface(abi)

const contractFunctions = parseContractFunctions(flatCode, contractName, {
onlyTargetContract: true,
})
Expand All @@ -43,7 +40,7 @@ export function generateAragonArtifact(
roles: parsedFn.roles.map((role) => role.id),
notice: parsedFn.notice,
abi:
abiBySignature[parsedFn.sig] ||
iface.getFunction(parsedFn.sig).format("json") ||
(parsedFn.sig === 'fallback()' ? abiFallback : null),
sig: parsedFn.sig,
})),
Expand Down

0 comments on commit 01119d7

Please sign in to comment.