Assessment reports>TruFin Injective Staker>Threat Model>Message: ExecuteMsg::AddAgent

Message: ExecuteMsg::AddAgent

This allows an existing agent to add a new agent to the whitelist.

Inputs

  • info.sender

    • Validation: The add_agent function verifies that the info.sender is a valid agent.

    • Impact: Ensures that only authorized agents can modify the whitelist.

  • new_agent

    • Validation: 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_agent is valid and not already an agent, it is added to the whitelist.

Negative behavior

  • Fail if the info.sender is not an existing agent.

  • Fail if new_agent is the contract owner.

  • Fail if new_agent is already in the whitelist.

Zellic © 2025Back to top ↑