Selfkey ID Authorization Smart Contract. Signature based authorization mechanism for onchain transactions.
All smart contracts are implemented in Solidity ^0.8.19
, using Hardhat as the Solidity development framework.
- NodeJS, v16.1.0+
- Hardhat, which is a comprehensive framework for Ethereum development.
npm install
npx hardhat test
or with code coverage
npx hardhat coverage
The following public functions are provided:
getMessageHash(address _from, address _to, string memory _scope, bytes32 _param, uint _timestamp) returns (bytes32)
: obtain hashgetEthSignedMessageHash(bytes32 _messageHash) returns (bytes32)
: obtain signed message hashsetMinimumAmount(uint _amount)
onlyOwners: allows owners to change the minimum payment amoutn requiredverify(address _signer, address _from, address _to, string memory _scope, bytes32 _param, uint _timestamp, bytes memory signature) returns (bool)
: Verify if hash correctly signedauthorize(address _from, address _to, string memory _scope, bytes32 _param, uint _timestamp, address signer, bytes memory signature) returns (bool)
: Returns true if hash is validrecoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) returns (address)
: Recover signer
Please see the contributing notes.
Copyright SelfKey DAO Foundation 2024. All rights reserved.