{"id":31006024,"url":"https://github.com/jsonbored/base-learn","last_synced_at":"2025-09-13T02:06:53.491Z","repository":{"id":311154421,"uuid":"1042672285","full_name":"JSONbored/base-learn","owner":"JSONbored","description":"✨ Complete smart contract solutions for all 13 Base Learn exercises - Earn NFTs and unlock Guild.xyz roles!","archived":false,"fork":false,"pushed_at":"2025-09-08T05:50:56.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-08T07:22:03.051Z","etag":null,"topics":["base","base-learn","base-sepolia","blockchain","coinbase","defi","erc20","erc721","ethereum","learn-to-code","nft","smart-contracts","solidity","web3"],"latest_commit_sha":null,"homepage":"https://docs.base.org/learn/welcome","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JSONbored.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-22T11:44:08.000Z","updated_at":"2025-09-08T05:50:59.000Z","dependencies_parsed_at":"2025-08-22T13:40:02.701Z","dependency_job_id":"54fe62f2-b2f9-4b8f-a24e-847eb0852abf","html_url":"https://github.com/JSONbored/base-learn","commit_stats":null,"previous_names":["jsonbored/base-learn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JSONbored/base-learn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSONbored%2Fbase-learn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSONbored%2Fbase-learn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSONbored%2Fbase-learn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSONbored%2Fbase-learn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JSONbored","download_url":"https://codeload.github.com/JSONbored/base-learn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSONbored%2Fbase-learn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274907841,"owners_count":25371822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["base","base-learn","base-sepolia","blockchain","coinbase","defi","erc20","erc721","ethereum","learn-to-code","nft","smart-contracts","solidity","web3"],"created_at":"2025-09-13T02:03:47.733Z","updated_at":"2025-09-13T02:06:53.483Z","avatar_url":"https://github.com/JSONbored.png","language":"Solidity","readme":"# 🎓 Base Learn Solutions - Complete All 13 Exercises!\n\n\u003cdiv align=\"center\"\u003e\n\n![Base](https://img.shields.io/badge/Base-0052FF?style=for-the-badge\u0026logo=coinbase\u0026logoColor=white)\n![Solidity](https://img.shields.io/badge/Solidity-363636?style=for-the-badge\u0026logo=solidity\u0026logoColor=white)\n![Ethereum](https://img.shields.io/badge/Ethereum-3C3C3D?style=for-the-badge\u0026logo=ethereum\u0026logoColor=white)\n\n**Battle-tested smart contracts that successfully pass all Base Learn validations**\n\n[🚀 Deploy](#-deployment-guide) • [📚 Contracts](#-contract-solutions) • [🏆 Rewards](#-what-youll-earn) • [💡 Tips](#-pro-tips)\n\n\u003c/div\u003e\n\n---\n\n## ✨ What You'll Earn\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n### 🏅 13 NFTs\n**Soulbound Tokens**  \nPermanent proof of your smart contract mastery\n\n\u003c/td\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n### 👑 Guild Roles\n**5 Achievement Tiers**  \nNewcomer → Acolyte → Consul → Prefect → Supreme\n\n\u003c/td\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n### 💎 13 Points\n**TalentProtocol**  \nBuild your on-chain developer reputation\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🎯 Why This Repository?\n\nAfter hours of debugging and testing, I've compiled **working solutions** for all 13 Base Learn exercises. Each contract has been:\n\n- ✅ **Deployed and verified** on Base Sepolia\n- ✅ **Successfully minted** the corresponding NFT\n- ✅ **Optimized** for gas efficiency\n- ✅ **Documented** for learning\n\n\u003e 💡 **Note:** These are meant for learning! Understand the code before deploying.\n\n## 📁 Contract Solutions\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClick to see all 13 exercises with direct links\u003c/b\u003e\u003c/summary\u003e\n\n| # | Exercise | Contract | Quest Link | Key Concepts |\n|---|----------|----------|------------|--------------|\n| 01 | **Basic Math** | `BasicMath.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/contracts-and-basic-functions/basic-functions-exercise) | Overflow-safe arithmetic, error handling |\n| 02 | **Control Structures** | `ControlStructures.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/control-structures/control-structures-exercise) | FizzBuzz, time-based logic, custom errors |\n| 03 | **Storage** | `EmployeeStorage.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/storage/storage-exercise) | Storage optimization, packing, memory vs storage |\n| 04 | **Arrays** | `FavoriteRecords.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/arrays/arrays-exercise) | Dynamic arrays, array manipulation |\n| 05 | **Mappings** | `FavoriteRecords.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/mappings/mappings-exercise) | Mapping operations, nested mappings |\n| 06 | **Inheritance** | `InheritanceContracts.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/inheritance/inheritance-exercise) | Contract inheritance, virtual/override |\n| 07 | **Structs** | `GarageManager.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/structs/structs-exercise) | Custom data structures, struct arrays |\n| 08 | **Error Triage** | `ErrorTriageExercise.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/error-triage/error-triage-exercise) | Debugging, error patterns, assembly |\n| 09 | **New Keyword** | `AddressBookFactory.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/new-keyword/new-keyword-exercise) | Factory pattern, contract deployment |\n| 10 | **Imports** | `ImportsExercise.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/imports/imports-exercise) | Libraries, code reuse, using for |\n| 11 | **ERC-721** | `HaikuNFT.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/erc-721-token/erc-721-exercise) | NFT standard, OpenZeppelin, minting |\n| 12 | **Minimal Token** | `UnburnableToken.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/minimal-tokens/minimal-tokens-exercise) | Basic token mechanics, transfers |\n| 13 | **ERC-20** | `WeightedVoting.sol` | [🔗 Quest](https://docs.base.org/base-learn/docs/erc-20-token/erc-20-exercise) | Governance token, voting mechanics |\n\n\u003c/details\u003e\n\n## 🚀 Deployment Guide\n\n### Prerequisites\n\n```bash\n# 1. Clone this repository\ngit clone https://github.com/YOUR_USERNAME/base-learn-solutions.git\ncd base-learn-solutions\n\n# 2. Install dependencies\nnpm install\n\n# 3. Set up your environment\ncp .env.example .env\n```\n\n### Configure `.env`\n\n```env\nPRIVATE_KEY=your_private_key_here\nBASE_SEPOLIA_RPC=https://sepolia.base.org\nBASESCAN_API_KEY=your_basescan_api_key\n```\n\n\u003e ⚠️ **Security:** Never commit your `.env` file!\n\n### Deploy Contracts\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eOption 1: Deploy All Contracts\u003c/b\u003e\u003c/summary\u003e\n\n```bash\nnpx hardhat compile\nnpx hardhat run scripts/deploy-all.ts --network baseSepolia\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eOption 2: Deploy Individual Contracts\u003c/b\u003e\u003c/summary\u003e\n\n```bash\n# Compile first\nnpx hardhat compile\n\n# Then deploy specific contract\nnpx hardhat run scripts/deploy-01-basicmath.ts --network baseSepolia\n```\n\n\u003c/details\u003e\n\n## 📝 Submission Process\n\n```mermaid\ngraph LR\n    A[Deploy Contract] --\u003e B[Copy Address]\n    B --\u003e C[Visit Base Learn]\n    C --\u003e D[Submit Address]\n    D --\u003e E[Mint NFT! 🎉]\n```\n\n1. **Deploy** your contract to Base Sepolia\n2. **Copy** the contract address from terminal\n3. **Navigate** to [Base Learn](https://docs.base.org/base-learn/docs/welcome)\n4. **Paste** address and submit\n5. **Mint** your NFT!\n\n## 💡 Pro Tips\n\n### 🎯 Common Issues \u0026 Solutions\n\n| Issue | Solution |\n|-------|----------|\n| **\"Unable to estimate gas\"** | Contract validation failed - check function signatures |\n| **\"Transaction underpriced\"** | Previous transaction pending - wait or increase gas |\n| **Contract not verifying** | Ensure exact function names and parameters match |\n| **Imports failing** | Deploy library contract first, then main contract |\n\n### 🔥 Speed Run Strategy\n\n1. **Batch Operations:** Deploy 3-4 contracts at once\n2. **Use Remix:** For quick testing before Hardhat deployment\n3. **Pre-fund Wallet:** Have enough Base Sepolia ETH ready\n4. **Keep Tab Open:** Stay logged into Base Learn platform\n\n### 🛡️ Security Best Practices\n\n- ✅ Use a **dedicated testnet wallet**\n- ✅ Store keys in `.env`, never hardcode\n- ✅ Verify contracts on BaseScan after deployment\n- ✅ Test locally with `npx hardhat test` first\n\n## 📚 Resources\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Official Links\n- 🌐 [Base Learn Platform](https://docs.base.org/base-learn/docs/welcome)\n- 🔗 [Base Documentation](https://docs.base.org/)\n- 💧 [Base Sepolia Faucet](https://www.coinbase.com/faucets/base-ethereum-goerli-faucet)\n- 🔍 [BaseScan Explorer](https://sepolia.basescan.org)\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Community\n- 🏰 [Guild.xyz Base Learn](https://guild.xyz/base)\n- 💬 [Base Discord](https://discord.gg/base)\n- 🐦 [Base Twitter](https://twitter.com/base)\n- 📖 [OpenZeppelin Docs](https://docs.openzeppelin.com/)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🤝 Contributing\n\nFound a better solution? Contributions are welcome!\n\n```bash\n# 1. Fork the repository\n# 2. Create your feature branch\ngit checkout -b feature/better-solution\n\n# 3. Commit your changes\ngit commit -m '✨ Improve Exercise X solution'\n\n# 4. Push and create PR\ngit push origin feature/better-solution\n```\n\n## 📜 License\n\nMIT License - Use freely to complete Base Learn!\n\n## 🙏 Acknowledgments\n\n\u003cdiv align=\"center\"\u003e\n\n**Special thanks to:**\n\nBase Learn Team • OpenZeppelin • Hardhat • The Base Community\n\n---\n\n### 🌟 Star this repo if it helped you earn your NFTs!\n\nMade with ❤️ by \u003ca href=\"https://github.com/JSONbored\"\u003eJSONbored\u003c/a\u003e\n\n**[⬆ back to top](#-base-learn-solutions---complete-all-13-exercises)**\n\n![Alt](https://repobeats.axiom.co/api/embed/7db35c0ab9d4ada6d5c46400d30749568919edac.svg \"Repobeats analytics image\")\n\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsonbored%2Fbase-learn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsonbored%2Fbase-learn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsonbored%2Fbase-learn/lists"}