Boost Known Signatures
A registry of known function and event signatures, their 32 byte selectors, and AbiEvents or AbiFunctions
How to use this package
When you're creating a Boost and building out action steps for use with the Event Actions, you'll need to specify the function or event's signature so the protocol knows how to validate that an action has occured in a transaction, and allow a claim to occur.
In order to simplify applications that would otherwise need to know the hex encoded 4 byte function selector, or 32 byte event selector, and their associated ABI items, you can instead use this library to save on code and complexity.
import { events, functions } from '@boostxyz/signatures'
import events from '@boostxyz/signatures/events'
import functions from '@boostxyz/signatures/functions'
type eventsOrFunctionsRegistry = { abi: Record<(Hex | string), AbiItem>, selectors: Record<string, Hex> }
const knownSignature = "Transfer(address indexed,address indexed,uint256 indexed)"
const selector = events.selectors[knownSignature]
const abiItem = events.abi[knownSignature]
const filterOnReceiver: ActionStep = {
chainid: 8453,
signature: selector,
signatureType: SignatureType.EVENT,
targetContract: targetContract,
actionParameter: {
filterType: FilterType.EQUAL,
fieldType: PrimitiveType.ADDRESS,
fieldIndex: 1,
filterData: '0xc0ffee',
},
};
If you've used a function or event signature from @boostxyz/signatures
in the creation of your Boost, then you don't have to do anything else for validation to work.
Otherwise, if you're supplying a custom event signature unknown to @boostxyz/signatures
and running your own validation using the SDK, you'll need to additionally supply your own AbiEvent
to validation so event logs can be correctly pulled off transactions.
await boostCore.validateActionSteps({
knownEvents: {
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef': {
name: "Transfer",
type: "event",
inputs: [
{ type: "address", indexed: true },
{ type: "address", indexed: true },
{ type: "uint256", indexed: true }
]
}
}
})
For more detailed examples, see sample use cases
Contributing new signatures
To integrate your contracts with the Boost V2 Protocol:
The Boost Protocol team will review the submission and promptly release a new version of the @boostxyz/signatures
package so you can continue your Boost Protocol integrations.