Hint:
On the surface, the rounding error is at most 1 wei of gain in favour of the attacker but they have to spend much more in gas.
A protocol that has been live for years already knows about it. Unless you can weaponise it and show real impact, you're going to get ignored!
Here’s a fresh CTF you can use to improve your AI workflow: github.com/kankodu/lending-p…
I’m sure AI can find the bug trivially. But in practice when a contract like this have been live for years, a bug like this gets dismissed as a known issue unless you can show how to weaponise it.
It’s live until Nov 25. DM me your solutions for considerations on the leaderboard.
8
584
Here’s a fresh CTF you can use to improve your AI workflow: github.com/kankodu/lending-p…
I’m sure AI can find the bug trivially. But in practice when a contract like this have been live for years, a bug like this gets dismissed as a known issue unless you can show how to weaponise it.
It’s live until Nov 25. DM me your solutions for considerations on the leaderboard.
Uniswap V4 Position Manager is being used as an example of highly used contract that will be broken after Glamsterdam.
Yes, the contract itself is highly used but I couldn't find any immutable contract using the subscribe pattern in the wild for rewards distribution that will be broken. Protocols (including Uniswap Foundation) just use Merkl to provide rewards and they do calculations off-chain.
🔥Found an awesome tool for both security researchers & devs
Call graph visualisation for Solidity repositories, split by entry points. You can easily navigate the flow of execution in a way that serves you logically. 10x for building this @0xnorah23🫡
github.com/norah1499/solidit…
I have shown multiple teams that simple restrictions on transfers do not prevent trading outside their hooks.
The solutions I’ve suggested looked a lot like URC-5 but they were specific to projects. It’s great that there is now a standard around it.
Today's hack of EtherFi helper contract is a good example of how multiple holes in a system can line up to create a vulnerability.
1st hole: the contract with the bad callback pattern. The AtomicQueue contract calls a callback function on a user provided address and assumes that if the call succeeds, the interaction was intentional. The best practise is to require specific return data from the callback.
2nd hole: a stale approval. More than a year ago the victim interacted with this contract from their EOA and left a hanging approval.
Note that these two holes still aren't enough to steal funds because a callback on a plain EOA simply fails.
3rd and final blow: EIP-7702 delegation. 3 months ago they clicked a button in their Coinbase Wallet to start using EIP-7702 capabilities and that's where they became vulnerable. The smart wallet they delegated to silently did nothing when a random function was called on it.
Together, these three things led to the victim losing ~12 ETH today.
Tx Hash: 0x7cbe0b4349513fed6d03ba8bf9ed708e10e07a501d10b5f344a25ae10595599b
I have been using this tool to visualise codebases ever since it came out. In a text editor, you sometimes loose track after going deeper in a complex function.
Solflow helps in making sure you go through the code similar to how EVM will eventually execute it. Thanks @0xnorah23 !!
kankodu retweeted
We are now live on @monad !
Through our integration with @merkl_xyz , LPs that use their Uniswap V4 Liquidity Positions as collateral on VII Finance will continue to earn $MON rewards for eligible pools.
kankodu retweeted
Your newest AI security engineer has just arrived.
Cygent isn't just an AI bug scanner; it learns your codebase, works alongside your team, and writes the PRs to fix them.
- Finds bugs
- Gets on calls
- Schedules tasks
- Proactive security advice
All in your chat interface 🧵
A big thank you to all the SRs for helping secure the protocol 🙏
Only a couple of days left. Make it count!
Here's where you can do some weekend bug hunting:
cantina.xyz/competitions/eb9…
Here's where you can do some weekend bug hunting:
cantina.xyz/competitions/eb9…
A detailed breakdown of how LPs can earn lending interest on top of swap fees using VII.Finance
VII Finance just went live with a uniswap v4 hook on unichain that allows users to earn lending interest on top of swap fees.
Here’s a detailed breakdown of how it works:
Imagine you’re providing liquidity to a USDC-USDT pool on Uniswap v4 using a concentrated range. Traders swap between USDC and USDT, paying you fees for facilitating those trades. However, when no swaps occur, your capital sits idle. Given that concentrated liquidity automated market makers (CLAMMs) like Uniswap v4 are highly capital-efficient, their TVL is often a fraction of that in lending protocols, where utilization rates hover around 50%. This sparks an idea: why not lend out your USDC and USDT to a lending protocol (let’s call it “Protocol X”) to earn interest when it’s not being used for swaps?
Here’s how it could work: You deposit USDC and USDT into Protocol X, receiving xUSDC and xUSDT tokens in return, which represent your principal plus accrued interest. You then provide liquidity to an xUSDC-xUSDT pool on Uniswap v4. Traders can still swap USDC for USDT by depositing USDC into Protocol X to get xUSDC, swapping xUSDC for xUSDT in the pool, and redeeming xUSDT for USDT. From the trader’s perspective, the swap is functionally identical to a standard USDC-USDT pool. As an LP, you earn both lending interest and swap fees. A win-win.
But here's the Problem:
As interest accrues, the value of xUSDC and xUSDT increases relative to their underlying assets. For example, after some time, 1 xUSDC might be worth 1.01 USDC, and 1 xUSDT might be worth 1.02 USDT, depending on Protocol X’s utilization rates and interest models. Since USDC and USDT interest rates differ, the relative price of xUSDC and xUSDT shifts even if the USDC-USDT spot price remains stable near 1. Without constant rebalancing of the liquidity range, the pool quotes incorrect prices, and MEV bots exploit this discrepancy, siphoning off the lending interest that should go to LPs.
VII Finance’s solution:
To solve this, VII Finance introduces a novel Uniswap v4 hook that works with custom wrapped tokens: VII-xUSDC and VII-xUSDT. These tokens are designed to represent only the principal of the underlying xUSDC and xUSDT, maintaining a 1:1 peg with USDC and USDT, respectively. This peg is guaranteed by smart contracts, ensuring 100% backing by the underlying assets. By creating a Uniswap v4 pool with VII-xUSDC and VII-xUSDT, LPs can use their existing concentrated liquidity strategies without worrying about interest-driven price skews.
So, how do LPs capture the lending interest? When interest accrues (e.g., xUSDC increases to 1.01 USDC and xUSDT to 1.02 USDT), our system mints additional VII-xUSDC and VII-xUSDT tokens proportional to the interest accrued. (0.01 * current supply) for VII-xUSDC and (0.02 * current supply for VII-xUSDT). These newly minted tokens are then distributed to active LPs as fees via our custom Uniswap v4 yield-harvesting hook. Before every add/remove liquidity or swap operations, this hook activates and distributes the lending interest allowing the LPs to earn both lending interest and swap fees.
The same Trader and LP UX:
For traders, the UX remains unchanged. A helper hook automates the process: when a trader wants to swap USDC for USDT, it deposits USDC into Protocol X to mint xUSDC, wraps it into VII-xUSDC, swaps VII-xUSDC for VII-xUSDT in our pool, unwraps VII-xUSDT to xUSDT, and redeems xUSDT for USDT.
For LPs, the UX is the same as well. Our helper contracts can abstract away the complexity of converting the USDC and USDT into VII-xUSDC and VII-xUSDT when adding liquidity and converting it back when removing it.
Our solution is live on Unichain! Try it out at VII.finance














