Skip to content
Business logic Audit finding Intermediate

System could be wrapped and made useless without contract whitelisting

The token's locking mechanism did not restrict which contracts could lock tokens, so anyone could build a wrapper contract that locks hPAL and then sells or tokenises ownership of that contract, making the locked tokens effectively liquid and transferable again. This undermines the intended design where locking is meant to make tokens illiquid in exchange for boosted voting power and rewards.

Picodes Follow

Originally disclosed on Code4rena

Submitted by Picodes

HolyPaladinToken.sol#L253 HolyPaladinToken.sol#L284 HolyPaladinToken.sol#L268

Anyone could create a contract or a contract factory “PAL Locker” with a fonction to deposit PAL tokens through a contract, lock them and delegate the voting power to the contract owner. Then, the ownership of this contract could be sold. By doing so, locked hPAL would be made liquid and transferrable again. This would eventually break the overall system of hPAL, where the idea is that you have to lock them to make them non liquid to get a boosted voting power and reward rate.

Paladin should expect this behavior to happen as we’ve seen it happening with veToken models and model implying locking features (see https://lockers.stakedao.org/ and https://www.convexfinance.com/).

This behavior could eventually be beneficial to the original DAO (ex. https://www.convexfinance.com/ for Curve and Frax), but the original DAO needs to at least be able to blacklist / whitelist such contracts and actors to ensure their interests are aligned with the protocol.

Proof of Concept

To make locked hPAL liquid, Alice could create a contact C. Then, she can deposit hPAL through the contract, lock them and delegate voting power to herself. She can then sell or tokenize the ownership of the contract C.

Recommended Mitigation Steps

Depending on if Paladin wants to be optimistic or pessimistic, implement a whitelisting / blacklisting system for contracts.

See: Curve-Dao-Contracts/VotingEscrow.vy#L185

FraxFinance/veFXS_Solidity.sol.old#L370

Kogaroshi (Paladin) confirmed, resolved, and commented:

Changes were made to use a Whitelist similar to the veCRV & veANGLE (changes in this PR: PaladinFinance/Paladin-Tokenomics#12). The checker will only block for Locking, allowing smart contracts to stake and use the basic version of hPAL without locking.


The original report as published on Code4rena, by Picodes. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the locking function did not check whether the caller was a contract, so wrapper contracts could lock tokens on behalf of users and their ownership could then be traded.

Impact

Locked hPAL could become liquid and transferable through wrapper contracts, breaking the illiquidity assumption behind boosted voting power and reward rates.

What the attacker needed

Ability to deploy a smart contract; some hPAL tokens to lock

The fix

A whitelist was added so that only approved contracts can lock tokens, while other contracts can still stake and use the basic hPAL features.

How it was found

  1. Alice creates a contract that can deposit and lock hPAL on her behalf.
  2. She deposits hPAL through the contract and locks it, delegating voting power to herself.
  3. She then sells or tokenises ownership of the contract, making the locked position transferable.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Some tokens reward you more if you lock them up for a while, so you cannot sell them during that time. The report points out that a person could put their tokens into a small helper program (a smart contract) that does the locking, then sell the helper program itself to someone else. That way the tokens are still locked on paper, but the owner has effectively sold them, defeating the purpose of locking.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Picodes

View all

17 more disclosed reports, best first.

More from Paladin - Warden Pledges contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.