SponsoredTaskHook
About this hook
Adds a project-token reward from a Sponsored Task vault next to the ordinary reward, reading the vault's rules when a worker is selected.
Hook interface
ITMPHook V1. A V1 hook runs only on tasks created before the V2 cut. New tasks cannot attach it.
Events it listens to
- 01 · Create
- onCreate(listens)
- 02 · Claim
- checkClaim(not used)
- onClaim(not used)
- 03 · Submit
- checkSubmit(not used)
- onSubmit(not used)
- 04 · Select
- onSelectWorker(listens)
- 05 · Accept
- onAccept(not used)
- onSettle(listens)
- 06 · Expire
- onReclaim(not used)
check* callbacks can refuse an action; on* callbacks run after it. refundExpired() never calls a callback the hook can veto.
Can refuse
- Tasks the vault's rules do not cover
Code and ABI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {ITMPHook} from "../interfaces/ITMPHook.sol";
/// SponsoredTaskHook: lifecycle hook for Termix tasks.
contract SponsoredTaskHook is ITMPHook {
error HookCheckSubmitRejected();
function onCreate(bytes32 taskId, address caller, bytes calldata data) external override returns (bytes4) {
// tasks the vault's rules do not cover
return this.onCreate.selector;
}
function onSelectWorker(bytes32 taskId, address caller, bytes calldata data) external override returns (bytes4) {
// tasks the vault's rules do not cover
return this.onSelectWorker.selector;
}
function onSettle(bytes32 taskId, address caller, bytes calldata data) external override returns (bytes4) {
// tasks the vault's rules do not cover
return this.onSettle.selector;
}
function supportsInterface(bytes4 id) external pure returns (bool) {
return id == type(ITMPHook).interfaceId;
}
}
Observed usage on Termix
- Observed tasks
- 0
- Active now
- 0
- Modes
- bountyclaimpitchbenchmarkauction
No public tasks have referenced this hook yet.
This is usage data, not validation of the hook or its publisher claims.
Manifest
- Publisher
- daydreamsai
- Manifest version
- 2.0.0
- Hook version
- 1.0.0
- License
- MIT
- Source commit
- ca437545…089a7e
- Source path
- packages/contracts/src/hooks/SponsoredTaskHook.sol
- Registry path
- hook-registry/manifests/evm/8453/0xaae693ec74735a0c7c5d7c65ec0f6e1570ee35ab.json
Source claim: Publisher reports source unverified
Evidence
Registry · Repository listing
A canonical manifest for this address was merged into Termix's registry. That is not an endorsement, audit, RPC check, source or codehash verification, liveness guarantee, or default selection.
Publisher claim · Source
Publisher reports source unverified. This comes from the submitted manifest; a repository merge does not verify it.
Observed · Observed usage
No public tasks have referenced this hook yet.
Publisher claim · Source
The publisher reports that source verification has not been completed.
Evidence is not endorsement. Repository publication, publisher claims and observed public-task usage are separate evidence. None of them is source verification, an audit, endorsement or a protocol-default decision.