View this page with a web3-enabled browser to view the leaderboard
All ETH sent to the Pyramid Game contract is split proportionally among the leaders.
The contribution workflow is initiated whenever ETH is sent to the Pyramid Game contract, or an address calls the contribute function. This workflow is split into two phases: distribution and reorg.
In the distribution phase, the value of the contribution is divided among the leaderboard holders. This split is proportional based on how much they have directly or indirectly contributed.
Following the distribution phase, there is a reorg phase in which the original sender's contribution is accounted for. If their contribution is high enough, this will enter them onto the leaderboard. Otherwise, the sender will receive $PYRAMID as a placeholder.
Each leaderboard slot is represented by an ERC-721 token with unique onchain art. All distributions are made to token owners (or designated recipients) in proportion to the token's contribution amounts. Note that the contribution amount is tied to the leaderboard token, not the sending address.
Pyramid Game is configured for a 12-player leaderboard. As a result, the first 12 players to send ETH will join the leaderboard and receive a unique leaderboard token. After this point, the leaderboard token with the lowest contribution amount will be transferred from existing holders to new entrants. Upon transfer, the token's contribution amount will be updated to reflect the new leader's contribution. The displaced leader will be compensated with $PYRAMID equal to their contribution balance.
If a player makes a contribution while already owning a leaderboard token, the token's contribution amount will be updated to reflect that transaction. In the event that a player owns multiple leaderboard tokens, only the token with the lowest token ID will be updated.
Owners (or approved operators) of Pyramid Game leaderboard tokens may opt to forward all distributions to another address. The recipient address is reset on token transfer. Recursive payments back to the Pyramid Game contract are disallowed.
$PYRAMID is an ERC-20 token that acts as a placeholder for all contributions made to Pyramid Game. Players will receive $PYRAMID in two circumstances: (a) if their leaderboard token is transferred to another player during a reorg, they will receive an amount of $PYRAMID equal to their contribution balance; and (b) if a non-leader makes a contribution that does not bring them into the leaderboard, they will receive an amount of $PYRAMID equal to the amount of ETH they sent.
If a player makes a contribution, and the sum of their contribution amount and current $PYRAMID balance is greater than the lowest leader's contribution amount, then that player will receive the leaderboard token and their outstanding $PYRAMID balance will be burned.
If a player accrues enough $PYRAMID to enter the leaderboard through the secondary market, they can trigger a manual reorg by calling claimLeaderboardSlot.
$PYRAMID may also be used to directly increase the contribution amount of a leaderboard token by calling addToLeaderContributionBalance.
At any point, a player may create a child Pyramid Game based on a parent game. When creating a new child game, the player must make an initial contribution, which will enter that player into the first slot on the child game's leaderboard. The initial contribution will go towards the parent game. All assets related to the parent game (i.e., leaderboard tokens and $PYRAMID) will go to the child game's leaderboard wallet. As a result, child Pyramid Games may be an effective way to coordinate participation in parent games.
The leaderboard wallet is a multisig that requires a simple majority of votes from all leaders to execute any action. This may involve transferring assets (leaderboard tokens or $PYRAMID), distributing accrued ETH from parent Pyramid Games, updating the metadata of the leaderboard tokens, or upgrading to a new wallet contract.
To execute a transaction, more than 50% of leaders must sign off-chain messages approving the action. Each signature verifies that the leader (or their approved operator) controls their leaderboard NFT. Once sufficient signatures are collected, anyone can submit the transaction on-chain via executeLeaderTransaction.
The main contract that manages the distribution mechanism and $PYRAMID.
Key Functions:
contribute() payable - Main entry point for sending ETH to the gameclaimLeaderboardSlot() - Manually claim a leaderboard slot using your $PYRAMID balanceaddToLeaderContributionBalance(tokenId, amount) - Burn $PYRAMID to increase a leader's contribution amountdeployChildPyramidGame(name, tokenSymbol, leaderSymbol) payable - Create a child Pyramid GamebalanceOf(address), transfer(to, amount), approve(spender, amount) - Standard ERC-20 functions for $PYRAMIDleaderboard() - Returns the address of the leaderboard contractwallet() - Returns the address of the multisig wallet contractERC-721 contract managing leaderboard slots.
Key Functions:
contributions(tokenId) - Returns the contribution amount for a specific leader tokenrecipientOf(tokenId) - Returns the distribution recipient address (defaults to token owner)setRecipient(tokenId, address) - Set a custom recipient for distributionslowestLeader() - Returns the token ID and contribution amount of the lowest leadergetAllLeaderData() - Batch read all leader data in a single callcontributionTotal() - Returns the sum of all leader contribution balancesMultisig wallet contract controlled by leaderboard NFT holders.
Key Functions:
executeLeaderTransaction(target, value, data, nonce, tokenIds[], signatures[]) - Execute a transaction with majority approvalnonceUsed(nonce) - Check if a nonce has been used (prevents replay attacks)Signature Format: Leaders sign EIP-191 formatted messages containing keccak256(abi.encode(target, value, data, nonce)). Each signature must correspond to a leader NFT owner or approved operator.