Message: ExecuteMsg::AddAgent
This allows an existing agent to add a new agent to the whitelist.
Inputs
info.senderValidation: The
add_agentfunction verifies that theinfo.senderis a valid agent.Impact: Ensures that only authorized agents can modify the whitelist.
new_agentValidation: The address is validated to ensure proper formatting, and it must not already exist in the whitelist. Additionally, the new agent cannot be the contract owner.
Impact: This is the address of the new agent to be added.
Branches and code coverage (including function calls)
Intended branches
If
new_agentis valid and not already an agent, it is added to the whitelist.
Negative behavior
Fail if the
info.senderis not an existing agent.Fail if
new_agentis the contract owner.Fail if
new_agentis already in the whitelist.