Platform: Code4rena
Start Date: 11/12/2023
Pot Size: $90,500 USDC
Total HM: 29
Participants: 127
Period: 17 days
Judge: TrungOre
Total Solo HM: 4
Id: 310
League: ETH
Rank: 88/127
Findings: 1
Award: $59.60
🌟 Selected for report: 0
🚀 Solo Findings: 0
59.6005 USDC - $59.60
The GuildToken
is supposed to registers the losses of the different gauges through the ProfitManager
. There is one ProfitManager
per market(credit token). The protocol intends to have several markets, however can only have one ProfitManager
at a time.
/// @notice reference to ProfitManager address public profitManager;
This shortcoming will severely restrict the protocol breadth and only allow for one market to be operated, instead of several.
Use a mapping for registering different ProfitManager
that are allowed to report to the GuildToken
such as:
mapping(address => bool) public isProfitManagers;
The function for add/remove a ProfitManger
needs to be implemented as well.
function setManager(address profitManager, bool allowed) external role { isProfitManager[profitManager] = allowed; }
Now functions that rely on ProfitManagers need to be changed accordingly as well.
To do so, associating a gauge
to a profit
in a mapping will make it easy to access the relevant ``profit.
mapping(address => address) public gaugeToProfit;`
function _incrementGaugeWeight( address user, address gauge, uint256 weight ) internal override { address profitManager = gaugeToProfit[gauge]; . . .
Other
#0 - c4-pre-sort
2024-01-03T19:56:55Z
0xSorryNotSorry marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-01-03T19:57:21Z
0xSorryNotSorry marked the issue as duplicate of #1001
#2 - c4-judge
2024-01-29T21:37:49Z
Trumpero marked the issue as satisfactory