AgentManager

ADMIN

bytes32 ADMIN

APPROVE

bytes32 APPROVE

ApproveAgent

event ApproveAgent(address agent, address rewardAddress)

BanAgent

event BanAgent(address agent)

DeclareProtocolSupport

event DeclareProtocolSupport(address agent, address transmitter, bytes32 protocolId)

RevokeProtocolSupport

event RevokeProtocolSupport(address agent, bytes32 protocolId)

PauseAgent

event PauseAgent(address agent)

UnpauseAgent

event UnpauseAgent(address agent)

isInit

bool isInit

setContracts init marker

agents

address[] agents

all agent addresses

stakingManager

contract StakingManager stakingManager

stakingManager

externalDeveloperHub

contract ExternalDeveloperHub externalDeveloperHub

externalDeveloperHub

masterSmartContract

contract MasterSmartContract masterSmartContract

masterSmartContract

globalConfig

contract GlobalConfig globalConfig

globalConfig

approvedAgents

mapping(address => bool) approvedAgents

agents approved with KYB

pausedAgents

mapping(address => bool) pausedAgents

pausedAgents

rewardAddress

mapping(address => address) rewardAddress

reward addresses for agents

transmitters

mapping(address => mapping(bytes32 => address)) transmitters

transmitter is agent worker address for protocol

agentByTransmitter

mapping(address => address) agentByTransmitter

agentByTransmitter

transmitterCount

mapping(address => uint256) transmitterCount

transmitter count for each agent

initialize

function initialize(address[2] initAddr) public

Initialize

Parameters

Name
Type
Description

initAddr

address[2]

isApprovedAgent

modifier isApprovedAgent()

Check if agent is KYB-approved.

setContracts

function setContracts(address[4] initAddr) external

Set contracts addresses

_authorizeUpgrade

function _authorizeUpgrade(address) internal

approveAgent

function approveAgent(address agent, address _rewardAddress) external

Approve agent after KYB and set its reward address

Parameters

Name
Type
Description

agent

address

- agent address

_rewardAddress

address

- reward address for agent

banAgent

function banAgent(address agent) external

Ban agent and remove it from protocols and slash full personal stake (TODO)

Parameters

Name
Type
Description

agent

address

- agent address

declareProtocolSupport

function declareProtocolSupport(bytes32 protocolId, address transmitterAddress) external

Declare protocol support by agent and set transmitter address generated by agent for protocol

Parameters

Name
Type
Description

protocolId

bytes32

- protocol id

transmitterAddress

address

- Agent's transmitter address for the protocol

revokeProtocolSupport

function revokeProtocolSupport(bytes32 protocolId) external

Stop protocol support for given protocol

Parameters

Name
Type
Description

protocolId

bytes32

- protocol id

pauseAgent

function pauseAgent() external

Pause agent (self) from participating in next election

unpauseAgent

function unpauseAgent() external

Unpause agent (self) and allow it to participate in next election

getAgents

function getAgents() external view returns (address[])

Get agents qualified to participate in next election

protocolSupported

function protocolSupported(address _agent, bytes32 _protocolId) external view returns (bool)

Check if agent supports protocol

Parameters

Name
Type
Description

_agent

address

- agent address

_protocolId

bytes32

- protocol id

Last updated