2021-04-28 13:02:50 +02:00
|
|
|
pragma solidity >=0.6.12;
|
|
|
|
|
|
|
|
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2023-03-21 21:46:08 +01:00
|
|
|
// File-version: 4
|
2021-04-28 13:02:50 +02:00
|
|
|
|
2021-10-23 20:42:52 +02:00
|
|
|
interface AddressIndex {
|
|
|
|
event AddressAdded(address indexed addedAccount, uint256 indexed accountIndex); // AccountsIndex
|
2021-05-10 09:13:22 +02:00
|
|
|
|
2021-10-23 20:42:52 +02:00
|
|
|
// Return number of entries in index
|
2021-04-28 13:02:50 +02:00
|
|
|
function entryCount() external view returns (uint256);
|
2021-10-23 20:42:52 +02:00
|
|
|
// Return entry at the spceificed index
|
2023-03-21 21:46:08 +01:00
|
|
|
// Will revert if index is beyond array length.
|
2021-04-28 13:02:50 +02:00
|
|
|
function entry(uint256) external view returns (address);
|
2023-03-21 21:46:08 +01:00
|
|
|
// 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);
|
2021-10-23 20:42:52 +02:00
|
|
|
// Verify that the entry exists in the index
|
2023-03-21 21:46:08 +01:00
|
|
|
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);
|
2021-04-28 13:02:50 +02:00
|
|
|
}
|