cic-contracts/solidity/Declarator.sol

34 lines
1.6 KiB
Solidity
Raw Normal View History

2021-02-14 13:22:42 +01:00
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
2023-03-24 12:05:21 +01:00
// File-version: 3
2021-02-14 13:22:42 +01:00
2023-03-25 13:32:56 +01:00
interface IDeclarator {
2023-03-24 12:05:21 +01:00
event DeclarationAdded(address indexed _declarator, address indexed _subject, bytes32 indexed _topic, bytes32 _proof);
2023-03-24 12:05:21 +01:00
// Get all declarations for a subject (without topic) signed by a declarator
2021-04-28 11:59:47 +02:00
function declaration(address _declarator, address _subject) external view returns ( bytes32[] memory );
2023-03-24 12:05:21 +01:00
// Get all declarations for a subject for the given topic signed by a declarator
function declaration(address _declarator, address _subject, bytes32 _topic) external view returns ( bytes32[] memory );
// Get number of declarations the declarator has ever signed
2021-04-28 11:59:47 +02:00
function declarationCount(address _declarator) external view returns ( uint256 );
// Get the subject of a declarator's declarations at the specific index
2021-04-28 11:59:47 +02:00
function declarationAddressAt(address _declarator, uint256 _idx) external view returns ( address );
// Add a declaration for the subject
2021-04-28 11:59:47 +02:00
function addDeclaration(address _subject, bytes32 _proof) external returns ( bool );
2023-03-24 12:05:21 +01:00
// Add a declaration with topic for the subject
function addDeclaration(address _subject, bytes32 _proof, bytes32 _topic) external returns ( bool );
// Get the declarator that signed a declaration at the specificed index for a subject
2021-04-28 11:59:47 +02:00
function declaratorAddressAt(address _subject, uint256 _idx) external view returns ( address );
// Get the number of declarators that have signed for a subject
2021-04-28 11:59:47 +02:00
function declaratorCount(address _subject) external view returns ( uint256 );
2021-02-14 13:22:42 +01:00
}