Skip to content

Commit

Permalink
fix(signatures): pad function selectors to 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Sep 30, 2024
1 parent 64c5ecf commit 6154f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-stingrays-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@boostxyz/signatures": minor
---

pad function selectors to 32 bytes in signatures package
3 changes: 2 additions & 1 deletion packages/signatures/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { parseAbiItem, toEventSelector, toFunctionSelector } from 'viem';
import { pad } from 'viem';
import events from './manifests/events.json' with { type: 'json' };
import functions from './manifests/functions.json' with { type: 'json' };

Expand Down Expand Up @@ -31,7 +32,7 @@ function generateSelector(type, signature) {
case 'event':
return toEventSelector(signature);
case 'function':
return toFunctionSelector(signature);
return pad(toFunctionSelector(signature));
default:
throw new Error(`Invalid type: ${type}`);
}
Expand Down

0 comments on commit 6154f5e

Please sign in to comment.