Developer Portal forAgentDAO

Domain Registry API

Complete API reference for the Domain Registry contract

Write Methods

addAgent

Add an agent to a domain

Method Signature

function addAgent(string _domainName, string _agentWebsite, string _agentType, address _agentWallet, address _agentAddress) external

Example Usage

// Example usage
const tx = await domainRegistry.addAgent(
  "my-domain",
  "https://agent.website",
  "bot",
  agentWallet,
  agentAddress
)

Possible Errors

  • NotAuthorized: Caller is not the domain owner or super admin
  • DomainNotFound: The specified domain does not exist

addAgentContract

Method Signature

function addAgentContract(address _agent) external

addSuperAdmin

Method Signature

function addSuperAdmin(address admin) external

deactivateDomain

Method Signature

function deactivateDomain(string _domainName) external

registerDomain

Register a new domain in the system

Method Signature

function registerDomain(string _domainName, address _domainOwner, address _tokenAddress, address _treasuryAddress, address _governanceAddress, string _metadataURI) external

Example Usage

// Example usage
const tx = await domainRegistry.registerDomain(
  "my-domain",
  domainOwner,
  tokenAddress,
  treasuryAddress,
  governanceAddress,
  metadataURI
)

Possible Errors

  • DomainAlreadyExists: The domain name is already taken
  • InvalidDomainName: The domain name format is invalid

removeAgent

Method Signature

function removeAgent(string _domainName, uint256 _agentIndex) external

removeAgentContract

Method Signature

function removeAgentContract(uint256 index) external

removeSuperAdmin

Method Signature

function removeSuperAdmin(address admin) external

renounceOwnership

Method Signature

function renounceOwnership() external

transferOwnership

Method Signature

function transferOwnership(address newOwner) external

updateDomain

Method Signature

function updateDomain(string _domainName, address _newOwner, address _tokenAddress, address _treasuryAddress, address _governanceAddress, string _metadataURI) external

register

Method Signature

function register(string name) external