hats-finance / Kintsu-0x7d70f9442af3a9a0a734fa6a1b4857f25518e9d2

Smart contracts for Kintsu
Other
0 stars 0 forks source link

Insufficient Check in `remove_agent` Function #12

Open hats-bug-reporter[bot] opened 6 months ago

hats-bug-reporter[bot] commented 6 months ago

Github username: @0xmahdirostami Twitter username: 0xmahdirostami Submission hash (on-chain): 0x824726bc37065e0a15464fdd8b6a848f1dbcb62f6e7c09d0a9ee7b9e0160174a Severity: low

Description: Description: The remove_agent function currently only checks the weight of the agent but does not verify whether the agent has bonded AZERO tokens or not. This lack of verification poses a risk, as an agent with bonded AZERO tokens could potentially be removed from the list of agents.

Scenario: An agent with bonded AZERO tokens could unintentionally be removed from the list of agents if the remove_agent function is called without checking whether the agent has bonded tokens.

Impact: The unintended removal of an agent with bonded AZERO tokens can have negative consequences, affecting unstaking and compounding operations.

Recommended Mitigation: Enhance the remove_agent function to include a check for bonded AZERO tokens associated with the agent. This ensures that only agents without bonded tokens are removed from the list.

bgibers commented 5 months ago

It is a design decision but is valid