Releases: peeramid-labs/rankify-contracts
v0.12.4
Patch Changes
2a873995acf78c913e1260a0e0f079658c6101ab
Thanks @peersky! - fixed zk_artifacts compilation logic
v0.12.3
Patch Changes
-
#159
7c3b2144071e21f11cce3c9e66982fb4123b8976
Thanks @peersky! - Added owner argument to creat subject cli call -
#159
7c3b2144071e21f11cce3c9e66982fb4123b8976
Thanks @peersky! - made game canceled state more explicit -
#159
7c3b2144071e21f11cce3c9e66982fb4123b8976
Thanks @peersky! - allow updating game medatata with (add owner to metadata URIs)Breaking change
MAODistribution
now requires anowner
parameter in therankifySettings
struct. This is used to set the owner of the rank token.
-
#159
7c3b2144071e21f11cce3c9e66982fb4123b8976
Thanks @peersky! - Added ZK artifacts to source control, that way we ensure consistent zkey and verififer contract
v0.12.2
Patch Changes
-
#152
459f582e93cb52ca4de6a02d9c7f35c3f238f35a
Thanks @peersky! - made game canceled state more explicit -
#150
2c59281fdeb2c14180aff428d751a1ae0156ff6b
Thanks @peersky! - allow updating game medatata with (add owner to metadata URIs)Breaking change
MAODistribution
now requires anowner
parameter in therankifySettings
struct. This is used to set the owner of the rank token.
v0.12.1
Patch Changes
-
#136
82efeb0f2301797a0e6435cf3a54cc7c4440e1a5
Thanks @theKosmoss! - Fixed created distribution check... added new flag to setupMockEnvironment -
#143
f3fa6b8ef1d101a93d86b09df3978a07f449c5a2
Thanks @peersky! - Minor improvements and tweaks -
#143
f3fa6b8ef1d101a93d86b09df3978a07f449c5a2
Thanks @peersky! - Arbitrum Seplolia contract deployment
v0.12.0
Minor Changes
-
#134
ef0faf485c1b27933fb41deb1c904708e75328f5
Thanks @peersky! - Added metadata field to game properties -
#110
b7081591a12eccb8a83d22d4975b4062568597c2
Thanks @peersky! - # ChangelogMajor Contract Changes
Major Features
-
Zero-Knowledge Proof Integration
Added circuit-based integrity verification system for game state transitions:- New
proposals_integrity_15.circom
circuit using Poseidon hashing - Commitment scheme for proposal permutations and ballot validity
- Proof verification required for turn transitions (
endTurn
)
- New
-
EIP-712 Signature Workflows
Implemented typed message signing for critical operations:- Game joining requires
signJoiningGame
, signed by GameMaster, attesting player for joining the game - Vote submissions now need dual signatures (GM + Voter)
- Cryptographic commitments for proposal submissions also are signed
- Game joining requires
Breaking Changes
-
Maximum number of participants
Due to the limits of the ZK proof, maximum number of participants is now 15 per one game.
We may change this later but for now this is the limit. -
Proposal Submission
bytes32 commitmentHash;
is nowuint256 commitment;
- gm and voter signatures were added
new proposal params struct looks like this:
struct ProposalParams { uint256 gameId; string encryptedProposal; uint256 commitment; address proposer; bytes gmSignature; bytes voterSignature; }
-
Vote Submission
string encryptedVotes;
is nowstring sealedBallotId;
- signatures for gm and voter were added
- ballot hash is added as parameter it is calculated as
keccak256(vote, playerVoteSalt)
new interface for vote submission looks as follows:
function submitVote( uint256 gameId, string memory sealedBallotId, address voter, bytes memory gmSignature, bytes memory voterSignature, bytes32 ballotHash )
-
Turn Transition Requirements
endTurn
now requires ZK proof parameters:function endTurn( uint256 gameId, uint256[][] memory votes, BatchProposalReveal memory newProposals, uint256[] memory permutation, uint256 shuffleSalt )
Where
BatchProposalReveal
is defined as:/** * @dev Represents a batch of proposal reveals for a game. * @param proposals Array of revealed proposals * @param a ZK proof components * @param b ZK proof components * @param c ZK proof components * @param permutationCommitment The commitment to the permutation * @notice permutationCommitment must be poseidon(sponge(nextTurnPermutation), nullifier). For sponge implementation see poseidonSpongeT3 */ struct BatchProposalReveal { string[] proposals; // Array of revealed proposals uint[2] a; // ZK proof components uint[2][2] b; uint[2] c; uint256 permutationCommitment; }
-
Join game: signature and salt are now required
function joinGame( uint256 gameId, bytes memory gameMasterSignature, bytes memory hiddenSalt )
-
Start game
Now requires permutationCommitment from game master. This is used as permutation integrity value during first turn proposal reveal.function startGame(uint256 gameId, uint256 permutationCommitment)
-
Game Winner
New interface to query for game winner added/** * @dev Returns the winner of the game with the specified ID * @param gameId The ID of the game * @return address The winner of the game */ function gameWinner(uint256 gameId) public view returns (address) { return gameId.getGameState().winner; }
-
Player joined event
Now when player joins, participant address and commitment are emittedevent PlayerJoined(uint256 indexed gameId, address indexed participant, bytes hiddenSalt);
Other Improvements
-
Enhanced Security
- Ballot integrity checks with hash commitments
require( ballotHash == ballotHashFromVotes, "Ballot integrity check failed" );
-
Testing Infrastructure
Added comprehensive test coverage for:- ZK proof generation/verification workflows
- Signature validation edge cases
- Game cancellation scenarios
- Malicious actor simulations
-
Governance Constraints
- Minimum participant requirements
- Principal cost calculations based on game parameters
- 90/10 payment split between burn and DAO
-
GameLifeCycle script was renamed to
interactive
run it with
pnpm hardhat --network $NETWORK interactive
-
all signatures are now available in
./all-signatures.json
-
pnpm clean
added to clean all artifacts & zk proofs cache
Migration Notes
-
Client Updates Required
All game interactions must now:- Generate ZK proofs for turn transitions
- Handle EIP-712 signatures for votes/joining
-
Upgrade Path
pnpm update rankify-contracts
-
-
#110
b7081591a12eccb8a83d22d4975b4062568597c2
Thanks @peersky! - players now must submit game master signature upon joining
Patch Changes
-
#129
adb3d3f7ba536015d637a73118c24a69ceff3bd6
Thanks @peersky! - playbook improvement to accomodate with demo requirements -
#110
b7081591a12eccb8a83d22d4975b4062568597c2
Thanks @peersky! - removed duplicates between test utils and playbook utils
v0.11.2
Patch Changes
-
#125
ed516b3b6712c32c80007488b10e36ce41afb720
Thanks @peersky! - fixed playbooks to work with updated eds internal deplyoment -
#125
ed516b3b6712c32c80007488b10e36ce41afb720
Thanks @peersky! - using external dependency EDS to avoid need for forks or pre-deployments outside of this repo
v0.11.1
Patch Changes
-
#122
8ca5c05fa5817c8220062d24d12522876822bb07
Thanks @peersky! - playbooks now work without need to be uncommented -
#124
033b69b96b48065100b2c141f0ce2d1ca09aebe3
Thanks @peersky! - using external dependency EDS to avoid need for forks or pre-deployments outside of this repo
v0.11.0
Minor Changes
-
#121
40c69b68b9d451e11b75ed5d867d523e69516dc4
Thanks @peersky! - added eip712 domain name and version returns -
#103
2d915aa7b76215fd499b8b8387f3a268f721eab7
Thanks @theKosmoss! - Playbook teask to create sample subjects -
#112
1b05d8c86f3c72d2e7fd665551149531382b3ec4
Thanks @peersky! - added ability to mint derived tokens by burning rank tokens. added min participant count as fundamental constant to instance creation interface -
#117
f5c1790cbd8f4936d73feb0701920a38adc94984
Thanks @peersky! - added playbooks to set state for local dev and demos, cleaned unused dependencies, fixed minor event issues in contracts -
#116
eb1961809276b8400edbc9ee4b280d8e4b4dc891
Thanks @theKosmoss! - Created mintRankifyToken playbook. Updated sample subjects playbook
v0.10.2
Patch Changes
- #98
9507326d20c5ce870cbef96650ebcae60fc5ce5a
Thanks @peersky! - updated readme with latest release information
v0.10.1
Patch Changes
- #96
c582421d2e4672f15e768d1a8293d42e72c5e0f9
Thanks @peersky! - improved create game playbooks