cic-contracts/solidity/AccountsIndex.sol

41 lines
1.5 KiB
Solidity

pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 5
interface AccountsIndex {
event AddressAdded(address indexed addedAccount, uint256 indexed accountIndex); // AccountsIndex
event AddressActive(address indexed _executor, address indexed _account, bool _active);
event AddressRemoved(address indexed _executor, address _account);
// Return number of entries in index
function entryCount() external view returns (uint256);
// Return entry at the spceificed index
// Will revert if index is beyond array length.
// An entry result of
function entry(uint256) external view returns (address);
// Add an entry to the index. Incresases the entry count.
function add(address) external returns (bool);
// Remove an entry from the index. Reduces the entry count.
function remove(address) external returns (bool);
// Verify that the entry exists in the index
function have(address) external view returns (bool);
// Deactivate account but keep in index. Does not affect entry count.
function deactivate(address) external returns (bool);
// Activate previously deactivated account. Does not affect entry count.
function activate(address) external returns (bool);
// Check if account exists and is active;
function isActive(address) external view returns (bool);
// Retrieve the timestamp when account was added
function time(address) external view returns (uint256);
}