Skip to main content

Module utils

Module utils 

Source
Expand description

Account validation and shared program utilities.

Functions§

assert_admin
Asserts that the authority matches ADMIN_ADDRESS.
assert_key
Asserts that an account’s key matches the expected pubkey.
new_ed25519_instruction_with_signature
Build ed25519 verify instruction for top-level tx (not CPI - Ed25519 doesn’t support CPI). Client must prepend this instruction before claim_daily_reward.
scene_bonus
Returns (flat_spirit_power, pct_bps) for claim_shards scene bonus. Scene 0: no bonus. Scenes 1,6,7,8: +50k SP. Scene 2: +100k SP. Scenes 3,4,5: +2%, +3%, +5% multiplier respectively.
verify_signed_task_via_introspection
Verify Ed25519 signature via instruction introspection. The client must prepend the Ed25519 verify instruction before claim_daily_reward (Ed25519 cannot be called via CPI). Message: prefix + dojo_pda + task_id. Always 1 day per claim.