Skip to content

Commit

Permalink
Fixing sig hash of interface functions
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Jun 9, 2024
1 parent e753e4d commit 7f868b0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ function xor(a: any, b: any) {
export function interfaceIdOf(int: ethers.Interface): string {
const signatures: string[] = []
int.forEachFunction(f => {
const sighash = ethers.dataSlice(ethers.id(f.format('full')), 0, 4)
const sighash = ethers.dataSlice(ethers.id(f.format('sighash')), 0, 4)
signatures.push(sighash)
})
// const signatures = Object.keys(int.functions)
// .filter(k => k.indexOf('(') !== -1)
// .map(k => int.getSighash(int.functions[k]))

return signatures.reduce((p, c) => xor(p, c))
}

0 comments on commit 7f868b0

Please sign in to comment.