ToolszkEVMArchitectureHigh levelSmart contractsApiConsensusDataComittee

CDKDataCommittee.sol

## Functions ### ### Allows the admin to setup members of the committee. - The system requires N/M signatures where N => and M => . - The number of urls must be

Functions

initialize

  function initialize(
  ) external

setupCommittee

Allows the admin to setup members of the committee.

  function setupCommittee(
    uint256 _requiredAmountOfSignatures,
    string[] urls,
    bytes addrsBytes
  ) external
  • The system requires N/M signatures where N => _requiredAmountOfSignatures and M => urls.length.
  • The number of urls must be the same as the addresses encoded in the addrsBytes.
  • A member is represented by a url and the address contained in urls[i] and addrsBytes[i*_ADDR_SIZE : i*_ADDR_SIZE + _ADDR_SIZE].
Parameters
NameTypeDescription
_requiredAmountOfSignaturesuint256Required amount of signatures
urlsstring[]List of urls of the members of the committee
addrsBytesbytesByte array that contains the addressess of the members of the committee

getAmountOfMembers

  function getAmountOfMembers(
  ) public returns (uint256)

verifySignatures

Verifies that the given signedHash has been signed by requiredAmountOfSignatures committee members.

  function verifySignatures(
    bytes32 signedHash,
    bytes signaturesAndAddrs
  ) external
Parameters
NameTypeDescription
signedHashbytes32Hash that must have been signed by requiredAmountOfSignatures of committee members
signaturesAndAddrsbytesByte array containing the signatures and all the addresses of the committee in ascending order
[signature 0, ..., signature requiredAmountOfSignatures -1, address 0, ... address N]
note that each ECDSA signatures are used, therefore each one must be 65 bytes

Events

CommitteeUpdated

Emitted when the committee is updated.

  event CommitteeUpdated(
    bytes32 committeeHash
  )
Parameters
NameTypeDescription
committeeHashbytes32hash of the addresses of the committee members
Edit on GitHub

Last updated on