Open code423n4 opened 3 years ago
This is a fair point. Does have gas implications fetching values from other contracts via proxies etc etc.
Idea is that the treasury shouldn't need to change address.
Risk of misconfiguration extremely low, better than having the extra gas and complexity of cross contract communication.
Also can be added retro-actively to upgradable contracts.
Handle
hickuphh3
Vulnerability details
Impact
Having spoke to the developers, it is intended for the treasury address to be the same across all contracts. As such, instead of having the address as a constructor / initializer argument in multiple contracts, it might be better to set it in 1 contract and have all other contracts pull the address from it.
That way, should the treasury be changed / upgraded, the changes will also be automatically reflected in the other contracts, thereby avoiding potential erroneous updates in multiple contracts.
Recommended Mitigation Steps
If we assume
LongShort
to be the source of truth, then its interface will include atreasury()
function that returns the address of the treasury.YieldManagerAave
(and future yield managers) and / orStaker
can then pull the address from it whenever its value is needed. An example implementation (YieldManagerAave'swithdrawTreasuryFunds()
) is given below.