Skip to content

Commit 6f21288

Browse files
authored
[BOOST-5213] [SDK] allow for 4byte signatures without padding (#375)
1 parent 2897165 commit 6f21288

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.changeset/proud-pianos-pretend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@boostxyz/sdk": minor
3+
---
4+
5+
add padding to 4-byte function selectors in signature

packages/sdk/src/Actions/EventAction.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
fromHex,
2727
isAddress,
2828
isAddressEqual,
29+
pad,
2930
toEventSelector,
3031
zeroAddress,
3132
zeroHash,
@@ -1502,21 +1503,36 @@ export function prepareEventActionPayload({
15021503
],
15031504
[
15041505
{
1505-
actionClaimant: _toRawActionStep(actionClaimant),
1506+
actionClaimant: {
1507+
..._toRawActionStep(actionClaimant),
1508+
signature: pad(actionClaimant.signature),
1509+
},
15061510
actionStepOne: {
1507-
..._toRawActionStep(actionStepOne),
1511+
..._toRawActionStep({
1512+
...actionStepOne,
1513+
signature: pad(actionStepOne.signature),
1514+
}),
15081515
actionType: actionStepOne.actionType || 0,
15091516
},
15101517
actionStepTwo: {
1511-
..._toRawActionStep(actionStepTwo),
1518+
..._toRawActionStep({
1519+
...actionStepTwo,
1520+
signature: pad(actionStepTwo.signature),
1521+
}),
15121522
actionType: actionStepTwo.actionType || 0,
15131523
},
15141524
actionStepThree: {
1515-
..._toRawActionStep(actionStepThree),
1525+
..._toRawActionStep({
1526+
...actionStepThree,
1527+
signature: pad(actionStepThree.signature),
1528+
}),
15161529
actionType: actionStepThree.actionType || 0,
15171530
},
15181531
actionStepFour: {
1519-
..._toRawActionStep(actionStepFour),
1532+
..._toRawActionStep({
1533+
...actionStepFour,
1534+
signature: pad(actionStepFour.signature),
1535+
}),
15201536
actionType: actionStepFour.actionType || 0,
15211537
},
15221538
},

0 commit comments

Comments
 (0)