solidity-community-land-trust

Solidity Smart Contract: Community Land Trust (CLT)

https://github.com/block-foundation/solidity-community-land-trust

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.7%) to scientific vocabulary

Keywords

block-foundation blockchain blockfoundation clt community community-land-trust eth ethereum real-estate real-estate-management sol solidity
Last synced: 4 months ago · JSON representation ·

Repository

Solidity Smart Contract: Community Land Trust (CLT)

Basic Info
  • Host: GitHub
  • Owner: block-foundation
  • License: cc-by-sa-4.0
  • Language: Solidity
  • Default Branch: main
  • Homepage: https://www.blockfoundation.io
  • Size: 79.1 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 5
  • Releases: 0
Topics
block-foundation blockchain blockfoundation clt community community-land-trust eth ethereum real-estate real-estate-management sol solidity
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Citation Codeowners Security Support Governance Authors

README.md

[![GitHub License](https://img.shields.io/github/license/block-foundation/blocktxt?style=flat-square&logo=readthedocs&logoColor=FFFFFF&label=&labelColor=%23041B26&color=%23041B26&link=LICENSE)](https://github.com/block-foundation/solidity-community-land-trust/blob/main/LICENSE) [![devContainer](https://img.shields.io/badge/Container-Remote?style=flat-square&logo=visualstudiocode&logoColor=%23FFFFFF&label=Remote&labelColor=%23041B26&color=%23041B26)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/block-foundation/solidity-community-land-trust)

Block Foundation Logo

Community Land Trust

Block Foundation Smart Contract Series [Solidity]


Block Foundation Brand

Contents

  1. Introduction
  2. Features
  3. Quick start
  4. Setup and Installation
  5. Usage
  6. Contribution
  7. License
  8. Colophon



[![Report a Bug](https://img.shields.io/badge/Report%20a%20Bug-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/solidity-community-land-trust/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=bug_report.yml) [![Request a Feature](https://img.shields.io/badge/Request%20a%20Feature-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/solidity-community-land-trust/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=feature_request.yml) [![Ask a Question](https://img.shields.io/badge/Ask%20a%20Question-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/solidity-community-land-trust/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=question.yml) [![Make a Suggestion](https://img.shields.io/badge/Make%20a%20Suggestion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/solidity-community-land-trust/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=suggestion.yml) [![Start a Discussion](https://img.shields.io/badge/Start%20a%20Discussion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/solidity-community-land-trust/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)

The CommunityLandTrust smart contract facilitates the management and operations of land parcels within a decentralized land trust community. It allows users to buy and sell land parcels, transfer ownership, and provides an administrative interface for trustees and the contract owner.

Introduction

In this community land trust smart contract, we explore a sophisticated example of land management on the Ethereum blockchain. The CLT contract encapsulates multiple unique aspects of a trust, including land as unique parcels rather than indistinguishable units, trustees who have special privileges, dynamic pricing, and operations like land purchase, sale, and transfer among users.

The Community Land Trust contract models the sale and purchase of land as transactions on the Ethereum blockchain. Instead of treating land as indistinguishable units, the contract recognizes each land parcel as a unique entity, with an ID and an owner. This allows for more realistic representation and tracking of land ownership.

The contract recognizes the role of trustees in a land trust. Trustees have the power to change the price of land parcels. The owner of the contract, usually the trust, has the power to add or remove trustees. All these operations trigger events that provide transparency and traceability.

Users can buy available land parcels from the trust. When a land parcel is purchased, it is assigned to the buyer and can no longer be bought by others. Owners of land parcels have the flexibility to sell the parcels back to the trust or transfer ownership to other users. This allows for dynamic changes in the distribution of land ownership within the community land trust.

While this contract offers a robust and realistic representation of a community land trust, it serves as a starting point and should be customized according to the specific needs of the trust. As with any blockchain contract, it is critical to thoroughly test and audit the contract code before deploying it on the mainnet.

In summary, the Community Land Trust contract provides a sophisticated example of using Ethereum for managing real-world assets and transactions, demonstrating the immense potential of blockchain technology in revolutionizing how we handle and exchange value.

Features

  • Purchase Land: Users can purchase available land parcels by sending the specified Ether amount.
  • Sell Land: Landowners can sell their parcels back to the trust.
  • Transfer Ownership: Landowners can transfer their land parcels to another Ethereum address.
  • Admin Functions: The contract owner and trustees have special permissions:
    • Set the price of land parcels.
    • Add or remove trustees.
    • Withdraw contract balance.

Functions

This contract includes:

  • LandParcel: A struct that represents a unique land parcel with an ID and owner.
  • landParcels: A mapping from a land parcel ID to the LandParcel struct.
  • landOwners: A mapping from an address to an array of land parcel IDs owned by that address.
  • purchaseLand: A function for buying land parcels from the trust.
  • sellLand: A function for selling land parcels back to the trust.
  • transferLand: A function for transferring ownership of a land parcel to another user.
  • getLandParcels: A function that returns all land parcel IDs owned by a user.

Quick Start

Install

sh npm i

Compile

sh npm run compile

Setup and Installation

Prerequisites

Steps

  1. Clone this repository:

bash git clone [Repository Link]

  1. Change into the directory:

bash cd CommunityLandTrustContract

  1. Install dependencies:

bash npm install

  1. Compile the contract:

bash truffle compile

  1. Deploy the contract to a local Ethereum network using Truffle:

bash truffle migrate --reset

Of course! Here's an expanded "Usage" section for the README.md detailing more function calls:


Usage

  1. Buying Land:

javascript contractInstance.purchaseLand({value: etherAmount});

  1. Selling Land:

javascript contractInstance.sellLand(parcelId);

  1. Transferring Land:

javascript contractInstance.transferLand(parcelId, recipientAddress);

  1. Setting Land Price (Trustees only):

javascript contractInstance.setLandPrice(newPrice);

  1. Fetching Land Parcels Owned by an Address:

javascript let parcelsOwned = await contractInstance.getLandParcels(ownerAddress); console.log("Land Parcels:", parcelsOwned);

  1. Adding a Trustee (Owner only):

javascript contractInstance.addTrustee(newTrusteeAddress);

  1. Removing a Trustee (Owner only):

javascript contractInstance.removeTrustee(trusteeAddress);

  1. Withdrawing Contract Balance (Owner only):

javascript contractInstance.withdraw();

  1. Fetching Land Details by Parcel ID:

javascript let landParcel = await contractInstance.landParcels(parcelId); console.log("Land Owner:", landParcel.owner);

  1. Checking Trustee Status:

javascript let isTrustee = await contractInstance.trustees(addressToCheck); console.log("Is Trustee:", isTrustee);


Colophon

Authors

This is an open-source project by the Block Foundation.

The Block Foundation mission is enabling architects to take back initiative and contribute in solving the mismatch in housing through blockchain technology. Therefore the Block Foundation seeks to unschackle the traditional constraints and construct middle ground between rent and the rigidity of traditional mortgages.

website: www.blockfoundation.io

Development Resources

Other Repositories

Block Foundation Smart Contract Series

| | Solidity | Teal | | --------------------------------- | ----------- | ----------- | | Template | >>> | >>> | | Architectural Design | >>> | >>> | | Architecture Competition | >>> | >>> | | Housing Cooporative | >>> | >>> | | Land Registry | >>> | >>> | | Real-Estate Crowdfunding | >>> | >>> | | Rent-to-Own | >>> | >>> | | Self-Owning Building | >>> | >>> | | Smart Home | >>> | >>> |

Contributing

We'd love for you to contribute and to make this project even better than it is today! Please refer to the contribution guidelines for information.

Legal Information

Copyright

Copyright © 2023 Stichting Block Foundation. All Rights Reserved.

License

Except as otherwise noted, the content in this repository is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License, and code samples are licensed under the Apache 2.0 License.

Also see LICENSE and LICENSE-CODE.

Disclaimer

THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Owner

  • Name: Block Foundation
  • Login: block-foundation
  • Kind: organization
  • Email: info@blockfoundation.io
  • Location: Netherlands

The Block Foundation mission is enabling architects to take back initiative and contribute in solving the mismatch in housing through blockchain technology.

Citation (CITATION.cff)

cff-version: 1.2.0
title: solidity-community-land-trust
version: 0.0.1
date-released: 2023-07-01
url: "https://github.com/block-foundation/solidity-community-land-trust"
message: >-
  If you use this software, please cite it using
  the metadata from this file.
type: software
authors:
  - given-names: Lars Bastiaan
    family-names: van Vianen
    email: lars@blockfoundation.io
    affiliation: Block Foundation
    orcid: "https://orcid.org/0000-0002-8790-8630"

GitHub Events

Total
  • Delete event: 4
  • Issue comment event: 8
  • Pull request event: 8
  • Create event: 3
Last Year
  • Delete event: 4
  • Issue comment event: 8
  • Pull request event: 8
  • Create event: 3

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 89
  • Total Committers: 1
  • Avg Commits per committer: 89.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 89
  • Committers: 1
  • Avg Commits per committer: 89.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Lars van Vianen l****s@v****m 89
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (24)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.devcontainer/Dockerfile docker
  • blockfoundation/ethereum-solidity-devcontainer latest build
.devcontainer/docker-compose.yml docker
package.json npm
  • @nomicfoundation/hardhat-chai-matchers ^2.0.1 development
  • @nomicfoundation/hardhat-toolbox ^3.0.0 development
  • @openzeppelin/hardhat-upgrades ^2.0.1 development
  • @typechain/ethers-v6 ^0.4.3 development
  • @types/chai ^4.3.5 development
  • @types/mocha ^10.0.1 development
  • @types/node ^20.4.4 development
  • chai ^4.3.7 development
  • dotenv ^16.3.1 development
  • eslint ^8.41.0 development
  • ethers ^6.6.5 development
  • hardhat ^2.17.0 development
  • prettier ^2.8.8 development
  • solhint ^3.4.1 development
  • solidity-coverage ^0.8.4 development
  • ts-node ^10.9.1 development
  • typechain ^8.3.1 development
  • typescript ^5.1.6 development
  • web3 ^4.0.3 development
  • webpack ^5.88.2 development
  • @openzeppelin/contracts ^4.9.2
  • @openzeppelin/contracts-upgradeable ^4.9.2
  • hardhat-abi-exporter ^2.10.1
  • keccak256 ^1.0.6
  • merkletreejs ^0.3.10
  • web3-utils ^4.0.3