This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
nobody2018 - ChangeTreasury does not correctly set the new treasury address and does not remove the old treasury address from whitelist #54
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Escalation Resolved
This issue's escalations have been approved/rejected
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
nobody2018
medium
ChangeTreasury does not correctly set the new treasury address and does not remove the old treasury address from whitelist
Summary
Currently, the treasury of VaultV2 is used to receive deposit fees. When calling
changeTreasury
to change the treasury address, the function does not correctly set the new treasury address and does not remove the old treasury address from whitelist.Vulnerability Detail
The
changeTreasury
incorrectly passed the treasury address of VaultFactoryV2 to theVaultV2.setTreasury
function. Let's take a look at the [code](https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/VaultFactoryV2.sol#L228-L246):To maintain consistency, when changing treasury, the old treasury should be removed from whitelist to prevent accidental transfer of funds to the old treasury. If the old treasury is abandoned, the funds will be lost.
Impact
Setting Treasury errors may cause funds loss.
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/VaultFactoryV2.sol#L228-L246
Tool used
Manual Review
Recommendation
Duplicate of #208
The text was updated successfully, but these errors were encountered: