solidity-examples
solidity-examples copied to clipboard
Collection of smart contracts examples and projects in Solidity.
Solidity Examples
This is a collection of solidity examples that I practiced while I was learning about Solidity and writing smart contracts.
Almost 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.
How to Run
$ npm install
$ npx hardhat test
Getting Started with Solidity
- Data types
- Constructors
- Variables
- Functions
- Visibility
- Pure and View
- Function modifiers
- Gas
- Events
- Error handling
- Fallback function
- For Loop
- Array
- Mapping
- Enum
- Struct
- Payable modifier
- Import into a contract
- Contract cleanup
- Memory vs storage
- Inheritance
- If statements
- Libraries
- Interface
Sample Apps
- Sample Contract
- Address Book
- Hotel Room
- Time lock
- ERC20 Token
- Shared Wallet
- Swap Token
- ETH Game
- Ballot
- Vault / Liquidity Pool
- Flash Loan. (See more resources)
- Uniswap - Simple Swap
Road to Web3
- NFT Smart Contract ECR-721
- Buy Me A Coffee
- NFTs with On-Chain Metadata
- NFT Gallery
- Connect APIs to your Smart Contracts using Chainlink
Solidity by Examples
- Ether Wallet
- Multi Sig Wallet
- Wrapped ETH (WETH)
Contributors
We love pull requests from everyone. By participating in submitting examples, we believe other people will find them useful when they getting started with Solidity.
License
The software is available as open source under the terms of the MIT License.