Skip to content

StabilityNexus/Treee-Solidity

Repository files navigation

image image

 

Static Badge

Telegram Badge    X (formerly Twitter) Badge    Discord Badge    Medium Badge    LinkedIn Badge    Youtube Badge


Treee — Solidity Contracts (Foundry)

Treee is the smart contract layer of the Treee tree-planting protocol, enabling on-chain verification, organization management, and NFT issuance for planted trees.
It powers transparent and auditable sustainability tracking within the Stability Nexus ecosystem.


Tech Stack

Core

  • Solidity (v0.8.28) — Smart contract development
  • Foundry (forge, anvil, cast) — Testing, simulation & deployment
  • OpenZeppelin Contracts — Token standards and access control

Contracts

  • TreeNft.sol — NFT for planted trees
  • Organisation.sol — Handles organization logic
  • OrganisationFactory.sol — Deploys and tracks organizations
  • CareToken.sol, PlanterToken.sol, LegacyToken.sol — Incentive ERC-20 tokens

Getting Started

Prerequisites

  • Foundry
  • Rust toolchain (rustup)
  • Node.js (optional, for deployment scripting)

Quickstart

1. Clone the repository

git clone https://github.com/StabilityNexus/Treee-Solidity.git
cd Treee-Solidity

2. Build contracts

forge build

3. Run tests

forge test

4. Start a local node

anvil

5. Deploy (example)

forge script script/Deploy.s.sol:DeployAllContractsAtOnce \
  --rpc-url $SEPOLIA_RPC_URL \
  --private-key $PRIVATE_KEY \
  --broadcast

Developer Workflow

Run a local node:

anvil

Test in watch mode:

forge test --watch

Interact manually:

cast call <contract-address> "getOrganisationCount()()" --rpc-url http://127.0.0.1:8545

Common Commands

Command Description
forge build Compile contracts
forge test Run tests
forge fmt Format Solidity code
forge snapshot Create gas usage reports
anvil Start local blockchain node

Contributing

We welcome contributions of all kinds!

  1. Fork the repo & create a feature branch:

    git checkout -b feature/AmazingFeature
  2. Commit your changes:

    git commit -m "Add some AmazingFeature"
  3. Run checks:

    forge build && forge test && forge fmt
  4. Push & open a PR

For bugs, suggestions, or questions — open an issue or reach us on Discord.


© 2025 Treee Project · Stability Nexus ecosystem.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •