Task Router Skill
Task Router
Call guide and best practices for the BSC on-chain giveaway contract based on contracts/contracts/Giveaway.sol, including contract address, core method signatures, parameter meanings, and conventions for calling the contract from scripts, frontends, or OpenClow workflows via ethers/web3. Use this skill when you need to create giveaways, claim giveaways, manage whitelists, or withdraw expired giveaways on BSC.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install franckstone/giveaway-skills打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
contracts/contracts/Giveaway.sol
0xc9Db158004fEFe15633eF2Ac3C3eA209e58Db5B9
IERC20, Ownable, ReentrancyGuard, internal TransferHelper libraryAssumptions when calling:
https://bsc-dataseed.binance.org)DistributionType
0 = AVERAGE: equal share, each claim gets amount / count
1 = RANDOM: random share, a single claim is roughly in the range (0 \sim 2 \times) the averageClaimRestriction
0 = PUBLIC: public, no additional restriction1 = TOKEN_HOLDER: only addresses holding restrictionToken with balance ≥ minTokenBalance
2 = WHITELIST: only whitelisted addresses can claimGiveawayInfo
token: token address for the giveaway, address(0) means BNBsender: creator addressamount: current remaining total giveaway amount in the contract (after creation fee is deducted)count: current remaining claimable slotsdistributionType: distribution type (0/1)restriction: claim restriction type (0/1/2)restrictionToken: restriction token address (only meaningful for TOKEN_HOLDER)minTokenBalance: minimum token balance requiredlastDate: expiration timestamp (seconds)createGiveawaySignature:
function createGiveaway(
address token,
uint256 amount,
uint256 count,
DistributionType distributionType,
ClaimRestriction restriction,
address restrictionToken,
uint256 minTokenBalance,
string memory content,
uint256 lastDate
) public payable
Key constraints:
bytes(content).length < 128
amount > 0
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# BSC Giveaway Contract Call Skill
## 1. Deployment information
- **Network**: BSC (Binance Smart Chain mainnet, chainId = 56)
- **Contract file**: `contracts/contracts/Giveaway.sol`
- **Contract address**: `0xc9Db158004fEFe15633eF2Ac3C3eA209e58Db5B9`
- **Main dependencies**: `IERC20`, `Ownable`, `ReentrancyGuard`, internal `TransferHelper` library
Assumptions when calling:
- You are already connected to a BSC mainnet RPC (for example `https://bsc-dataseed.binance.org`)
- Account balance and gas settings are handled by the caller
## 2. Core enums and structs (pass as uint in calls)
**DistributionType**
- `0` = AVERAGE: equal share, each claim gets `amount / count`
- `1` = RANDOM: random share, a single claim is roughly in the range \(0 \sim 2 \times\) the average
**ClaimRestriction**
- `0` = PUBLIC: public, no additional restriction
- `1` = TOKEN_HOLDER: only addresses holding `restrictionToken` with balance ≥ `minTokenBalance`
- `2` = WHITELIST: only whitelisted addresses can claim
**GiveawayInfo**
- `token`: token address for the giveaway, `address(0)` means BNB
- `sender`: creator address
- `amount`: current remaining total giveaway amount in the contract (after creation fee is deducted)
- `count`: current remaining claimable slots
- `distributionType`: distribution type (0/1)
- `restriction`: claim restriction type (0/1/2)
- `restrictionToken`: restriction token address (only meaningful for TOKEN_HOLDER)
- `minTokenBalance`: minimum token balance required
- `lastDate`: expiration timestamp (seconds)
## 3. Write function cheatsheet
### 3.1 Create giveaway `createGiveaway`
Signature:
```solidity
function createGiveaway(
address token,
uint256 amount,
uint256 count,
DistributionType distributionType,
ClaimRestriction restriction,
address restrictionToken,
uint256 minTokenBalance,
string memory content,
uint256 lastDate
) public payable
```
Key constraints:
- `bytes(content).length < 128`
- `amount > 0`
- `amount / cou...Task Router
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.