hackquest logo

catshoap

A simple Solidity smart contract that lets users increment or decrement an on-chain counter. Great for learning state variables and basic blockchain interaction.

Sự miêu tả

Counter Smart Contract

This is a simple smart contract written in Solidity that acts as an on-chain counter. It allows anyone to increment or decrement a counter value stored on the blockchain.

Features

  • ✅ Store a counter as a state variable

  • ➕ Increment the counter

  • ➖ Decrement the counter

  • 🌐 Read the counter value on-chain (public state variable)

Contract Details

  • Contract Name: `C# Counter Smart Contract

This is a simple smart contract written in Solidity that acts as an on-chain counter. It allows anyone to increment or decrement a counter value stored on the blockchain.

Features

  • ✅ Store a counter as a state variable

  • ➕ Increment the counter

  • ➖ Decrement the counter

  • 🌐 Read the counter value on-chain (public state variable)

Contract Details

  • Contract Name: Counter

  • Network: (Replace with the network you deployed to, e.g., Ethereum, Sepolia, etc.)

  • Deployed Address: 0x922501607d4ec10961b5C864C6f510259Fed31fe

Functions

counter() → int

Returns the current value of the counter. Automatically generated getter function for the public variable.

increment()

Increments the counter value by 1.

decrement()

Decrements the counter value by 1.

How to Use

You can interact with the contract using:

  • Remix IDE – Connect MetaMask, load the contract, and call the functions.

  • Etherscan – If verified, interact directly using the "Write Contract" and "Read Contract" tabs.

  • Frontend/Web3 – Use Web3.js or Ethers.js to call increment() or decrement() from a frontend.

Example (via Remix)

  1. Open Remix IDE

  2. Load the contract code

  3. Compile with Solidity ^0.8.0

  4. Deploy or interact with the existing deployed contract

  5. Call increment() or decrement() functions

License

This project is licensed under the MIT License. ounter`

  • Network: (Replace with the network you deployed to, e.g., Ethereum, Sepolia, etc.)

  • Deployed Address: 0x922501607d4ec10961b5C864C6f510259Fed31fe

Functions

counter() → int

Returns the current value of the counter. Automatically generated getter function for the public variable.

increment()

Increments the counter value by 1.

decrement()

Decrements the counter value by 1.

How to Use

You can interact with the contract using:

  • Remix IDE – Connect MetaMask, load the contract, and call the functions.

  • Etherscan – If verified, interact directly using the "Write Contract" and "Read Contract" tabs.

  • Frontend/Web3 – Use Web3.js or Ethers.js to call increment() or decrement() from a frontend.

Example (via Remix)

  1. Open Remix IDE

  2. Load the contract code

  3. Compile with Solidity ^0.8.0

  4. Deploy or interact with the existing deployed contract

  5. Call increment() or decrement() functions

License

This project is licensed under the MIT License.

Tiến độ hackathon

40

Công nghệ sử dụng

Ethers
Solidity

Trạng thái huy động vốn

NA

Trưởng nhóm
HHarapriya Dash
Mã nguồn mở
Ngành
SocialFiNFTDeFi