Platform: Code4rena
Start Date: 21/07/2023
Pot Size: $90,500 USDC
Total HM: 8
Participants: 60
Period: 7 days
Judge: 0xean
Total Solo HM: 2
Id: 264
League: ETH
Rank: 23/60
Findings: 1
Award: $471.90
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Juntao
Also found by: Jiamin, Juntao, UniversalCrypto, auditsea, circlelooper, crunch, lanrebayode77, vangrim, zaevlad
471.8972 USDC - $471.90
https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L117 https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L198 https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L303
GSC is not able to get approve back if it was issued to the wrong user. And it can cause time problems for the GSC itself.
Contract admin can set an allowance for GSC one time per 7 days:
uint48 public constant SET_ALLOWANCE_COOL_DOWN = 7 days; function setGSCAllowance(address token, uint256 newAllowance) external onlyRole(ADMIN_ROLE) { ... if (uint48(block.timestamp) < lastAllowanceSet[token] + SET_ALLOWANCE_COOL_DOWN) { revert T_CoolDownPeriod(block.timestamp, lastAllowanceSet[token] + SET_ALLOWANCE_COOL_DOWN); } ... lastAllowanceSet[token] = uint48(block.timestamp); gscAllowance[token] = newAllowance; }
And it cannot be more than thresholds.small
. So, for example, it grats an allowance to spend 1000 tokens.
GSC can spend it by itself via gscSpend()
or allow other user to transfer tokens via gscApprove()
. Both of these functions reduce the allovance for GSC.
If by any chance GSC gives an approve to an invalid or wrong user, there is no way to get the approve back or zero it. Moreover that "bad user" will have approve for the later period.
And GSC will not able to save tokens and transfer the full amount of it because of their allowance was already reduced.
Also they will have to wait for 7 days when admin will be able to reset the allowance for GSC.
Manual review
Provide an additional function to disapprove or zero "bad users" for GSC.
Governance
#0 - c4-pre-sort
2023-07-29T16:38:35Z
141345 marked the issue as duplicate of #263
#1 - c4-pre-sort
2023-08-01T07:57:19Z
141345 marked the issue as not a duplicate
#2 - c4-pre-sort
2023-08-01T07:57:30Z
141345 marked the issue as duplicate of #58
#3 - c4-judge
2023-08-11T01:40:42Z
0xean marked the issue as satisfactory