sherlock-audit / 2023-01-derby-judging

4 stars 1 forks source link

ak1 - Game.sol : set `homeVault`inside the constructor #385

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

ak1

medium

Game.sol : set homeVaultinside the constructor

Summary

Game.sol has the homeVault which is set the onlyDao.

It is not set in the constructor and separate function is used .

This homeVault plays crucial role in redeemNegativeRewards and redeemRewards. there are too many parameters need to be set by the owner/admin/munltisig/dao. By any chance if the homeVault is missed to set, then the rewards would end with dead vault.

Vulnerability Detail

refer the summary section.

Impact

loss of rewards to the protocol

Code Snippet

https://github.com/sherlock-audit/2023-01-derby/blob/main/derby-yield-optimiser/contracts/Game.sol#L308

https://github.com/sherlock-audit/2023-01-derby/blob/main/derby-yield-optimiser/contracts/Game.sol#L552

Tool used

Manual Review

Recommendation

set the homevault paremeters in constructor itself like for other input parameters like dao and so.