Submitted by rbserver, also found by 0x1f8b, 0xSmartContract, Trust, hansfriese, ctf_sec, cccz, and codexploder
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L636-L638
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L488-L515
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L456-L480
The owner of the WardenPledge contract is able to call the pause function to pause this contract. When the WardenPledge contract is paused, calling the closePledge or retrievePledgeRewards function that uses the whenNotPaused modifier reverts, and the pledge creator is not able to get back any of the reward token amount, which was deposited by the creator previously. Because calling the pause function takes effect immediately, it can be unexpected to the creator for suddenly not being able to call the closePledge or retrievePledgeRewards function. For instance, when an emergency occurs that requires an increase of cash flow, the creator wants to close the pledge early so she or he can use the remaining deposited reward token amount. However, just before the creators closePledge transaction is executed, the pause transaction has been sent by the owner of the WardenPledge contract for some reason and executed. Without knowing in advance that the WardenPledge contract would be paused, the creator anticipates receiving the remaining deposited reward token amount but this is not the case since calling the closePledge function reverts. Because the creator unexpectedly fails to receive such amount and might fail to deal with the emergency, disputes with the protocol can occur, and the user experience becomes degraded.
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L636-L638
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L488-L515
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L456-L480
Please append the following test in the pause & unpause describe block in test\wardenPledge.test.ts. This test will pass to demonstrate the described scenario.
VSCode
The pause function can be updated to be time-delayed so the pledge creator can have more time to react. One way would be making this function only callable by a timelock governance contract.
Kogaroshi (Paladin) confirmed
For this contest, 67 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by robee received the top score from the judge.
The following wardens also submitted reports: ajtra,
rbserver,
adriro,
peritoflores,
Josiah,
tnevler,
horsefacts,
brgltd,
djxploit,
minhtrng,
Dravee,
B2,
Trust,
lukris02,
delfin454000,
c3phas,
RaoulSchaffranek,
Waze,
Tricko,
JTJabba,
a12jmx,
Sm4rty,
0xSmartContract,
imare,
0xNazgul,
Jeiwan,
0x52,
Diana,
shark,
__141345__,
carlitox477,
ktg,
Awesome,
Picodes,
corerouter,
0x007,
RedOneN,
cryptonue,
jayphbee,
0xDjango,
Ruhum,
pashov,
cylzxje,
Chom,
ReyAdmirado,
Rolezn,
Lambda,
ctf_sec,
ladboy233,
8olidity,
ch0bu,
jwood,
cccz,
oyc_109,
yixxas,
dic0de,
chaduke,
csanuragjain,
chrisdior4,
neko_nyaa,
Bnke0x0,
0x1f8b,
rvierdiiev,
leosathya,
RaymondFam, and
Mathieu.
