This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
bin2chen - TimeLock cannot execute transaction with value #164
Labels
Non-Reward
This issue will not receive a payout
bin2chen
medium
TimeLock cannot execute transaction with value
Summary
TimeLock lacks the
payable
method and cannot execute transactions withvalue
Vulnerability Detail
In the TimeLock contract, we can specify the value on the transaction, mainly implemented in queue() and execute(), these two methods are defined as follows:
We can see that these two methods are not with
payable
and this contract is also no
receive() payable
orfallback() payable
or other methods withpayable
so this contract is unable to accept value (eth)
as a result, if a queue transaction specifies a
value
, it cannot be executed.Suggestion: Add a
receive() external payable
to the contract orexecute()
to add apayable
modifierImpact
cannot execute transactions with
value
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/TimeLock.sol#L74-L80
Tool used
Manual Review
Recommendation
Add a
receive() external payable
to the contract orexecute()
to add apayable
modifierDuplicate of #387
The text was updated successfully, but these errors were encountered: