Hierarchically delegatable and revocable access control for large-scale IoT devices withtradability on Ethereum
solidity
:v0.5.17+commit.d19bba13
truffle
:v5.3.4
Node
: v14.16.1
gas consumption of functionalitites in Operations.sol
$ npm run test
or
$ truffle test
npm run test [path to test script]
$ npm run test test/Delegate.js
or
$ truffle test test/Delegate.js
Gas consumption of each funtionality
method | gas |
---|---|
Verify | 30820 |
Register | 128539 |
Deposit | 44038 |
Withdraw | 21523 |
Transfer | 42791 |
Delegate (type is "owner") | 174835 |
Delegate (type is "user") | 175004 |
GenerateSessionID | 30766 |
Revoke | 32620 |
Gas consumption when increasing the number of IoT devices (i.e., the length of accTab or IoTDevices)
accTab is mapping
accTabLength | GenerateSessionID | Delegate | Revoke |
---|---|---|---|
10 | 30766 | 175004 | 32620 |
100 | 30766 | 175004 | 32620 |
200 | 30766 | 175004 | 32620 |
300 | 30766 | 175004 | 32620 |
400 | 30766 | 175004 | 32620 |
500 | 30766 | 175004 | 32620 |
600 | 30766 | 175004 | 32620 |
700 | 30766 | 175004 | 32620 |
800 | 30766 | 175004 | 32620 |
900 | 30766 | 175004 | 32620 |
1000 | 30766 | 175004 | 32620 |
1200 | 30766 | 175004 | 32620 |
1400 | 30766 | 175004 | 32620 |
1600 | 30766 | 175004 | 32620 |
1800 | 30766 | 175004 | 32620 |
2000 | 30766 | 175004 | 32620 |