From cbb2e1d261762a82ccd8067e17cb4d2c568c5a73 Mon Sep 17 00:00:00 2001 From: spielmanncode <23359516+SpielmannCode@users.noreply.github.com> Date: Thu, 28 May 2020 00:29:40 +0200 Subject: [PATCH 1/3] Addeed Identity Contract --- contracts/Identity.sol | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 contracts/Identity.sol diff --git a/contracts/Identity.sol b/contracts/Identity.sol new file mode 100644 index 0000000..0c722ea --- /dev/null +++ b/contracts/Identity.sol @@ -0,0 +1,45 @@ +pragma solidity =0.5.17; + + +contract LootAccount{ + address payable owner; + uint idCount; + + constructor() public { + owner = msg.sender; + idCount = 0; + } + + mapping (address => mapping (address => uint) ) approvedIdentity ; + + mapping (address => bytes32) approverInfo; + + function registerApprover( bytes32 ipfsHash ) public returns (bool) { + approverInfo[msg.sender] = ipfsHash; + return true; + } + + function approveIdentity( address identity, uint level) public returns (bool) { + require (approverInfo[msg.sender] != 0, "Please register first"); + approvedIdentity[msg.sender][identity] = level; + return true; + } + + function getSecurityLevel( address approver, address identity) public view returns (uint) { + if (approverInfo[approver] != 0 && approvedIdentity[approver][identity] != 0) { + return approvedIdentity[approver][identity]; + } + else { + return 0; + } + } + function getApproverInfo (address approver) public view returns (bytes32) { + if (approverInfo[approver] != 0) { + return approverInfo[approver]; + } + else { + return 0; + } + } + +} From 8d83ebabc83a80e372b84fbf7c1afb4af3ef9497 Mon Sep 17 00:00:00 2001 From: SpielmannCode <23359516+SpielmannCode@users.noreply.github.com`> Date: Thu, 28 May 2020 09:44:13 +0200 Subject: [PATCH 2/3] Initial Identity Contract --- contracts/Identity.sol | 4 ++-- migrations/2_deploy_contracts.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/Identity.sol b/contracts/Identity.sol index 0c722ea..35b6aaf 100644 --- a/contracts/Identity.sol +++ b/contracts/Identity.sol @@ -1,7 +1,7 @@ -pragma solidity =0.5.17; +pragma solidity ^0.5.16; -contract LootAccount{ +contract identity{ address payable owner; uint idCount; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 386c3e3..7e57b7b 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,9 +1,11 @@ const SimpleStorage = artifacts.require("SimpleStorage"); const EventLibrary = artifacts.require("EventLibrary"); const EventFactory = artifacts.require("EventFactory"); +const Identity = artifacts.require("Identity"); module.exports = function (deployer) { deployer.deploy(SimpleStorage); deployer.deploy(EventLibrary); deployer.deploy(EventFactory); + deployer.deploy(Identity); }; From b902c7d9a8eb11c7fe24cc1463ddd80e27acccca Mon Sep 17 00:00:00 2001 From: SpielmannCode <23359516+SpielmannCode@users.noreply.github.com> Date: Thu, 25 Jun 2020 15:32:00 +0200 Subject: [PATCH 3/3] Update Compiler Version Changed Compiler Version on request of @simibac --- contracts/Identity.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/Identity.sol b/contracts/Identity.sol index 35b6aaf..3b043e9 100644 --- a/contracts/Identity.sol +++ b/contracts/Identity.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.16; +pragma solidity ^0.6.8; contract identity{