Skip to content

feat/ Add Python implementation of counter contract#24

Merged
gagdiez merged 1 commit intonear-examples:mainfrom
fati-Onchain:contract-py-version
Dec 9, 2025
Merged

feat/ Add Python implementation of counter contract#24
gagdiez merged 1 commit intonear-examples:mainfrom
fati-Onchain:contract-py-version

Conversation

@fati-Onchain
Copy link
Contributor

Python Implementation of NEAR Counter Smart Contract

Adds a Python implementation of the NEAR counter contract to complement existing Rust and TypeScript versions.

What's Added

Smart Contract (contract.py)

  • initialize() - Initialize contract state
  • get_num() - Get current counter value
  • increment(number) - Increment counter (default: 1)
  • decrement(number) - Decrement counter (default: 1)
  • reset() - Reset counter to zero

Tests (tests/test_mod.py)

  • Comprehensive test suite using near-pytest
  • Covers all operations and edge cases

Documentation (README.md)

  • Installation and setup instructions
  • Deployment and testing guidelines

@gagdiez gagdiez merged commit db8d01b into near-examples:main Dec 9, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants