https://github.com/block-foundation/solidity-ifc-data
Solidity Smart Contract: IFC Data
https://github.com/block-foundation/solidity-ifc-data
aec architecture bim bim-applications bim-data bim-model block-foundation blockfoundation construction eth ethereum ifc industry-foundation-classes smart-contracts sol solidity
Last synced: 5 months ago
JSON representation
Solidity Smart Contract: IFC Data
- Host: GitHub
- URL: https://github.com/block-foundation/solidity-ifc-data
- Owner: block-foundation
- License: cc-by-sa-4.0
- Created: 2023-08-02T04:39:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T08:26:04.000Z (over 1 year ago)
- Last Synced: 2025-09-04T21:41:47.462Z (9 months ago)
- Topics: aec, architecture, bim, bim-applications, bim-data, bim-model, block-foundation, blockfoundation, construction, eth, ethereum, ifc, industry-foundation-classes, smart-contracts, sol, solidity
- Language: TypeScript
- Homepage: https://www.blockfoundation.io
- Size: 179 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-ifc-data/blob/main/LICENSE)
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/block-foundation/solidity-ifc-data)
---
IFC Data
Block Foundation Smart Contract Series [Solidity]
---

### Contents
- [Introduction](#introduction)
- [Colophon](#colophon)
---
[](https://github.com/block-foundation/solidity-ifc-data/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=bug_report.yml)
[](https://github.com/block-foundation/solidity-ifc-data/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=feature_request.yml)
[](https://github.com/block-foundation/solidity-ifc-data/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=question.yml)
[](https://github.com/block-foundation/solidity-ifc-data/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=suggestion.yml)
[](https://github.com/block-foundation/solidity-ifc-data/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)
**The `IFCDataContract` is a Solidity-based Ethereum smart contract designed to facilitate the integration with Industry Foundation Classes (IFC) data through a decentralized oracle mechanism.**
## Introduction
The `IFCDataContract` is a Solidity smart contract designed to integrate with Industry Foundation Classes (IFC) data via an Oracle.
> IFC is a data standard used widely in the architecture, engineering, and construction (AEC) industry to facilitate interoperability between different software used in these fields. The data standard encompasses various elements of building information modeling (BIM) including building elements, cost management, project management, structural elements, and more.
> Industry Foundation Classes (IFC) is a crucial data standard in the architecture, engineering, and construction (AEC) industry, serving to promote interoperability across varying software platforms. `IFCDataContract` aims to bridge the gap between the decentralized world of Ethereum and the AEC industry by allowing seamless access to IFC data.
The `IFCDataContract` contract acts as a client contract in a decentralized oracle network and is designed to request specific IFC data from an external data source, receive and store that data, and then provide access to the stored data.
The contract includes:
- A function (`requestIFCData`) to request IFC data from the oracle. This function emits a `ReceivedNewRequestId` event that includes the unique request ID for tracking the request.
- A function (`fulfillIFCData`) that is used by the oracle to fulfill the data request. This function updates the contract's state with the received data and emits an `IFCDataUpdated` event.
- A function (`getIFCData`) to access the stored IFC data using the request ID.
The contract is derived from the `Ownable` contract, giving it a basic access control mechanism with an owner role. The owner can request IFC data, while the oracle is the only address authorized to fulfill data requests.
This contract represents a simple yet powerful example of how blockchain technology can interact with industry-specific standards like IFC, enabling the creation of decentralized applications that can serve specialized use cases in sectors such as construction and architecture.
## Features
- **Oracle Integration**: Request and retrieve IFC data via a decentralized oracle.
- **Access Control**: Based on the `Ownable` pattern, ensures only authorized calls.
- **Event Logging**: Enhanced traceability and frontend integration support.
## Setup & Installation
1. **Prerequisites**:
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
- [Hardhat](https://hardhat.org/)
- Ethereum Wallet (e.g., [Metamask](https://metamask.io/))
2. **Clone the repository**:
```bash
git clone
cd IFCDataContract
```
3. **Install dependencies**:
```bash
npm install
```
## Usage
1. **Compile the Contract**:
```bash
npx hardhat compile
```
2. **Deploy the Contract**:
```bash
npx hardhat run scripts/deploy.js --network rinkeby
```
Replace `rinkeby` with your desired network.
## Testing
1. **Run the Test Script**:
```bash
npx hardhat test
```
## Class Diagram
``` mermaid
classDiagram
class IFCDataContract {
-address public oracle
-mapping(bytes32 => IFCData) private ifcData
-event ReceivedNewRequestId(bytes32 indexed requestId)
-event IFCDataUpdated(bytes32 indexed requestId, string buildingName, uint256 buildingHeight, uint256 buildingArea, uint256 buildingVolume)
-modifier onlyOracle()
+function requestIFCData() public onlyOwner
+function fulfillIFCData(bytes32 _requestId, string memory _buildingName, uint256 _buildingHeight, uint256 _buildingArea, uint256 _buildingVolume) public onlyOracle
+function getIFCData(bytes32 _requestId) public view returns (IFCData memory)
}
class Ownable {
-address public owner
-event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
-modifier onlyOwner()
+function transferOwnership(address newOwner) public onlyOwner
}
class IFCData {
string buildingName
uint256 buildingHeight
uint256 buildingArea
uint256 buildingVolume
}
IFCDataContract --|> Ownable
```
In this diagram:
- `IFCDataContract` is the main contract.
- It is a subclass of `Ownable`, meaning it inherits from the `Ownable` contract.
- `IFCData` is a struct used in the `IFCDataContract` contract.
- The contract has a mapping called `ifcData` from `bytes32` to `IFCData`.
- Functions, modifiers, and events in the contract are also represented.
---
## 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.**