Skip to content

Commit

Permalink
fix: AssemblyScript method
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Jan 6, 2025
1 parent edb3ea6 commit 5490b00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/handlers/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,18 @@ export function handleTransferOwnership(event: OwnershipTransferred): void {
// 0x07bd3522: forwardMetaTx(address _target, bytes calldata _data)
// 0xad718d2a: sponsoredCallV2(address _target,bytes _data,bytes32 _correlationId,bytes32 _r,bytes32 _vs)
// 0x81c9308e: manageCollection(address,address,address,bytes[]) selector
const ALLOWED_SELECTORS = ['0x07bd3522', '0xad718d2a', '0x81c9308e']
const ALLOWED_SELECTORS: string[] = ['0x07bd3522', '0xad718d2a', '0x81c9308e']

/**
* Verify if it's an allowed committee transaction input.
* @param txInput - The transaction input data as a hexadecimal string.
* @returns True if the input starts with an allowed selector, false otherwise.
*/
function isAllowedCommitteeTxInput(txInput: string): boolean {
return ALLOWED_SELECTORS.some(selector => txInput.startsWith(selector))
for (let i = 0; i < ALLOWED_SELECTORS.length; i++) {
if (txInput.startsWith(ALLOWED_SELECTORS[i])) {
return true
}
}
return false
}

0 comments on commit 5490b00

Please sign in to comment.