Skip to content
Verified contractPartial

SmartRightsCertify

Address0xebecbdf1d39abfd679a25319a07cde299403349f
Balance

0 ETH

 

Transactions

69

 

Compiler

solc 0.5.16

 

Same code

Only this contract

 

Details

Compiler
solc 0.5.16+commit.9c3226ce
Language
solidity
Optimization
No
EVM version
istanbul
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
10,796,230
Creation transaction
0xafdcf79d08…dc8ab6fe23

SmartRightsCertify.sol

pragma solidity >=0.4.22 <0.8.0;

import "./ISmartRightsCertify.sol";

contract SmartRightsCertify is ISmartRightsCertify {

    address owner;
    mapping(bytes32 => address) userCertifications;
    mapping(address => bool) whitelist;

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyWhitelist() {
        require(whitelist[msg.sender] == true, "NotInWhitelist");
        _;
    }

    modifier onlyOwner() {
        require(msg.sender == owner, "OnlyOwner");
        _;
    }

    function certifyHash(address _owner, bytes32 _hash) external onlyOwner {
        require(userCertifications[_hash] == address(0), "DuplicateData");
        userCertifications[_hash] = _owner;
    }

    function certifyHash(bytes32 _hash) external onlyWhitelist {
        require(userCertifications[_hash] == address(0), "DuplicateData");
        userCertifications[_hash] = msg.sender;
    }

    function getHashOwner(bytes32 _hash) external view returns(address) {
        return userCertifications[_hash];
    }

    function addToWhitelist(address user) external onlyOwner {
        whitelist[user] = true;
    }
}

ISmartRightsCertify.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.4.22 <0.8.0;

interface ISmartRightsCertify {
    function certifyHash(address _owner, bytes32 _hash) external;
    function certifyHash(bytes32 _hash) external;
    function getHashOwner(bytes32 _hash) external view returns(address);
    function addToWhitelist(address user) external;
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "istanbul",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.