You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
sherlock-admin opened this issue
Aug 29, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
But when the vaults are being removed via LMPVaultRegistry.removeVault(), LMPVaultRegistry.removeVault() fails to remove the vault from _vaultsByType mapping.
it removes the vault from _vaults mapping here and _vaultsByAsset mapping here
But it fails to remove the vault from _vaultsByType mapping.
Therefore a removed vault will still exist in _vaultsByType mapping
Impact
A removed vault will still exist in _vaultsByType mapping
And if there be any need to re-add the vault via LMPVaultRegistry.addVault() there will be a revert because of this line
function listVaultsForType() will still list the removed vault as one of the available vaults for a particular type, see here
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
AuditorPraise
medium
LMPVaultRegistry.removeVault doesn’t remove vault from _vaultsByType mapping
Summary
LMPVaultRegistry.removeVault doesn’t remove vault from _vaultsByType mapping
Vulnerability Detail
when vaults are added via LMPVaultRegistry.addVault(), the vaults are added to 3 mappings
_vaults
mapping, see here_vaultsByAsset
mapping, see here_vaultsByType
mapping, see hereBut when the vaults are being removed via LMPVaultRegistry.removeVault(), LMPVaultRegistry.removeVault() fails to remove the vault from
_vaultsByType
mapping._vaults
mapping here and_vaultsByAsset
mapping hereBut it fails to remove the vault from
_vaultsByType
mapping.Therefore a removed vault will still exist in
_vaultsByType
mappingImpact
_vaultsByType
mappingCode Snippet
https://github.com/sherlock-audit/2023-06-tokemak/blob/main/v2-core-audit-2023-07-14/src/vault/LMPVaultRegistry.sol#L64
Tool used
LOFI Radio and Manual Review
Recommendation
remove the vault from
_vaultsByType
mapping too in the LMPVaultRegistry.removeVault() functionDuplicate of #674
The text was updated successfully, but these errors were encountered: