Code Monkey home page Code Monkey logo

did-solidity's Introduction

DID-solidity

Specification

Spec

Design and Interface Document

We offer versions in two language:

中文文档

接口文档

设计文档

English Document

interface document

design document

Implementation

Ropsten

EternalStorageProxy: 0x9fF365Eb96B2E1E6F968947F56275D2bBe50F06e

DIDContract: 0x55DE116e54220a243d2e77cEaC78B5F2B3F7f73c

Ethereum

EternalStorageProxy: 0xBc11091d6203500C480f0305140c687aB52b224B

DIDContract: 0x5409Ff9585C9C942389f4f84EE4dc28AE2F361f1

StorageUtils: 0x49831fD1B9753b630A5b220656Dd42D6CD7aE8F1

IterableMapping: 0xeF40fd44b78775Df6FB0b19eb680475Cf2d239Ea

ZeroCopySource: 0xB51D7A841911461d4AE97A49DE78BE086A71a724

ZeroCopySink: 0x252a7aa203A6Df2F7781A124CB95C27aaE4F286C

KeyUtils: 0x22AdA8420468Ea3b3B39B87CDa5742B183c7e28b

DidUtils: 0xE21b6194903282772BCF40FEf6848F28F50B51EE

BytesUtils: 0x5E5003e1B658A9c37660F4E6a730833b8A433047

Gas Consumed

Note: It's just an estimate because it comes from unit test.

name gas
addKey 555392
setAuthKey 191619
deactivateAuthKey 174081
addNewAuthKey 415953
addContext 295411
removeContext 125832
addService 238210
updateService 138008
removeService 127017
deactivateKey 174061
deactivateID 153470
addController 382943
addNewAuthKeyByController 580692
setAuthKeyByController 271635
deactivateAuthKeyByController 269118
addAddr 382321
setAuthAddr 176123
deactivateAuthAddr 165259
deactivateAddr 169394
addNewAuthAddr 388968
deactivateAuthAddr 169481
addNewAuthAddrByController 537963
setAuthAddrByController 267114
deactivateAuthAddrByController 264576

TODO

  1. add more unit test;

did-solidity's People

Contributors

hero5512 avatar qiluge avatar skyinglyh1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

did-solidity's Issues

deploying error in baobab

I am trying to deploy the currently contract to truffle and klaytn IDE, but both cannot.
I think _DIDcontract_is too big, is it possible to deploy?

`truffle test` gives 6 errors (`etho-did` branch)

Here is the truffle test log (by etho-did branch):

  Contract: DID
addController gas:  404173
    ✔ add controller (5909ms)
addNewAuthKeyByController gas:  609223
AddNewAuthKey
    ✔ add new auth key by controller (1652ms)
    1) set auth key by controller

    Events emitted during test:
    ---------------------------

    Ambiguous event, possible interpretations:
    * [object Object].AddKey(
        did: 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' (type: string),
        pubKey: hex'b1618a70e0ee1bfb30cfd4042ca75b863698db0e8c54912e4154a4c0526d32937817753d008ae4cac6cd980400a42000c9d75a9dbe122996fe26ddeb022755b0' (type: bytes),
        controller: [ 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' ] (type: string[])
      )
    * [object Object].AddKey(
        did: 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' (type: string),
        pubKey: hex'b1618a70e0ee1bfb30cfd4042ca75b863698db0e8c54912e4154a4c0526d32937817753d008ae4cac6cd980400a42000c9d75a9dbe122996fe26ddeb022755b0' (type: bytes),
        controller: [ 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' ] (type: string[])
      )


    ---------------------------
    2) deactivate auth key by controller
    > No events were emitted
    ✔ verify controller (227ms)
    3) test add new auth addr by controller
    > No events were emitted
    4) test set auth addr by controller

    Events emitted during test:
    ---------------------------

    Ambiguous event, possible interpretations:
    * [object Object].AddAddr(
        did: 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' (type: string),
        addr: 0x0de84C304cE8eC2Caa7D8655A32EA01d094dd9b3 of unknown class (type: address),
        controller: [ 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' ] (type: string[])
      )
    * [object Object].AddAddr(
        did: 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' (type: string),
        addr: 0x0de84C304cE8eC2Caa7D8655A32EA01d094dd9b3 of unknown class (type: address),
        controller: [ 'did:etho:669391071d55ba1741e0d0951aef661abf06c45d' ] (type: string[])
      )


    ---------------------------
    5) test deactivate auth addr by controller
    > No events were emitted

  Contract: DID
    ✔ test for default public key (346ms)
addKey gas: 588378
    ✔ add another public key (1054ms)
setAuthKey gas: 205849
    ✔ set auth key (931ms)
