solidity-digital-twin

Solidity Smart Contract: Digital Twin

https://github.com/block-foundation/solidity-digital-twin

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
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary

Keywords

architecture bim block-foundation blockchain blockfoundation building chainlink construction digital-twin eth ethereum hardhat oracle real-estate-management smart-contracts sol solidity
Last synced: 4 months ago · JSON representation ·

Repository

Solidity Smart Contract: Digital Twin

Basic Info
  • Host: GitHub
  • Owner: block-foundation
  • License: cc-by-sa-4.0
  • Language: Solidity
  • Default Branch: main
  • Homepage: https://www.blockfoundation.io
  • Size: 92.8 KB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 2
  • Open Issues: 5
  • Releases: 0
Topics
architecture bim block-foundation blockchain blockfoundation building chainlink construction digital-twin eth ethereum hardhat oracle real-estate-management smart-contracts 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-digital-twin/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-digital-twin)

Block Foundation Logo

Digital Twin

Block Foundation Smart Contract Series [Solidity]


Block Foundation Brand

Contents



[![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-digital-twin/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-digital-twin/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-digital-twin/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-digital-twin/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-digital-twin/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)

This repository contains a smart contract for a Digital Twin of a building, which fetches real-time data using Chainlink Oracles. This data includes temperature, humidity, occupancy, energy consumption, structural health, water consumption, and air quality. Additionally, the contract allows for the logging of maintenance reports.

Introduction

This Building Digital Twin Smart Contract creates a digital representation of a physical building. The digital twin concept is an important aspect of modern construction and building management as it allows for real-time monitoring, predictive maintenance, and simulations of different scenarios.

This smart contract utilizes Chainlink, a decentralized oracle network, to securely retrieve and write real-world data onto the blockchain. The parameters fetched include environmental aspects such as temperature and humidity, occupancy levels, energy and water consumption levels, and air quality data. It also considers the structural health of the building, providing a comprehensive digital overview of the physical building's state.

Moreover, the contract allows the owner to log maintenance reports, thereby enabling an integrated overview of not just the physical parameters but also the maintenance and repair history.

With the use of modifiers, this contract ensures that only the owner of the contract can update the parameters and add maintenance reports, providing a robust access control mechanism.

This contract is an example of the versatility and potential of Ethereum smart contracts, and how they can interface with real-world data via oracles. By using this, building owners, management, and residents could have a clearer picture of the building's condition, maintenance needs, and usage patterns in real-time.

Quick Start

Install

sh npm i

Compile

sh npm run compile

Features

  • Real-time Building Data: Use Chainlink Oracles to fetch and update building parameters.
  • Maintenance Reports: Log and retrieve maintenance activities and timestamps.
  • Owner Only Actions: Restricted access functions for the building owner to maintain control over data and settings.

Prerequisites

Installation

  1. Clone the repository:

bash git clone https://github.com/your-repository-link.git

  1. Navigate to the repository folder:

bash cd path-to-folder

  1. Install dependencies:

bash npm install

Usage

  1. Deploy the contract:

bash truffle migrate --network desired_network

  1. Interact with the contract functions using your preferred method (Truffle console, web interface, etc.).

Testing

  1. To run tests:

bash truffle test

  1. Ensure all tests pass and verify the coverage report.

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 | >>> | >>> |


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

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-digital-twin
version: 0.0.1
date-released: 2023-07-01
url: "https://github.com/block-foundation/solidity-digital-twin"
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: 2
  • Issue comment event: 4
  • Pull request event: 3
  • Create event: 2
Last Year
  • Delete event: 2
  • Issue comment event: 4
  • Pull request event: 3
  • Create event: 2

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