Skip to content
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

Closed
sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Closed

bin2chen - TimeLock cannot execute transaction with value #164

sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Labels
Non-Reward This issue will not receive a payout

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

bin2chen

medium

TimeLock cannot execute transaction with value

Summary

TimeLock lacks the payable method and cannot execute transactions with value

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:

    function queue(
        address _target,
        uint256 _value,
        string calldata _func,
        bytes calldata _data,
        uint256 _timestamp
    ) external onlyOwner {
...

    function execute(
        address _target,
        uint256 _value,
        string calldata _func,
        bytes calldata _data,
        uint256 _timestamp
    ) external onlyOwner returns (bytes memory) {
....

We can see that these two methods are not with payable

and this contract is also no receive() payable or fallback() payable or other methods with payable

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 or execute() to add a payable modifier

Impact

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 or execute() to add a payable modifier

Duplicate of #387

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 2023
@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Reward A payout will be made for this issue labels Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Non-Reward This issue will not receive a payout
Projects
None yet
Development

No branches or pull requests

1 participant