Skip to content

Solidity API

AgentRoles

RoleAdded

solidity
event RoleAdded(address _agent, string _role)

Emitted when a new role is assigned to an agent.

This event is triggered whenever a new role is added for an address.

RoleRemoved

solidity
event RoleRemoved(address _agent, string _role)

Emitted when a role is removed from an agent.

This event is triggered whenever an address is removed from a specific role.

InvalidAdmin

solidity
error InvalidAdmin(address sender)

Thrown when an invalid admin tries to execute a restricted action.

This error is used to revert the transaction when the caller does not have admin privileges.

InvalidAdminOrWhitelistManager

solidity
error InvalidAdminOrWhitelistManager(address sender)

Thrown when neither an admin nor a whitelist manager tries to execute a restricted action.

This error is used to revert the transaction when the caller does not meet the requirements for the operation.

onlyAdmin

solidity
modifier onlyAdmin()

Ensures that the caller is either the contract owner or an Agent Admin.

_Checks if the caller is the owner of the contract or has the Agent Admin role.

Error:

  • InvalidAdmin: Reverted if the caller is neither the owner of the contract not an Agent Admin._

isAdminOrWhitelistManager

solidity
modifier isAdminOrWhitelistManager()

Ensures the caller is either the contract owner, an Agent Admin, or a Whitelist Manager.

_Checks if the caller has the necessary roles to execute the function.

Error:

  • InvalidAdminOrWhitelistManager: Reverted if the caller is neither the contract owner, an Agent Admin, nor a Whitelist Manager._

addAgentAdmin

solidity
function addAgentAdmin(address _agent) external

Adds an agent as an AgentAdmin.

_This function adds the specified agent to the AgentAdmin role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "AgentAdmin".

removeAgentAdmin

solidity
function removeAgentAdmin(address _agent) external

Removes an agent from the AgentAdmin role.

_This function removes the specified agent from the AgentAdmin role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "AgentAdmin".

addSupplyModifier

solidity
function addSupplyModifier(address _agent) external

Adds an agent as a SupplyModifier.

_This function adds the specified agent to the SupplyModifier role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "SupplyModifier".

removeSupplyModifier

solidity
function removeSupplyModifier(address _agent) external

Removes an agent from the SupplyModifier role.

_This function removes the specified agent from the SupplyModifier role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "SupplyModifier".

addFreezer

solidity
function addFreezer(address _agent) external

Adds an agent as a Freezer.

_This function adds the specified agent to the Freezer role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "Freezer".

removeFreezer

solidity
function removeFreezer(address _agent) external

Removes an agent from the Freezer role.

_This function removes the specified agent from the Freezer role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "Freezer".

addTransferManager

solidity
function addTransferManager(address _agent) external

Adds an agent as a TransferManager.

_This function adds the specified agent to the TransferManager role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "TransferManager".

removeTransferManager

solidity
function removeTransferManager(address _agent) external

Removes an agent from the TransferManager role.

_This function removes the specified agent from the TransferManager role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "TransferManager".

addRecoveryAgent

solidity
function addRecoveryAgent(address _agent) external

Adds an agent as a RecoveryAgent.

_This function adds the specified agent to the RecoveryAgent role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "RecoveryAgent".

removeRecoveryAgent

solidity
function removeRecoveryAgent(address _agent) external

Removes an agent from the RecoveryAgent role.

_This function removes the specified agent from the RecoveryAgent role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "RecoveryAgent".

addComplianceAgent

solidity
function addComplianceAgent(address _agent) external

Adds an agent as a ComplianceAgent.

_This function adds the specified agent to the ComplianceAgent role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "ComplianceAgent".

removeComplianceAgent

solidity
function removeComplianceAgent(address _agent) external

Removes an agent from the ComplianceAgent role.

_This function removes the specified agent from the ComplianceAgent role.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed. Emits: - RoleRemoved: Emitted when a role is removed with the agent address and the role "ComplianceAgent".

addWhiteListManager

solidity
function addWhiteListManager(address _agent) external

Adds an agent as a WhiteListManager.

_This function allows an admin to add an agent to the list of whitelist managers.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added as a whitelist manager. Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "WhiteListManager.

callAddWhiteListManager

solidity
function callAddWhiteListManager(address _agent, contract IIdentity _onchainID) external

Adds an agent as a WhiteListManager with additional validation.

This function allows different roles, including non-owner agents and whitelist managers, to add an agent if they meet specific conditions.

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be added as a whitelist manager.
_onchainIDcontract IIdentityThe on-chain identity of the caller. Error: - InvalidAdminOrWhitelistManager: Reverted if the caller is neither the owner of contract, an Agent Admin, nor a whitelist manager Emits: - RoleAdded: Emitted when a role is added with the agent address and the role "WhiteListManager.

removeWhiteListManager

solidity
function removeWhiteListManager(address _agent) external

Removes an agent from the WhiteListManager role.

_This function allows an admin to remove an agent from the list of whitelist managers.

Requirements:

  • Caller must be an admin._

Parameters

NameTypeDescription
_agentaddressThe address of the agent to be removed as a whitelist manager. Emits: - RoleRemoved: Emitted when a whitelist manager role is removed with the agent address and the role "WhiteListManager".

isAgentAdmin

solidity
function isAgentAdmin(address _agent) public view returns (bool)

Checks if the agent is an Agent Admin.

This function verifies whether the provided address is an Agent Admin.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is an Agent Admin.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is an Agent Admin, otherwise false.

isWhiteListManager

solidity
function isWhiteListManager(address _agent) public view returns (bool)

Checks if the agent is a whitelist manager.

This function verifies whether the provided address is a whitelist manager.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a whitelist manager.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a whitelist manager, otherwise false.

isComplianceAgent

solidity
function isComplianceAgent(address _agent) public view returns (bool)

Checks if the agent is a compliance agent.

This function verifies whether the provided address is a compliance agent.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a compliance agent.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a compliance agent, otherwise false.

isRecoveryAgent

solidity
function isRecoveryAgent(address _agent) public view returns (bool)

Checks if the agent is a recovery agent.

This function verifies whether the provided address is a recovery agent.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a recovery agent.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a recovery agent, otherwise false.

isTransferManager

solidity
function isTransferManager(address _agent) public view returns (bool)

Checks if the agent is a transfer manager.

This function verifies whether the provided address is a transfer manager.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a transfer manager.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a transfer manager, otherwise false.

isFreezer

solidity
function isFreezer(address _agent) public view returns (bool)

Checks if the agent is a freezer.

This function verifies whether the provided address is a freezer.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a freezer.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a freezer, otherwise false.

isSupplyModifier

solidity
function isSupplyModifier(address _agent) public view returns (bool)

Checks if the agent is a supply modifier.

This function verifies whether the provided address is a supply modifier.

Parameters

NameTypeDescription
_agentaddressThe address to check if it is a supply modifier.

Return Values

NameTypeDescription
[0]boolReturns true if the agent is a supply modifier, otherwise false.