deactivateAuthKey gas: 182811
    ✔ deactivate auth key (901ms)
addNewAuthKey gas: 436439
    ✔ auth new key (905ms)
addContext gas: 309841
removeContext gas: 179862
    ✔ add and remove context (1247ms)
addService gas: 246240
updateService gas: 144838
removeService gas: 154047
    ✔ add, update and remove service (2267ms)
    ✔ test verify signature (179ms)
    ✔ test get document (699ms)
    ✔ test upgrade (898ms)
    ✔ test data existed after upgraded (746ms)
    ✔ test we can update document after upgraded (628ms)
addKey gas: 430631
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b910
addKey gas: 430631
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b911
addKey gas: 430631
setAuthKey gas: 185949
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b912
addKey gas: 430631
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b913
addKey gas: 430631
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b914
addKey gas: 427831
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b915
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b916
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b917
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b918
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b919
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b920
addKey gas: 428056
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b921
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b922
addKey gas: 430856
setAuthKey gas: 185949
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b923
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b924
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b925
addKey gas: 428056
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b926
addKey gas: 430856
setAuthKey gas: 185949
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b927
addKey gas: 430856
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b928
addKey gas: 428056
setAuthKey gas: 188749
set key: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b929
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b910
deactivateAuthKey gas: 180011
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b912
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b914
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b917
deactivateAuthKey gas: 180011
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b920
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b923
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b925
deactivateAuthKey gas: 182811
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b926
deactivateAuthKey gas: 180011
deactivatedAuth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b928
deactivate num: 9
setAuthKey gas: 188749
re-auth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b910
setAuthKey gas: 188749
re-auth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b912
setAuthKey gas: 185949
re-auth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b914
setAuthKey gas: 188749
re-auth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b917
setAuthKey gas: 188749
re-auth: 133fe269d5587d68b344f0075039059f4fbb12a1667fd7968fe018a99de1fe358c70206f08caef079633c281cd10057ef837d07e777a8b7fc9e2e1359082b920
4 > 1
8 > 4
12 > 8
16 > 12
18 > 16
22 > 18
24 > 22
28 > 24
30 > 28
34 > 30
40 > 34
44 > 40
46 > 44
48 > 46
50 > 48
52 > 50
54 > 52
    ✔ test many pub key and auth key (49062ms)
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 179991
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 179991
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 179991
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 179991
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 179991
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 182791
deactivateKey gas: 182791
    ✔ test deactivate key (19366ms)
addAddr gas: 405920
setAuthAddr gas: 183441
    ✔ test addAddr and setAuthAddr (3453ms)
deactivateAuthAddr gas: 177577
deactivateAddr gas: 177512
    ✔ test deactivate auth addr and deactivate addr (2740ms)
addNewAuthAddr gas: 411779
deactivateAuthAddr gas: 177611
    ✔ test new auth addr (3093ms)
    6) deactivate did
    > No events were emitted

  Contract: DidUtils
    ✔ verify did format (155ms)
pub key fbf38de9fb40edcdab412094d24fa39a314f3d3f52f5860e2509c32522eda30161fe70dfc9f90434d64bd976ede4f112d4f2d8e34d28fe48281663219d2ddac6
addr 0x4c78c9baff8cF573f1e6dFC11bf3A027934AA818
    ✔ pub key to address (131ms)


  22 passing (2m)
  6 failing

  1) Contract: DID
       set auth key by controller:
     Error: VM Exception while processing transaction: revert check controller failed -- Reason given: check controller failed.
      at Context.<anonymous> (test/TestDID_controller.js:68:46)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  2) Contract: DID
       deactivate auth key by controller:
     Error: VM Exception while processing transaction: revert key unauthenticated -- Reason given: key unauthenticated.
      at Context.<anonymous> (test/TestDID_controller.js:86:36)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  3) Contract: DID
       test add new auth addr by controller:
     Error: VM Exception while processing transaction: revert check controller failed -- Reason given: check controller failed.
      at Context.<anonymous> (test/TestDID_controller.js:111:36)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  4) Contract: DID
       test set auth addr by controller:
     Error: VM Exception while processing transaction: revert check controller failed -- Reason given: check controller failed.
      at Context.<anonymous> (test/TestDID_controller.js:130:36)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  5) Contract: DID
       test deactivate auth addr by controller:
     Error: VM Exception while processing transaction: revert check controller failed -- Reason given: check controller failed.
      at Context.<anonymous> (test/TestDID_controller.js:146:36)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  6) Contract: DID
       deactivate did:
     Error: VM Exception while processing transaction: revert check sig failed -- Reason given: check sig failed.
      at Context.<anonymous> (test/TestDID.js:335:36)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.