Skip to content

abhishek00912/kumar1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“„ Counter Smart Contract This is a basic smart contract written in Solidity that allows anyone to increment, decrement, reset, and view a counter value.

🧾 Contract Overview solidity Copy Edit // SPDX-License-Identifier: MIT pragma solidity ^0.8.0;

contract Counter { int256 private count;

function getCount() public view returns (int256) { ... }
function increment() public { ... }
function decrement() public { ... }
function reset() public { ... }

} βš™οΈ Functions Function Description Access getCount() Returns the current value of the counter. public view increment() Increases the counter by 1. public decrement() Decreases the counter by 1. public reset() Resets the counter value to 0. public

βœ… Features Uses int256 so it can handle both positive and negative values.

All functions are publicly accessible (no restrictions).

Simple and easy to test on Remix, Hardhat, or Truffle.

πŸš€ Getting Started Open Remix IDE

Create a new file named Counter.sol and paste the contract code.

Compile the contract with Solidity version ^0.8.0.

Deploy it to the JavaScript VM or your chosen environment.

Interact with the contract using the UI provided.

πŸ“Œ Example Usage Click increment() β†’ Counter becomes 1

Click decrement() β†’ Counter becomes 0

Click decrement() again β†’ Counter becomes -1

Click reset() β†’ Counter becomes 0

πŸ›‘οΈ License This project is licensed under the MIT License.

Contact address 0xaa4baff860e34ab7273eda99891f4512b710b821 Screenshot 2025-05-26 144101

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors