🧪 A decentralized application built on Ethereum that revolutionizes the way development teams conduct sprint planning sessions. This Web3 application implements the popular Scrum Poker (or Planning Poker) estimation technique on the blockchain, providing transparency, immutability, and incentivization for accurate estimations.
⚙️ Built using NextJS, RainbowKit, Foundry, Wagmi, Viem, and Typescript with Diamond Protocol (EIP-2535) smart contracts.
- ✅ Decentralized Ceremonies: Create and manage sprint planning sessions on-chain with unique access codes
- 🪝 NFT-Based Badge System: Earn NFT badges based on estimation accuracy and participation
- 🧱 Role-Based Access Control: Dedicated roles for Scrum Masters, Product Owners, and Developers
- 🔥 Feature Voting: Vote on user stories and functionality with immutable results
- 🔐 Tokenized Incentives: Economic incentives for active and accurate participation
- 🤖 Modular Smart Contract Architecture: Leverages the Diamond Protocol for upgradability and modularity
Scrum Poker is a decentralized application that brings the popular Scrum Poker planning technique to the blockchain. It enables development teams to conduct transparent, immutable sprint planning sessions with incentives for accurate estimations.
- Decentralized Planning Sessions: Conduct sprint planning on-chain
- NFT Badges for Participation: Earn rewards based on estimation accuracy
- Blockchain Transparency: All votes and outcomes are stored on-chain
- Role-Based Governance: Special roles for Scrum Masters and team members
The Scrum Poker is implemented using the Diamond Protocol (EIP-2535) with the Solarity 3.1 library, making the contract modular, upgradeable, and efficient.
- ScrumPokerDiamond: Main contract implementing the Diamond pattern
- ScrumPokerStorage: Shared storage for all facets
- DiamondInit: Initialization contract for setting up all facets
The system is divided into specialized facets:
- AdminFacet: Manages administrative settings and access control
- NFTFacet: Implements NFT badge functionality
- CeremonyFacet: Handles ceremonies (sprints) and participant management
- VotingFacet: Manages various voting processes
Before you begin, you need to install the following tools:
- Node (>= v18.18)
- Yarn (v1 or v2+)
- Git
To get started with Scrum Poker, follow these steps:
- Install dependencies:
cd scrumpoker
yarn install- Run a local network in the first terminal:
yarn chainThis command starts a local Ethereum network using Foundry for testing and development.
- Deploy the Scrum Poker contracts:
yarn deployThis deploys the Diamond Protocol contracts that make up the Scrum Poker dApp.
- Start your NextJS app:
yarn startVisit your app on: http://localhost:3000. You can interact with the Scrum Poker dApp to create ceremonies, join planning sessions, vote on user stories, and earn NFT badges.
- Run smart contract tests with
yarn foundry:test - Edit smart contracts in
packages/foundry/contracts- key files include the Diamond facets - Edit the frontend at
packages/nextjs/app/ - Modify deployment scripts in
packages/foundry/script
The Scrum Poker dApp provides multiple functionalities for different user roles:
// Update exchange rate
adminFacet.updateExchangeRate(newRate);
// Pause/unpause the contract
adminFacet.pause();
adminFacet.unpause();
// Grant roles to users
adminFacet.grantRole(SCRUM_MASTER_ROLE, address);// Purchase NFT badges
nftFacet.purchaseNFT({ value: exchangeRate }, "Developer Badge", "ipfs://badge-uri");
// View badge data
const badgeData = await nftFacet.getBadgeData(tokenId);// Start a new ceremony (sprint)
const code = await ceremonyFacet.startCeremony(sprintNumber);
// Request to join a ceremony
await ceremonyFacet.requestCeremonyEntry(code);
// Approve participant entry (Scrum Master only)
await ceremonyFacet.approveEntry(code, participantAddress);
// Conclude a ceremony
await ceremonyFacet.concludeCeremony(code);// Vote in a ceremony
await votingFacet.vote(code, voteValue);
// Open voting for a specific functionality
await votingFacet.openFunctionalityVote(code, functionalityCode);
// Vote on functionality
await votingFacet.voteFunctionality(code, sessionIndex, voteValue);
// Update badges with voting results
await votingFacet.updateBadges(code);The Scrum Poker dApp uses Ponder for event indexing to track important events like ceremony creation, voting results, and badge awards.
Ponder configuration is in packages/ponder/ponder.config.ts, automatically using deployed contracts from the blockchain network configured in packages/nextjs/scaffold.config.ts.
The Scrum Poker schema in packages/ponder/ponder.schema.ts models entities like:
- Ceremonies
- Participants
- Votes
- NFT Badges
- Rewards
Start the Ponder server to index events and provide the GraphQL API:
yarn ponder:devAccess the GraphQL interface at http://localhost:42069
In your frontend, you can query ceremony and voting data using React Query:
// Example query for a ceremony's voting results
const { data: ceremonyResults } = useQuery({
queryKey: ["ceremonyResults", ceremonyCode],
queryFn: async () => {
const response = await fetch(
`${process.env.NEXT_PUBLIC_PONDER_URL}/graphql`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: `
query GetCeremonyResults($code: String!) {
ceremony(code: $code) {
code
sprintNumber
votes {
voter
value
timestamp
}
concluded
}
}
`,
variables: { code: ceremonyCode }
})
}
);
const json = await response.json();
return json.data.ceremony;
}
});The Scrum Poker implements multiple security measures at the smart contract level:
- Reentrancy Protection: Guards against reentrancy attacks in all fund-related functions
- Withdrawal Pattern: Secure fund transfers using the withdrawal pattern
- Role-Based Access Control: Granular permissions for different user types
- Emergency Pause: Ability to pause contract operations in case of emergencies
- State Verification: Thorough validation checks for all operations
One of the key advantages of using the Diamond Protocol (EIP-2535) is the ability to upgrade contracts without losing state:
- Deploy new facet implementations
- Update the Diamond contract to point to the new facets
- Remove or replace obsolete facets
This can be done using the diamondCut method of the Diamond contract.
We welcome contributions to improve the Scrum Poker dApp! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License.
- Built with Scaffold-ETH 2
- Diamond Protocol implementation based on EIP-2535
- Solarity for Diamond Protocol helpers
Visit our docs to learn how to start building with Scaffold-ETH 2.
To know more about its features, check out our website.
We welcome contributions to Scrum Poker!
Please see CONTRIBUTING.MD for more information and guidelines for contributing to Scrum Poker.