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来玩Yoink,这是一款部署在Base链上的链上夺旗游戏。从当前持有者手中夺走旗帜即可开始计时。总夺旗次数最多的玩家将持有奖杯。
合约地址: 部署在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字节填充) | (夺旗次数, 时长, 最近夺旗时间) |
| | 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
- Basescan: https://basescan.org/address/0x4bBFD120d9f352A0BEd7a014bd67913a2007a878 (包含ABI、事件、源码)
- 源码地址: https://github.com/horsefacts/yoink-contracts