Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid error in depositDSS() function #28

Open
hats-bug-reporter bot opened this issue Jan 28, 2025 · 1 comment · May be fixed by #124
Open

Invalid error in depositDSS() function #28

hats-bug-reporter bot opened this issue Jan 28, 2025 · 1 comment · May be fixed by #124

Comments

@hats-bug-reporter
Copy link

Github username: --
Twitter username: --
HATS Profile: ---

Beneficiary: 0x3828b7Dff72E340B44f3A0270574dDE9276D5FD3
Submission hash (on-chain): 0x575510d011adfe70300246f105d2f0381e99460cc6528ee5f51d79ffa6d3da91
Severity: low

Description:
Invalid error in depositDSS() function

if we check this function in exchange.sol contract:

    function depositDSS(
        uint256 amount,
        address _tokenAddress
    ) external onlyOwner {
       require(IERC20(_tokenAddress).transferFrom(msg.sender, address(this), amount), "Token withdrawal failed");
    }

We can see it reverts with error of "Token withdrawal failed" while it should be:
"Token deposit failed"

Impact

Incorrect error can lead to confusion.

Recommendation

replace it with:
"Token deposit failed"

@DaosisLLC
Copy link
Collaborator

@vishal-develop-web Can you please have a look at fixes ?

@DaosisLLC DaosisLLC added the low label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants