hahaha
Thank you for your interest in contributing to Ether Trials! We welcome contributions from the community.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Coding Standards
- Smart Contract Changes
- Documentation
We are committed to providing a welcoming and inspiring community for all. Please be respectful and constructive in all interactions.
- ✅ Use welcoming and inclusive language
- ✅ Be respectful of differing viewpoints
- ✅ Accept constructive criticism gracefully
- ✅ Focus on what's best for the community
- ✅ Show empathy towards other community members
- ❌ Trolling, insulting, or derogatory comments
- ❌ Personal or political attacks
- ❌ Public or private harassment
- ❌ Publishing others' private information
- ❌ Other conduct deemed unprofessional
Found a bug? Help us improve by reporting it!
Before submitting:
- Check existing issues to avoid duplicates
- Test on latest version
- Gather reproduction steps
Create an issue with:
- Clear, descriptive title
- Detailed description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- Environment details (browser, OS, wallet)
Have an idea? We'd love to hear it!
Feature requests should include:
- Clear use case
- Benefits to users
- Potential implementation approach
- Any drawbacks or considerations
Documentation is crucial! Help by:
- Fixing typos and grammar
- Clarifying confusing sections
- Adding examples
- Translating to other languages
- Improving code comments
Ready to code? Awesome!
Good first issues:
- Look for
good-first-issuelabel - UI/UX improvements
- Test coverage
- Bug fixes
- Performance optimizations
Node.js 18+
npm or yarn
Git
MetaMask or compatible wallet# 1. Fork the repository on GitHub
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/ether-trials.git
cd ether-trials
# 3. Add upstream remote
git remote add upstream https://github.com/ORIGINAL_OWNER/ether-trials.git
# 4. Install dependencies
npm install
# 5. Copy environment template
cp .env.example .env
# 6. Add your environment variables
# Edit .env with your keys
# 7. Run development server
npm run dev
# 8. Open browser
# Visit: http://localhost:3000# Fetch upstream changes
git fetch upstream
# Merge upstream main into your main
git checkout main
git merge upstream/main
# Push to your fork
git push origin main# Create feature branch from main
git checkout main
git pull upstream main
git checkout -b feature/your-feature-nameBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation onlyrefactor/- Code refactoringtest/- Adding tests
- Write clean, readable code
- Follow existing code style
- Add comments for complex logic
- Update documentation if needed
- Add tests for new features
# Run linter
npm run lint
# Run tests (if available)
npm run test
# Build to check for errors
npm run build
# Test manually
npm run dev# Stage changes
git add .
# Commit with descriptive message
git commit -m "feat: add dice roll animation"Commit message format:
<type>: <description>
[optional body]
[optional footer]
Types:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style (formatting, etc)refactor:Code refactoringtest:Adding testschore:Maintenance tasks
Examples:
feat: add lucky burst visual effect
fix: resolve wallet connection issue on mobile
docs: update deployment guide with V3 info
refactor: optimize game render loop
git push origin feature/your-feature-name- Go to your fork on GitHub
- Click "Compare & pull request"
- Fill in the PR template
- Link related issues
- Request review
- Maintainers will review your PR
- Address feedback promptly
- Make requested changes
- Push additional commits
- Once approved, PR will be merged
// ✅ Good: Explicit types
function calculateReward(score: number, weight: bigint): bigint {
return BigInt(score) * weight;
}
// ❌ Bad: Implicit any
function calculateReward(score, weight) {
return score * weight;
}
// ✅ Good: Interface for complex types
interface Player {
fid: bigint;
score: number;
entryAmount: bigint;
wallets: string[];
}
// ❌ Bad: Any type
const player: any = { ... };// ✅ Good: Type props, use hooks properly
import type { FC } from 'react';
interface ButtonProps {
label: string;
onClick: () => void;
disabled?: boolean;
}
export const Button: FC<ButtonProps> = ({ label, onClick, disabled }) => {
return (
<button onClick={onClick} disabled={disabled}>
{label}
</button>
);
};
// ❌ Bad: No types, unclear props
export const Button = (props) => {
return <button {...props} />;
};// ✅ Good: Clear naming, comments, checks
/// @notice Submit game score with commit/reveal
/// @param fid Farcaster ID of player
/// @param scoreHash Keccak256 hash of score + nonce
function commitScore(uint256 fid, bytes32 scoreHash) external {
if (commitments[fid].timestamp != 0) revert AlreadyCommitted();
commitments[fid] = Commitment({
hash: scoreHash,
timestamp: block.timestamp
});
emit ScoreCommitted(fid, scoreHash);
}
// ❌ Bad: No comments, unclear logic
function submit(uint256 f, bytes32 h) external {
data[f] = h;
}src/
├── app/ # Next.js app router
├── components/ # React components
│ ├── game/ # Game-specific components
│ ├── ui/ # Reusable UI components
│ └── admin/ # Admin components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and helpers
│ ├── game/ # Game logic
│ └── contracts/ # Contract ABIs
├── contracts/ # Smart contracts & docs
└── types/ # TypeScript type definitions
Smart contract changes require extra scrutiny:
Before submitting:
- ✅ Test thoroughly on testnet
- ✅ Add comprehensive tests
- ✅ Document all functions
- ✅ Consider edge cases
- ✅ Check for reentrancy
- ✅ Validate all inputs
- ✅ Handle errors gracefully
Breaking changes:
- Smart contract changes are often breaking
- Clearly mark as breaking change
- Provide migration guide
- Update documentation
Testing checklist:
// ✅ Test normal cases
// ✅ Test edge cases (0, max values)
// ✅ Test unauthorized access
// ✅ Test reentrancy protection
// ✅ Test gas limits
// ✅ Test with different FIDs
// ✅ Test period boundariesUpdate documentation when you:
- Add new features
- Change existing behavior
- Fix bugs that affect usage
- Improve performance significantly
# ✅ Good: Clear, structured, examples
## Feature Name
### Overview
Brief description of what it does.
### Usage
```typescript
// Code example with comments
const result = await contract.someFunction(param);param(type) - Description
type- Description
Complete working example.
It does stuff.
---
## ✅ Checklist Before Submitting
- [ ] Code follows project style guidelines
- [ ] Tests pass locally
- [ ] Build succeeds without errors
- [ ] Documentation updated (if needed)
- [ ] Commit messages are clear
- [ ] Branch is up to date with main
- [ ] No merge conflicts
- [ ] PR description is complete
- [ ] Linked related issues
- [ ] Requested appropriate reviewers
---
## 🎓 Resources
### Learning Resources
- **TypeScript**: https://www.typescriptlang.org/docs/
- **React**: https://react.dev
- **Next.js**: https://nextjs.org/docs
- **Solidity**: https://docs.soliditylang.org
- **Base**: https://docs.base.org
- **Farcaster**: https://docs.farcaster.xyz
### Development Tools
- **Remix IDE**: https://remix.ethereum.org
- **Hardhat**: https://hardhat.org
- **Wagmi**: https://wagmi.sh
- **Viem**: https://viem.sh
---
## 🏆 Recognition
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Credited in commit history
- Appreciated by the community! 🙏
---
## 📞 Questions?
- **Discussions**: GitHub Discussions
- **Discord**: [Join Community](https://discord.gg/ethertrials)
- **Farcaster**: [@ethertrials](https://warpcast.com/ethertrials)
- **X/Twitter**: [@EtherTrials](https://twitter.com/ethertrials)
---
## 📄 License
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
---
**Thank you for contributing to Ether Trials! 🎮🚀**
Together, we're building the future of decentralized gaming on Base!