This repository contains four smart contracts developed during the Solidity module of the Blockchain course I've been attending to. Each contract demonstrates different aspects of Solidity programming and blockchain application development.
This repository includes the following smart contracts:
- ChargingStation - A contract for managing EV charging stations
- Banco - A banking contract that allows deposits, withdrawals, and loans with interest
- Agenda - A contact management system with multiple implementations (single/multi-user and access controls)
- SimpleStorage - A simple storage contract with various implementations exploring Solidity features
The ChargingStation contract is the main highlight of this repository. It implements a fictional decentralized system for electric vehicle charging station management.
- Manage charging station registration
- Track charging sessions
- Handle payments between users and station operators
- Dynamic pricing mechanisms
- Role-based access control
The ChargingStation contract includes comprehensive test coverage using Foundry, a fast and flexible Ethereum development framework.
cd /workspaces/SolidityExercises
forge testThe tests cover various scenarios including:
- Station registration
- User authentication
- Charging session management
- Payment processing
- Error handling
To work with these contracts:
- Clone the repository
- Install dependencies:
forge install
- Compile the contracts:
forge build