Skip to content

A simple Solidity smart contract to register cars, update car details, and transfer ownership. Restricted access with modifiers to ensure only car owners can perform specific actions.

Notifications You must be signed in to change notification settings

MrinalSingh04/Car_Registration_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Car Registration System 🚗

📌Overview:-

The Car Registration System allows users to register their cars, update car details (such as color), and transfer ownership of their cars to other Ethereum addresses. The contract ensures that only the current owner of the car can make modifications to the car's details or transfer its ownership.

📌This contract demonstrates how to:-

✅ Use structs to define car properties. ✅ Use mappings to track car ownership. ✅ Use modifiers to restrict access to sensitive actions. ✅ Enable interaction between users and the contract on the Ethereum blockchain.

📌Features:-

✅ Car Registration: Allows users to register a car with model and color. ✅ Change Car Color: Only the car owner can update its color. ✅ Transfer Car Ownership: Only the car owner can transfer the car ownership to another address. ✅ Ownership Control: Restricts sensitive actions to the car owner via custom modifiers.

📌Functions:-

✅registerCar(_model, _color): Registers a new car. ✅changeCarColor(_carId, _newColor): Changes the car color (only by owner). ✅transferCarOwnership(_carId, _newOwner): Transfers ownership (only by owner). ✅getCar(_carId): Retrieves car details.

📌Example Usage:-

✅Register a car: registerCar("Tesla Model S", "Red") ✅Change color: changeCarColor(1, "Blue") ✅Transfer ownership: transferCarOwnership(1, newOwnerAddress) ✅View car details: getCar(1)

About

A simple Solidity smart contract to register cars, update car details, and transfer ownership. Restricted access with modifiers to ensure only car owners can perform specific actions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published