Ch 1: The Secrets Pool
Defining the secrets pool
// SPDX-License-Identifier: MIT License
pragma solidity ^0.8.13;
contract ClownBeatdown {
mapping(uint256 => sbytes) secrets; // Pool of possible secrets (shielded).
uint256 secretsCount; // Number of secrets for modular arithmetic.
suint256 secretIndex; // Shielded index into the secrets mapping.
uint256 round; // The current round number (used by _randomIndex).
constructor(uint256 _clownStamina) {
round = 1; // Start with the first round.
}
}Add the addSecret function
Add the random index helper
What's happening here?
Last updated

