This project includes a Solidity smart contract and a frontend interface for interacting with it.
The contract allows users to manage a message string, increment a counter, and transfer ownership securely.
The frontend provides a seamless UI for interacting with the deployed contract on the blockchain.
- Set and Update Message: Users can modify the stored message.
- Counter Increment: Allows users to increase a counter value.
- Ownership Transfer: Restricts administrative actions to the owner and allows ownership transfer.
- Event Logging: Emits events for message updates, counter increments, and ownership changes.
- None: This contract does not rely on external libraries.
- message: A string storing a message that can be updated.
- counter: A numeric counter that can be incremented.
- owner: The address of the contract owner with special privileges.
- Initial Message: The contract is deployed with an initial message.
- Counter: Initializes at 0.
- Ownership: The deployer of the contract is set as the owner.
-
incrementCounter()
- Increments the counter by 1.
- Emits a CounterIncremented event.
-
transferOwnership(address newOwner)
- Allows the current owner to transfer ownership to another address.
- Ensures the new owner is not the zero address.
- Emits an OwnershipTransferred event.
-
appendToMessage(string memory additionalMessage)
- Updates the stored message with new content.
- Emits a MessageSet event.
- React.js / Next.js: Frontend development.
- Ethers.js / Web3.js: Blockchain interaction.
- Tailwind CSS: Styling and responsiveness.
- Connects to the deployed contract using Web3.
- Provides an interactive UI for updating messages, incrementing counters, and transferring ownership.
- Real-time display of contract state changes.
Paras Aggarwal
parasaggarwal7172@gmail.com