We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60fb2f0 commit 825d1b8Copy full SHA for 825d1b8
sdks/v4-sdk/src/utils/hook.ts
@@ -97,7 +97,10 @@ export class Hook {
97
}
98
99
private static _hasPermission(address: string, hookOption: HookOptions) {
100
- return !!(parseInt(address, 16) & (1 << hookFlagIndex[hookOption]))
+ // Use only the last 4 bytes (32 bits) to avoid JavaScript precision issues
101
+ // All hook flags are in bits 0-13, which fit comfortably in 32 bits
102
+ const last4Bytes = '0x' + address.slice(-8)
103
+ return !!(parseInt(last4Bytes, 16) & (1 << hookFlagIndex[hookOption]))
104
105
106
private static _checkAddress(address: string) {
0 commit comments