Skip to content

Commit

Permalink
permissions: add method params
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Sep 22, 2023
1 parent 2b62e47 commit 3b3768d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/build-permissions-dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ function processInterfaces(path: string): void {
data.abi
.filter((input) => input.type === 'function')
.filter((input) => input.stateMutability === 'nonpayable')
.forEach((input) => (FUNCTIONS[iface.getSighash(input.name)] = input.name))
.forEach((input) => (FUNCTIONS[iface.getSighash(input.name)] = functionDefinition(input.name, input.inputs)))
}

function functionDefinition(name: string, inputs: { type: string; name: string }[]): string {
const args = inputs.map((input) => `${input.type} ${input.name}`).join(', ')
return `${name}(${args})`
}

function writeOutput(): void {
Expand Down

0 comments on commit 3b3768d

Please sign in to comment.