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:
CounterNetwork: (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()ordecrement()from a frontend.
Example (via Remix)
Open Remix IDE
Load the contract code
Compile with Solidity ^0.8.0
Deploy or interact with the existing deployed contract
Call
increment()ordecrement()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()ordecrement()from a frontend.
Example (via Remix)
Open Remix IDE
Load the contract code
Compile with Solidity ^0.8.0
Deploy or interact with the existing deployed contract
Call
increment()ordecrement()functions
License
This project is licensed under the MIT License.
Tiến độ hackathon
40
Công nghệ sử dụng
Trạng thái huy động vốn
NA