2021-04-28 13:02:50 +02:00
|
|
|
pragma solidity >=0.6.12;
|
|
|
|
|
|
|
|
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
2023-03-25 12:14:46 +01:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-03-26 10:58:23 +02:00
|
|
|
// File-version: 6
|
2021-04-28 13:02:50 +02:00
|
|
|
|
2023-03-25 13:32:56 +01:00
|
|
|
interface IAccountsIndex {
|
2023-03-26 10:58:23 +02:00
|
|
|
// Address added to store, index in array.
|
|
|
|
event AddressAdded(uint256 indexed _idx, address _account);
|
2021-05-10 09:13:22 +02:00
|
|
|
|
2023-03-26 10:58:23 +02:00
|
|
|
// Return number of entries in index.
|
2021-04-28 13:02:50 +02:00
|
|
|
function entryCount() external view returns (uint256);
|
2023-03-25 12:14:46 +01:00
|
|
|
|
2023-03-26 10:58:23 +02:00
|
|
|
// Return entry at the spceificed index.
|
2023-03-21 21:46:08 +01:00
|
|
|
// Will revert if index is beyond array length.
|
2023-03-26 10:58:23 +02:00
|
|
|
// An entry result of 0 means the entry should be skipped, and not count towards entry count.
|
2021-04-28 13:02:50 +02:00
|
|
|
function entry(uint256) external view returns (address);
|
2023-03-25 12:14:46 +01:00
|
|
|
|
2023-03-21 21:46:08 +01:00
|
|
|
// Add an entry to the index. Incresases the entry count.
|
|
|
|
function add(address) external returns (bool);
|
2023-03-25 12:14:46 +01:00
|
|
|
|
2023-03-26 10:58:23 +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);
|
2023-03-25 12:14:46 +01:00
|
|
|
|
2023-03-26 10:58:23 +02:00
|
|
|
// Retrieve the timestamp when account was added.
|
|
|
|
// If time is not being tracked, a value of 0 should be returned.
|
2023-03-21 21:46:08 +01:00
|
|
|
function time(address) external view returns (uint256);
|
2021-04-28 13:02:50 +02:00
|
|
|
}
|