Paladin - Warden Pledges contest - 8olidity's results

A governance lending protocol transforming users voting power into a new money lego.

General Information

Platform: Code4rena

Start Date: 27/10/2022

Pot Size: $33,500 USDC

Total HM: 8

Participants: 96

Period: 3 days

Judge: kirk-baird

Total Solo HM: 1

Id: 176

League: ETH

Paladin

Findings Distribution

Researcher Performance

Rank: 60/96

Findings: 1

Award: $19.64

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L653

Vulnerability details

Impact

If the user has no intention to send 100 tokens that charge fees to the contract, at this time the administrator wants to take these tokens out, but the tokens will charge 10% commission, but because the code is written to send the full balance, then the contract does not have enough tokens to pay fees, resulting in the administrator can never take out

Proof of Concept

    function recoverERC20(address token) external onlyOwner returns(bool) {
        if(minAmountRewardToken[token] != 0) revert Errors.CannotRecoverToken();

        uint256 amount = IERC20(token).balanceOf(address(this));
        if(amount == 0) revert Errors.NullValue();
        IERC20(token).safeTransfer(owner(), amount);

        return true;
    }

Tools Used

vscode

Example Add a token whitelist

#0 - Kogaroshi

2022-10-31T19:43:14Z

Issue similar to #27, see their for response.

  • Mitigation proposed is already in place in the system.

#1 - kirk-baird

2022-11-10T20:55:51Z

I'm going to downgrade this to QA. The way transfer(to, amount) works on FoT tokens is that the sender will be deducted amount and the receiver will receive amount - fee. See this contract of an example. So I don't believe there will be an issue recovering FoT tokens from this contract.

Hence, calling transfer() with the entire balance for FoT tokens is ok.

However, it may be desirable to only transfer out a certain portion of tokens sometimes e.g. if a portion of the tokens are locked OR there is a unique implementation of FoT. So I'll leave this as QA.

#2 - c4-judge

2022-11-10T20:56:08Z

kirk-baird changed the severity to QA (Quality Assurance)

#3 - c4-judge

2022-11-11T23:58:55Z

kirk-baird marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter