https://github.com/block-foundation/solidity-private-city
Solidity Smart Contract: Private City
https://github.com/block-foundation/solidity-private-city
architecture block-foundation blockchain blockfoundation city eth ethereum governance hardhat private-city smart-contracts sol solidity urban-planning urbanism
Last synced: 5 months ago
JSON representation
Solidity Smart Contract: Private City
- Host: GitHub
- URL: https://github.com/block-foundation/solidity-private-city
- Owner: block-foundation
- License: cc-by-sa-4.0
- Created: 2023-07-25T09:27:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-11T08:22:31.000Z (over 1 year ago)
- Last Synced: 2026-01-11T10:25:57.502Z (5 months ago)
- Topics: architecture, block-foundation, blockchain, blockfoundation, city, eth, ethereum, governance, hardhat, private-city, smart-contracts, sol, solidity, urban-planning, urbanism
- Language: TypeScript
- Homepage: https://www.blockfoundation.io
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
- Support: .github/SUPPORT.md
- Governance: .github/GOVERNANCE.md
- Authors: AUTHORS
Awesome Lists containing this project
README
[](https://github.com/block-foundation/solidity-private-city/blob/main/LICENSE)
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/block-foundation/solidity-private-city)
---
Private City
Block Foundation Smart Contract Series [Solidity]
---

### Contents
- [Introduction](#introduction)
- [Colophon](#colophon)
---
[](https://github.com/block-foundation/solidity-private-city/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=bug_report.yml)
[](https://github.com/block-foundation/solidity-private-city/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=feature_request.yml)
[](https://github.com/block-foundation/solidity-private-city/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=question.yml)
[](https://github.com/block-foundation/solidity-private-city/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=suggestion.yml)
[](https://github.com/block-foundation/solidity-private-city/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)
**Private City: A Blockchain-Based City Governance System**
This repository contains the smart contract code, test cases, and deployment scripts for a decentralized application representing a private city management system on the Ethereum blockchain.
## Introduction
Welcome to Private City, a cutting-edge city governance system powered by Ethereum Blockchain technology. In an era where transparency, efficiency, and decentralization are increasingly becoming important, we are harnessing the power of Blockchain to redefine city governance.
PrivateCity is a first-of-its-kind initiative aimed at simulating the operations of a private city using a Solidity smart contract. At its core, it leverages the transparent and immutable nature of blockchain technology to record, track, and manage various aspects of city governance such as citizenship, property ownership, tax payments, and city treasury management.
The project's smart contract includes a variety of features that mirror real-life city operations:
- Citizenship Management: A system to add or remove citizens, where each citizen has a unique identity, and associated properties.
- Property Management: A system that records and tracks property ownership, allowing properties to be added, removed, or transferred between citizens.
- City Treasury: A city treasury to accumulate tax payments, which are calculated based on property ownership.
- Decentralized Finance: A basic decentralized finance system where citizens can deposit and withdraw Ether, and pay taxes based on their property holdings.
The overarching goal of PrivateCity is to explore how blockchain technology can be utilized to create efficient, transparent, and secure systems for city governance. The project aims to stimulate conversations about the potential of blockchain technology in managing not just digital assets, but also tangible assets in real-world environments.
## Overview
`PrivateCity` is a Solidity-based smart contract system that allows:
1. **Citizenship management:** Add or remove citizens.
2. **Property management:** Add, remove, or transfer properties.
3. **Financial system:** Citizens can deposit and withdraw Ether, and pay property taxes.
## Installation
### Prerequisites
Make sure you have `node` and `npm` installed. You also need to have Ethereum wallet software, like [Metamask](https://metamask.io/), set up.
### Steps
1. Clone the repository:
```bash
git clone [repository_url] privatecity
cd privatecity
```
2. Install dependencies:
```bash
npm install
```
3. Compile the contracts:
```bash
npx hardhat compile
```
## Usage
### Local Development
Start a local Ethereum development network:
```bash
npx hardhat node
```
This will start a local Ethereum network for development purposes.
## Testing
Run the tests with:
```bash
npx hardhat test
```
This command will execute the TypeScript test cases using the Hardhat testing environment.
## Deployment
To deploy the contract on your local Ethereum network:
```bash
npx hardhat run scripts/deploy.ts --network localhost
```
Replace `localhost` with another network configuration in `hardhat.config.ts` if you want to deploy to a different network.\
## Quick Start
> Install
``` sh
npm i
```
> Compile
``` sh
npm run compile
```
## Contract
## Development Resources
### Other Repositories
#### Block Foundation Smart Contract Series
| | `Solidity` | `Teal` |
| --------------------------------- | ----------- | ----------- |
| **Template** | [**>>>**](https://github.com/block-foundation/solidity-template) | [**>>>**](https://github.com/block-foundation/teal-template) |
| **Architectural Design** | [**>>>**](https://github.com/block-foundation/solidity-architectural-design) | [**>>>**](https://github.com/block-foundation/teal-architectural-design) |
| **Architecture Competition** | [**>>>**](https://github.com/block-foundation/solidity-architecture-competition) | [**>>>**](https://github.com/block-foundation/teal-architecture-competition) |
| **Housing Cooporative** | [**>>>**](https://github.com/block-foundation/solidity-housing-cooperative) | [**>>>**](https://github.com/block-foundation/teal-housing-cooperative) |
| **Land Registry** | [**>>>**](https://github.com/block-foundation/solidity-land-registry) | [**>>>**](https://github.com/block-foundation/teal-land-registry) |
| **Real-Estate Crowdfunding** | [**>>>**](https://github.com/block-foundation/solidity-real-estate-crowdfunding) | [**>>>**](https://github.com/block-foundation/teal-real-estate-crowdfunding) |
| **Rent-to-Own** | [**>>>**](https://github.com/block-foundation/solidity-rent-to-own) | [**>>>**](https://github.com/block-foundation/teal-rent-to-own) |
| **Self-Owning Building** | [**>>>**](https://github.com/block-foundation/solidity-self-owning-building) | [**>>>**](https://github.com/block-foundation/teal-self-owning-building) |
| **Smart Home** | [**>>>**](https://github.com/block-foundation/solidity-smart-home) | [**>>>**](https://github.com/block-foundation/teal-smart-home) |
---
## Colophon
### Authors
This is an open-source project by the **[Block Foundation](https://www.blockfoundation.io "Block Foundation website")**.
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](https://www.blockfoundation.io "Block Foundation website")
### Development Resources
#### 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](.github/CONTRIBUTING.md) for information.
### Legal Information
#### Copyright
Copyright © 2023 [Stichting Block Foundation](https://www.blockfoundation.io/ "Block Foundation website"). 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](https://creativecommons.org/licenses/by/4.0/), and
code samples are licensed under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
Also see [LICENSE](https://github.com/block-foundation/community/blob/master/src/LICENSE) and [LICENSE-CODE](https://github.com/block-foundation/community/blob/master/src/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.**