yoink
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYoink
Yoink
Play Yoink, an onchain capture-the-flag game on Base. Yoink the flag from the current holder to start your clock. The player with the most total yoinks holds the trophy.
Contract: on Base (chain ID 8453)
0x4bBFD120d9f352A0BEd7a014bd67913a2007a878在Base链上游玩Yoink这款链上夺旗游戏。从当前持有者手中夺取旗帜即可开始计时。累计夺取次数最多的玩家将持有奖杯。
合约地址: Base链(链ID 8453)上的
0x4bBFD120d9f352A0BEd7a014bd67913a2007a878Game Rules
游戏规则
- Yoink the flag - Call to take the flag from the current holder
yoink() - Cooldown - You must wait 10 minutes (600 seconds) between yoinks
- No self-yoink - You cannot yoink from yourself
- Accumulate time - While you hold the flag, your time score increases
- Compete for trophy - The player with the most total yoinks holds the trophy (token ID 2)
- Track yoinks - Your total yoink count is tracked separately from time
- 夺取旗帜 - 调用函数从当前持有者手中夺取旗帜
yoink() - 冷却时间 - 两次夺取操作之间必须等待10分钟(600秒)
- 禁止自夺 - 你不能从自己手中夺取旗帜
- 累计时长 - 当你持有旗帜时,你的时长分数会持续增加
- 争夺奖杯 - 累计夺取次数最多的玩家将持有奖杯(代币ID 2)
- 追踪夺取次数 - 你的累计夺取次数与时长分数分开统计
Contract Interface
合约接口
RPC template:
bash
curl -s -X POST https://mainnet.base.org -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x4bBFD120d9f352A0BEd7a014bd67913a2007a878","data":"SELECTOR+PARAMS"},"latest"],"id":1}' | jq -r '.result'| Function | Selector | Params | Returns |
|---|---|---|---|
| | - | (write) |
| | - | address |
| | - | uint256 timestamp |
| | - | uint256 |
| | - | address (trophy holder) |
| | - | uint256 (record) |
| | - | uint256 (600) |
| | addr (32B padded) | (yoinks, time, lastYoinkedAt) |
| | addr + tokenId | uint256 (FLAG_ID=1, TROPHY_ID=2) |
Encoding: Addresses are zero-padded to 32 bytes. returns 96 bytes (3 × uint256).
score()RPC模板:
bash
curl -s -X POST https://mainnet.base.org -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x4bBFD120d9f352A0BEd7a014bd67913a2007a878","data":"SELECTOR+PARAMS"},"latest"],"id":1}' | jq -r '.result'| 函数 | 选择器 | 参数 | 返回值 |
|---|---|---|---|
| | - | (写入型) |
| | - | address |
| | - | uint256 时间戳 |
| | - | uint256 |
| | - | address(奖杯持有者) |
| | - | uint256(记录值) |
| | - | uint256(600) |
| | addr(32字节填充) | (yoinks, time, lastYoinkedAt) |
| | addr + tokenId | uint256(FLAG_ID=1,TROPHY_ID=2) |
编码规则: 地址需零填充至32字节。函数返回96字节(3个uint256类型值)。
score()Yoinking
夺取操作
Use Bankr's arbitrary transaction feature:
{
"to": "0x4bBFD120d9f352A0BEd7a014bd67913a2007a878",
"data": "0x9846cd9e",
"value": "0",
"chainId": 8453
}使用Bankr的任意交易功能:
{
"to": "0x4bBFD120d9f352A0BEd7a014bd67913a2007a878",
"data": "0x9846cd9e",
"value": "0",
"chainId": 8453
}Errors
错误信息
| Error | Selector | Meaning |
|---|---|---|
| | Cooldown not elapsed. Param = seconds remaining. |
| | You already hold the flag. |
Cooldown check:
current_time - lastYoinkedAt() >= 600| 错误类型 | 选择器 | 含义 |
|---|---|---|
| | 冷却时间未结束。参数=剩余秒数。 |
| | 你当前已持有旗帜。 |
冷却时间检查:
current_time - lastYoinkedAt() >= 600Workflow
操作流程
- Query and
lastYoinkedBy()to check status/cooldownlastYoinkedAt() - Ensure cooldown elapsed (600s) and you're not current holder
- Submit yoink transaction via Bankr
- Verify with or
lastYoinkedBy()score(address)
- 调用和
lastYoinkedBy()查询状态/冷却时间lastYoinkedAt() - 确保冷却时间已过(600秒)且你不是当前旗帜持有者
- 通过Bankr提交夺取交易
- 调用或
lastYoinkedBy()验证操作结果score(address)
Resources
相关资源
- Basescan: https://basescan.org/address/0x4bBFD120d9f352A0BEd7a014bd67913a2007a878 (ABI, events, source)
- Source Code: https://github.com/horsefacts/yoink-contracts