yoink

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Yoink

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:
0x4bBFD120d9f352A0BEd7a014bd67913a2007a878
on Base (chain ID 8453)
在Base链上游玩Yoink这款链上夺旗游戏。从当前持有者手中夺取旗帜即可开始计时。累计夺取次数最多的玩家将持有奖杯。
合约地址: Base链(链ID 8453)上的
0x4bBFD120d9f352A0BEd7a014bd67913a2007a878

Game Rules

游戏规则

  1. Yoink the flag - Call
    yoink()
    to take the flag from the current holder
  2. Cooldown - You must wait 10 minutes (600 seconds) between yoinks
  3. No self-yoink - You cannot yoink from yourself
  4. Accumulate time - While you hold the flag, your time score increases
  5. Compete for trophy - The player with the most total yoinks holds the trophy (token ID 2)
  6. Track yoinks - Your total yoink count is tracked separately from time
  1. 夺取旗帜 - 调用
    yoink()
    函数从当前持有者手中夺取旗帜
  2. 冷却时间 - 两次夺取操作之间必须等待10分钟(600秒)
  3. 禁止自夺 - 你不能从自己手中夺取旗帜
  4. 累计时长 - 当你持有旗帜时,你的时长分数会持续增加
  5. 争夺奖杯 - 累计夺取次数最多的玩家将持有奖杯(代币ID 2)
  6. 追踪夺取次数 - 你的累计夺取次数与时长分数分开统计

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'
FunctionSelectorParamsReturns
yoink()
0x9846cd9e
-(write)
lastYoinkedBy()
0xd4dbf9f4
-address
lastYoinkedAt()
0x6a99616f
-uint256 timestamp
totalYoinks()
0xa5d0dadd
-uint256
topYoinker()
0x6a974e6e
-address (trophy holder)
mostYoinks()
0xd2d7774a
-uint256 (record)
COOLDOWN()
0xa2724a4d
-uint256 (600)
score(address)
0x776f3843
addr (32B padded)(yoinks, time, lastYoinkedAt)
balanceOf(address,uint256)
0x00fdd58e
addr + tokenIduint256 (FLAG_ID=1, TROPHY_ID=2)
Encoding: Addresses are zero-padded to 32 bytes.
score()
returns 96 bytes (3 × uint256).
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'
函数选择器参数返回值
yoink()
0x9846cd9e
-(写入型)
lastYoinkedBy()
0xd4dbf9f4
-address
lastYoinkedAt()
0x6a99616f
-uint256 时间戳
totalYoinks()
0xa5d0dadd
-uint256
topYoinker()
0x6a974e6e
-address(奖杯持有者)
mostYoinks()
0xd2d7774a
-uint256(记录值)
COOLDOWN()
0xa2724a4d
-uint256(600)
score(address)
0x776f3843
addr(32字节填充)(yoinks, time, lastYoinkedAt)
balanceOf(address,uint256)
0x00fdd58e
addr + tokenIduint256(FLAG_ID=1,TROPHY_ID=2)
编码规则: 地址需零填充至32字节。
score()
函数返回96字节(3个uint256类型值)。

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

错误信息

ErrorSelectorMeaning
SlowDown(uint256)
0x58d6f4c6
Cooldown not elapsed. Param = seconds remaining.
Unauthorized()
0x82b42900
You already hold the flag.
Cooldown check:
current_time - lastYoinkedAt() >= 600
错误类型选择器含义
SlowDown(uint256)
0x58d6f4c6
冷却时间未结束。参数=剩余秒数。
Unauthorized()
0x82b42900
你当前已持有旗帜。
冷却时间检查:
current_time - lastYoinkedAt() >= 600

Workflow

操作流程

  • Query
    lastYoinkedBy()
    and
    lastYoinkedAt()
    to check status/cooldown
  • Ensure cooldown elapsed (600s) and you're not current holder
  • Submit yoink transaction via Bankr
  • Verify with
    lastYoinkedBy()
    or
    score(address)
  • 调用
    lastYoinkedBy()
    lastYoinkedAt()
    查询状态/冷却时间
  • 确保冷却时间已过(600秒)且你不是当前旗帜持有者
  • 通过Bankr提交夺取交易
  • 调用
    lastYoinkedBy()
    score(address)
    验证操作结果

Resources

相关资源