Skip to content

AEI Smart Contract is written in Solidity using ERC721 standard (NFT) and can be used with Ethereum Clients. It is compatible with FIWARE-Canis Major Adaptor to store the data in the blockchain. AEI, asset, events (metadata), relationship, are designed to store the NGSI-LD model with the help of Canis Major Adaptor.

License

Notifications You must be signed in to change notification settings

FIWARE-Blockchain/AEIContract

Repository files navigation

AEI Smart Contract

CodeQL Solium Security Contract Test CI NPM Version License

AEI Smart Contract is written in Solidity using ERC721 standard (NFT) and can be use with Ethereum Clients. It is compatible with FIWARE-Canis Major Adaptor to store the data in blockchain. AEI, asset, events (metadata), relationship, is designed to store the NGSI-LD model with the help of Canis Major Adaptor.

AEI Model Architecture

AEI Model Architecture

  1. Entity/Asset with a unique identity will be a new asset (1:1 mapping of asset to an identity).
  2. Event or Metadata of the asset/entity has a 1:n mapping.
  3. An Asset can have a 1:n relationship with any other asset.

Example

Example

To Store the NGSI-LD model there are few possibilities with the help of some supported storage type:

  1. IPFS
  2. IOTA MaM
  3. MerkleRoot

Example

Methods

- createAsset(bytes32 uuid, string memory _newHash)
- getAsset(bytes32 uuid)
- updateAsset(bytes32 uuid, string memory _newHash)
- removeAsset (bytes32 uuid)
- isValidAssetEthMessage(bytes32 uuid, bytes32 _messageHash, bytes memory _signature)
- addRelation(bytes32 uuid, bytes32 reluuid)
- getRelations(bytes32 uuid)
- removeRelation(bytes32 uuid, uint index)
- isValidRelation(bytes32 uuid, uint index, bytes32[] memory _proof, bytes32 _leaf)
- addMetadata(bytes32 uuid, string memory _metadatahash)
- getMetadatas(bytes32 uuid) public view returns (string[] memory)
- removeMetadata(bytes32 uuid, uint index)

Apart from that ERC721, Ownable, MerkleProof, ECDSA methods are supported.

Dependencies

This project uses:

  • truffle
  • NodeJS
  • Ganache-CLI (testrpc)
  • OpenZeppelin

License

AEI Contract is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

© 2021 FIWARE Foundation e.V.

About

AEI Smart Contract is written in Solidity using ERC721 standard (NFT) and can be used with Ethereum Clients. It is compatible with FIWARE-Canis Major Adaptor to store the data in the blockchain. AEI, asset, events (metadata), relationship, are designed to store the NGSI-LD model with the help of Canis Major Adaptor.

Resources

License

Stars

Watchers

Forks

Packages

No packages published