Back to challenges
Open to all

Calendar Patch

Patch the gap in your per-team calendar by reading its payload from Arkiv and then publishing an entry that sets status="Patched" with your note.

Beginner

Reward Details

$150 worth of GLM tokens

Calendar Patch

Difficulty: Beginner Restore the missing day in your Arkiv calendar to bring the schedule back online.

Objective

Patch the gap in your per-team calendar by reading its payload from Arkiv and then publishing an entry that sets status="Patched" with your note.

How To Join

Start with the Arkiv SDK quickstart and point it at the Mendoza network. Export the canonical endpoints so every script shares the same configuration:

export ARKIV_RPC_URL=https://mendoza.hoodi.arkiv.network/rpc
export ARKIV_WS_URL=wss://mendoza.hoodi.arkiv.network/rpc/ws

Fund the private key you plan to use via the Mendoza faucet at https://mendoza.hoodi.arkiv.network/faucet/. You can confirm balances and track your entities on the Mendoza explorer at https://explorer.mendoza.hoodi.arkiv.network/.

Register by creating an entity annotated with register_for="calendar-patch" and team="<team name>". Here is a copy-pastable snippet:

#!/usr/bin/env bun

import { createWalletClient, http, type Hex } from "@arkiv-network/sdk"
import { privateKeyToAccount } from "@arkiv-network/sdk/accounts"
import { mendoza } from "@arkiv-network/sdk/chains"
import { ExpirationTime, jsonToPayload } from "@arkiv-network/sdk/utils"

const SLUG = "calendar-patch"
const RPC_URL = process.env.ARKIV_RPC_URL ?? "https://mendoza.hoodi.arkiv.network/rpc"

async function register(team: string): Promise<void> {
    const privateKey = (process.env.ARKIV_PRIVATE_KEY ?? "").trim() as Hex
    if (!privateKey) {
        throw new Error("Set ARKIV_PRIVATE_KEY before running this script")
    }

    const account = privateKeyToAccount(privateKey)
    const walletClient = createWalletClient({ chain: mendoza, transport: http(RPC_URL), account })

    const { entityKey, txHash } = await walletClient.createEntity({
        payload: jsonToPayload({ intent: "register" }),
        contentType: "application/json",
        attributes: [
            { key: "register_for", value: SLUG },
            { key: "team", value: team },
        ],
        expiresIn: ExpirationTime.fromMinutes(10),
    })

    console.log(`Registered ${team} entity=${entityKey} tx=${txHash}`)
}

register("your-team-name").catch((error) => {
    console.error(error)
    process.exit(1)
})

After registration the service provisions your calendar entity annotated with ctf="calendar-patch", team, and calendar_for="<registration_entity>". Read its JSON payload to find month, missing_day, and the example note. To submit the fix, publish a new entity annotated with entry_for_calendar="<calendar_entity>" (plus your team) and a JSON body like {"day": <missing_day>, "note": "<your note>"}. When the day matches the stored missing_day, the server updates the calendar payload to status="Patched", records your note, and sends the completion announcement.

Support

Drop a message in the #CTFs channel on Discord.