Skip to main content

DID

Setup Remix IDE

  • Please go to the remix website.

  • Copy the file to the remix on the file explorer page : file can be uploaded to the explorer or you can create new file named did.sol and paste code in new file.

  • Go to solidity compiler page

  • Compile the contract

  • Go to deploy and run page

  • Select the Environment to inject provider Metamask

  • Choose the account which has the token

  • Choose the smart contract

  • Set the 0x0000000000000000000000000000000000000800 in the address and click At Address

evm-did-1

  • Click the deployed Contracts and test the below functions.

Functions

  1. add_attribute

    • Parameter:

      • did_account: should be the public's hex key (0x…). Substrate account that should be converted to hex format with website
      • key: should be hex.
      • value: should be hex
      • validity_for: if you don't want to set it, please fill 0
    • Behavior:

      • The same as extrinsic, peaqDid -> addAttribute
    • Result:

      • Please check the eth transaction is okay (in metamask or in remix)
      • Please check whether the EVM log appears in remix's terminal
      • Please check whether this DID exist on the Substrate side (in polkadot.js recent events or via read_attribute extrinsic)

evm-did-2

  1. update_attribute

    • Parameter:
      • did_account: should be the public's hex key (0x…)
      • key: should be hex
      • value: should be hex
      • validity_for: if you don't want to set it, please fill 0
    • Behavior:
      • The same as extrinsic, peaqDid -> updateAttribute
    • Result:
      • Please check the eth transaction is okay
      • Please check whether the EVM log appears
      • Please check whether this DID change on the Substrate side

evm-did-3

  1. remove_attribute

    • Parameter:
      • did_account: should be the public's hex key (0x…)
      • key: should be hex
    • Behavior:
      • The same as extrinsic, peaqDid -> removeAttribute
    • Result:
      • Please check the eth transaction is okay
      • Please check whether the EVM log appears
      • Please check whether this DID remove on the Substrate side

evm-did-4

  1. read_attribute
    • Parameter:
      • did_account: should be the public's hex key (0x…)
      • key: should be hex
    • Behavior:
      • The same as RPC, peaqDid -> readAttributes
    • Result:
      • Please check that you can get the related information under the read_attribute fields, information is displayed in "tuple: xxx'

evm-did-5