{"id":13719776,"url":"https://github.com/samnang/solidity-examples","last_synced_at":"2026-02-04T01:55:11.057Z","repository":{"id":38682362,"uuid":"474606104","full_name":"samnang/solidity-examples","owner":"samnang","description":"Collection of smart contracts examples and projects in Solidity.","archived":false,"fork":false,"pushed_at":"2024-08-06T17:07:18.000Z","size":2367,"stargazers_count":120,"open_issues_count":6,"forks_count":31,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-14T09:39:01.351Z","etag":null,"topics":["ethereum","excercises","road-to-web3","smart-contracts","solidity","solidity-by-examples","solidity-contracts","solidity-examples","web3"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samnang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-03-27T10:36:34.000Z","updated_at":"2024-11-12T06:35:12.000Z","dependencies_parsed_at":"2023-09-29T11:17:45.565Z","dependency_job_id":"47b70774-daf2-42c4-8081-d174e4ec6fc5","html_url":"https://github.com/samnang/solidity-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samnang%2Fsolidity-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samnang%2Fsolidity-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samnang%2Fsolidity-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samnang%2Fsolidity-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samnang","download_url":"https://codeload.github.com/samnang/solidity-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252869188,"owners_count":21816992,"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","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":["ethereum","excercises","road-to-web3","smart-contracts","solidity","solidity-by-examples","solidity-contracts","solidity-examples","web3"],"created_at":"2024-08-03T01:00:55.326Z","updated_at":"2026-02-04T01:55:06.009Z","avatar_url":"https://github.com/samnang.png","language":"Solidity","readme":"# Solidity Examples\n\n[![CI](https://github.com/samnang/solidity-examples/actions/workflows/build.yml/badge.svg)](https://github.com/samnang/solidity-examples/actions/workflows/build.yml)\n\nThis is a collection of solidity examples that I practiced while I was learning about Solidity and writing smart contracts.\n\nAlmost all smart contracts have tests with them, so feel free to play around with them to understand more about Solidity programming language or business logic in the contract itself.\n\n## How to Run\n\n```sh\n$ npm install\n$ npx hardhat test\n```\n\n## Getting Started with Solidity\n\n1. [Data types](contracts/getting_started_with_solidity/01_data_types/)\n2. [Constructors](contracts/getting_started_with_solidity/02_constructors/)\n3. [Variables](contracts/getting_started_with_solidity/03_variables/)\n4. [Functions](contracts/getting_started_with_solidity/04_functions/)\n5. [Visibility](contracts/getting_started_with_solidity/05_visibility/)\n6. [Pure and View](contracts/getting_started_with_solidity/06_pure_and_view_functions/)\n7. [Function modifiers](contracts/getting_started_with_solidity/07_function_modifiers/)\n8. Gas\n9. [Events](contracts/getting_started_with_solidity/09_events/)\n10. [Error handling](contracts/getting_started_with_solidity/10_error_handling/)\n11. [Fallback function](contracts/getting_started_with_solidity/11_fallback_function/)\n12. [For Loop](contracts/getting_started_with_solidity/12_for_loop/)\n13. [Array](contracts/getting_started_with_solidity/13_array/)\n14. [Mapping](contracts/getting_started_with_solidity/14_mapping/)\n15. [Enum](contracts/getting_started_with_solidity/15_enum/)\n16. [Struct](contracts/getting_started_with_solidity/16_struct/)\n17. [Payable modifier](contracts/getting_started_with_solidity/17_payable_modifier/)\n18. [Import into a contract](contracts/getting_started_with_solidity/18_imports/)\n19. [Contract cleanup](contracts/getting_started_with_solidity/19_contract_cleanup/)\n20. [Memory vs storage](contracts/getting_started_with_solidity/20_memory_and_storage/)\n21. [Inheritance](contracts/getting_started_with_solidity/21_inheritance/)\n22. [If statements](contracts/getting_started_with_solidity/22_if_statement/)\n23. [Libraries](contracts/getting_started_with_solidity/23_libraries/)\n24. [Interface](contracts/getting_started_with_solidity/24_interface/)\n\n## Sample Apps\n\n1. [Sample Contract](contracts/sample_apps/01_sample_contract/)\n2. [Address Book](contracts/sample_apps/02_address_book/)\n3. [Hotel Room](contracts/sample_apps/03_hotel/)\n4. [Time lock](contracts/sample_apps/04_time_lock/)\n5. [ERC20 Token](contracts/sample_apps/05_ERC20_token/)\n6. [Shared Wallet](contracts/sample_apps/06_shared_wallet/)\n7. [Swap Token](contracts/sample_apps/07_token_swap/)\n8. [ETH Game](contracts/sample_apps/08_eth_game/)\n9. [Ballot](contracts/sample_apps/09_ballot/)\n10. [Vault / Liquidity Pool](contracts/sample_apps/10_vault/)\n11. [Flash Loan](contracts/sample_apps/11_flash_loan/). (See more [resources](https://github.com/samnang/flash-loan-examples))\n12. [Uniswap - Simple Swap](contracts/sample_apps/12_uniswap_simple_swap/)\n\n## Road to Web3\n\n1. [NFT Smart Contract ECR-721](contracts/road_to_web3/week_01/)\n2. [Buy Me A Coffee](contracts/road_to_web3/week_02/)\n3. [NFTs with On-Chain Metadata](contracts/road_to_web3/week_03/)\n4. [NFT Gallery](contracts/road_to_web3/week_04/nft_gallery/)\n5. [Connect APIs to your Smart Contracts using Chainlink](contracts/road_to_web3/week_05/)\n\n## Solidity by Examples\n\n1. [Ether Wallet](contracts/solidity_by_examples/01_ether_wallet/)\n2. [Multi Sig Wallet](contracts/solidity_by_examples/02_multi_sig_wallet/)\n3. [Wrapped ETH (WETH)](contracts/solidity_by_examples/03_WETH/)\n\n## Contributors\n\nWe love pull requests from everyone. By participating in submitting examples, we believe other people will find them useful when they getting started with Solidity.\n\n- [Samnang Chhun](https://twitter.com/samnangchhun)\n- [Web3 Together](https://twitter.com/web3together)\n\n## License\n\nThe software is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Resources"],"sub_categories":["Web3 Decentralized Apps (dApps)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamnang%2Fsolidity-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamnang%2Fsolidity-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamnang%2Fsolidity-examples/lists"}