aeicontract
v0.0.2
Published
AEI Contract
Maintainers
Readme
AEI Smart Contract
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
![]()
- Entity/Asset with a unique identity will be a new asset (1:1 mapping of asset to an identity).
- Event or Metadata of the asset/entity has a 1:n mapping.
- An Asset can have a 1:n relationship with any other asset.
Example
![]()
To Store the NGSI-LD model there are few possibilities with the help of some supported storage type:
- IPFS
- IOTA MaM
- MerkleRoot
![]()
Methods
- createAsset(bytes32 uuid, string memory _newHash)
- getAsset(bytes32 uuid)
- updateAsset(bytes32 uuid, string memory _newHash)
- removeAsset (bytes32 uuid)
- isValidAsset(bytes32 uuid, bytes32[] memory _proof, bytes32 _leaf)
- 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)
- isValidMetadata(bytes32 uuid, uint index, bytes32[] memory _proof, bytes32 _leaf)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 MIT License.
© 2021 FIWARE Foundation e.V.
