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.
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.
Install
npm i
Compile
npm run compile
- 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.
- Node.js
- Truffle
- Ethereum Wallet: For interacting with the deployed contract.
- Chainlink Node: If you want to run your own oracle.
- Clone the repository:
git clone https://github.com/your-repository-link.git
- Navigate to the repository folder:
cd path-to-folder
- Install dependencies:
npm install
- Deploy the contract:
truffle migrate --network desired_network
- Interact with the contract functions using your preferred method (Truffle console, web interface, etc.).
- To run tests:
truffle test
- Ensure all tests pass and verify the coverage report.
Solidity |
Teal |
|
---|---|---|
Template | >>> | >>> |
Architectural Design | >>> | >>> |
Architecture Competition | >>> | >>> |
Housing Cooporative | >>> | >>> |
Land Registry | >>> | >>> |
Real-Estate Crowdfunding | >>> | >>> |
Rent-to-Own | >>> | >>> |
Self-Owning Building | >>> | >>> |
Smart Home | >>> | >>> |
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
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.
Copyright © 2023 Stichting Block Foundation. All Rights Reserved.
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.
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.