ITRACERSRegistry
Author: transientlabs.xyz
Interface for TRACE Registered Agents Registry
Functions
setRegisteredAgent
Function to add a global registered agent by the contract owner
This is a for a global registered agent so registeredAgent.numberOfStories
is ignored
MUST emit the event RegisteredAgentUpdate
function setRegisteredAgent(address registeredAgentAddress, RegisteredAgent memory registeredAgent) external;
Parameters
Name | Type | Description |
---|---|---|
registeredAgentAddress | address | The registered agent address |
registeredAgent | RegisteredAgent | The registered agent |
setRegisteredAgentOverride
Function to add a registered agent override by an nft contract owner or admin
MUST emit the event RegisteredAgentOverrideUpdate
function setRegisteredAgentOverride(
address nftContract,
address registeredAgentAddress,
RegisteredAgent calldata registeredAgent
) external;
Parameters
Name | Type | Description |
---|---|---|
nftContract | address | The nft contract |
registeredAgentAddress | address | The registered agent address |
registeredAgent | RegisteredAgent | The registered agent |
isRegisteredAgent
Function callable by an nft contract to check the registered agent
This MUST be called by the nft contract in order to check overrides properly
Adjusts overrides that are limited in the number of stories allowed, hence no view modifier
function isRegisteredAgent(address registeredAgentAddress) external returns (bool, string memory);
Parameters
Name | Type | Description |
---|---|---|
registeredAgentAddress | address | The registered agent address |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool Boolean indicating if the address is question is a registered agent or not |
<none> | string | string The name of the registered agent |
getRegisteredAgent
External view function to get a registered agent, returning an overrided agent for a contract if it exists
function getRegisteredAgent(address nftContract, address registeredAgentAddress)
external
view
returns (RegisteredAgent memory registeredAgent);
Parameters
Name | Type | Description |
---|---|---|
nftContract | address | The nft contract (set to the zero address if not looking for an override) |
registeredAgentAddress | address | The registered agent address |
Returns
Name | Type | Description |
---|---|---|
registeredAgent | RegisteredAgent | The registered agent struct |
Events
RegisteredAgentUpdate
event whenever a registered agent is added, removed, or updated
event RegisteredAgentUpdate(
address indexed sender, address indexed registeredAgentAddress, RegisteredAgent registeredAgent
);
RegisteredAgentOverrideUpdate
event whenever a registered agent override is added, removed, or updated
event RegisteredAgentOverrideUpdate(
address indexed sender,
address indexed nftContract,
address indexed indexedregisteredAgentAddress,
RegisteredAgent registeredAgent
);
Structs
RegisteredAgent
Struct defining a registered agent
struct RegisteredAgent {
bool isPermanent;
uint128 numberOfStories;
string name;
}