Mi az a DeFi, lol

Bitcoin

"Tisztán p2p elektronikus készpénz, ami lehetővé teszi a tranzakciókat két fél között, pénzintézet közbeiktatása nélkül."

Ethereum

"Blockchain beépített Turing-teljes programozási nyelvvel, ami lehetővé teszi decentralizált alkalmazások írását. Egyedi joggokkal, tranzakció típusokkal és állapotváltoztató függvényekkel."

Decentralized Finance

Bitcoin

Ethereum

Történetileg vizsgálva

Decentralized Finance

Valassz kettot

Olcsobb

Gyorsabb

Decentralizaltabb

State of the blockchain 2021

NEM DEFI

Hogy allunk?

Mik futnak?

  • Hitel platformok
    • Stabil kriptovaluta kibocsátók
    • P2P kölcsön
      • P2P tőkeáttét
  • Decentralizált tőzsdék
    • Order book-al
    • Swapok, AMM-el
  • Asset management platformok
    • Hedgefundok
    • Pool service-ek
    • Index fundok
  • Derivatíva platformok (származtatott érték)
  • (Biztosítók)

Mik az elonyei a DeFinek?

  • 100% rendelkezésre állás
  • Nincs közvetítő (csak a szoftver)
  • Demokratizálja a pénzügyeket (Miénk a platform)
  • Nagyobb likviditás
  • Létező legjobb feltételek, szabad piaci alapon
  • Határtalan innováció (közgazdaságtani kísérletek)

10x jobb = diszruptiv

Hitel

Decentralizalt Tozsde

Alapok

Uj fogalom:

Flash Loan

Kollateralizálatlan hitel, amit ugyanabban a blokkban vesznek fel és fizetnek vissza.

bZx Exploit - Feb. 15th

  • Attack style: Bug exploitation
  • Amount lost: ~$356,000
  • Funds recovered: N/A

In this attack, the culprit used a flash loan via dYdX to launch a permissionless “pump and dump” scheme involving WBTC and the bZx, Compound, KyberSwap, and Uniswap projects. The ensuing manipulation allowed the attacker to make off with more than 1,200 ETH.

Flashloan borrow

WBTC Borrow with ETH collateral

short ETH in favor of WBTC

5x Margin Pumped

WBTC/ETH for 3x

bZx Smart Contract Bug

The magic under the hood is the fact how the Uniswap WBTC/ETH was manipulated up to 61.4 for profit. As mentioned in Step 3, the WBTC/ETH price was even pumped up to 109.8 when the normal market price was at only around 38. In other words, there is an intentional huge price slippage triggered for exploitation. However, such a huge price slippage should cause the bZx position not fully collateralized. But why the under-collateralized position will be allowed in the first place, which naturally leads to the discovery of a hidden bug in the bZx smart contract implementation.

but, but..

Here comes the interesting part. In line 145–153, there’s a require() call to check whether the position is healthy or unhealthy. Unfortunately, in the case "loadDataBytes.length == 0 && sentAmounts[6] == sentAmounts[1]", the sanity check bZxOracle::shoudLiquidate() would be skipped. That’s exactly the condition that the exploit triggered to avoid the sanity check.

Uj fogalom:

oracle

AMM-based oracle

oracle network

custom oracle

 

"Oracles are third-party services that allow smart contracts within blockchains to receive external data from outside of their ecosystem."

bZx Oracle Blitz - Feb. 18th

  • Attack style: Oracle manipulation
  • Amount lost: ~$666,000
  • Funds recovered: N/A

Days after the prior bZx exploit, an attacker launched another flash loan assault on the protocol. This new ploy involved oracle manipulation around Synthetix’s sUSD token, which the culprit pumped and then used to borrow a small trove of ETH from bZx.

Flash loan borrow

Buy

pump sUSD/ETH!!

Borrow

(bZx relies on Kyber for the price feed)

Flash loan repay

attacker is able to repay the 7,500 ETH flashloan back to bZx with the profit of 2,378 ETH

Uj fogalom:

ERC-20, ERC-777 etc

Token szabványok

Uniswap & Lendf.me Reentrancy Attacks - Apr. 18th-19th

  • Attack style: Reentrancy via imBTC
  • Amount lost: +$25 million
  • Funds recovered: ~$25 million

In April 2020, imBTC issuer Tokenlon was at the center of not one but two separate reentrancy attacks, with a smaller initial salvor targeting Uniswap V1 and a second one netting a whopping $25 million from dForce’s Lendf.me protocol. The DeFi assaults revolved around ERC-777 hooks, which can allow tokens to be commandeered by malicious contracts if deposited into protocols that don’t mitigate these hooks by design. Notably, the Lendf.me attacker ended up returning the tokens stolen from that protocol after their IP address and other identifying information was apparently uncovered.

The logic behind is that the attacker did supply certain amount of imBTC into Lendf.Me in the first place (e.g., 289.99999999 imBTC). However, in the second supply(), the attacker simply supplied 0.00000001 imBTC but additionally withdraw()'ed 290 imBTC inside the hook (by hijacking the IMBTC::transferFrom() call inside doTransferIn() - line 1583). As a result, 290 imBTC was subtracted from the attacker’s balance within the embedded withdraw(). However, when the execution went back to supply(), the balance was reset to 290 imBTC (line 1599). That’s how the attacker manipulates the internal record of the attacker’s imBTC collateral amount in Lendf.Me. With the sufficiently large of collateral amount, the attack can therefore borrow all available 10+ assets from various liquidity pools (with total asset value of $25,236,849.44).

allows the attacker to hijack the transaction by essentially injecting additional malicious code for execution:

Uj fogalom:

deflationary tokens

Token amiből a rendelkezésre álló mennyiség folyamatosan csökken, elég. Pl minden tranzakció 1%-a.

Balancer’s Deflationary Assault - June 28th

  • Attack style: Deflationary tokens
  • Amount lost: ~$522,000
  • Funds recovered: N/A

In this incident, an extremely knowledgeable DeFi hacker launched a sophisticated flash loan blitz against Balancer. The culprit first funded their address with a transaction through Ethereum privacy solution Tornado.cash. The scheme itself targeted the STA and STONK deflationary tokens and their transaction fee mechanisms, which allowed the hacker to make off with +$500,000 worth of ETH, LINK, SNX, and WBTC.

  • Flashloan Borrow: The bad actor borrowed a flash loan (104,331 WETH) from dYdX.
  • STA Depletion: With the borrowed WETH, the bad actor performed a flurry of swaps to deplete almost all STA tokens owned by a Balancer pool. Note that STA is a deflationary token that will charge 1% on every token transfer. The result of STA depletion is that there is only 1e-18 STA left in the pool.
  • Exploitation for Profit The bad actor exploited the flawed handling of STA in Balancer and stoled the pool assets approximately valued $523,616.52.
  • Flashloan Repay Finally, the bad actor repaid the dYdX flash loan and walked away with the stolen assets.

 

bZx’s iToken Duplication Incident - Sept. 15th

  • Attack style: Bug exploit
  • Amount lost: ~$8 million
  • Funds recovered: ~$8 million

In this attack, a hacker used an exploit within the code of bZx’s iToken system to “increase his balance artificially.” The episode highlighted how smart contract audits don’t offer guaranteed peace of mind in DeFi, seeing as how bZx was audited by both PeckShield and Certik prior to this incident. Luckily, bZx was able to recover all of the lost funds from the attacker.

The Eminence Oracle Attack - Sept. 29th

  • Attack style: Oracle manipulation
  • Amount lost: ~$15 million
  • Funds recovered: ~$8 million

Eminence Finance, an NFT-based game by Yearn creator Andre Cronje, captured tons of on-chain attention before its creator ever announced anything about the project. This led to DeFi degens aping into the project and throwing caution to the wind, which created a sizable token trove that a hacker rapidly stole from via a flash loan-driven oracle manipulation attack. The culprit ended up returning $8 million of the $15 million in stolen funds, which was distributed through a community refund mechanism.

Harvest Finance Oracle Attack - Oct. 26th

  • Attack style: Oracle manipulation
  • Amount lost: ~$24 million
  • Funds recovered: ~$2.5 million

In late October, yield aggregator protocol Harvest Finance fell prey to an oracle manipulation attack that earned its creator over $24 million in stolen tokens. Specifically, the protocol’s USDC and USDT vault were targeted in the DeFi assault, which centered around impermanent loss in Curve.fi’s Y pool.

The Cheese Bank Heist - Nov. 6th

 

  • Attack style: Oracle manipulation
  • Amount lost: ~$3.3 million
  • Funds recovered: N/A

Decentralized autonomous bank project Cheese Bank was drained of more than $3 million worth of Dai, USDC, and USDT after a hacker exploited a flaw in the way the asset tracks token prices via an intricate flash loan blitz.

Cheese Bank is a decentralized autonomous digital bank on Ethereum that allows investors to manage asset, including lending, fund management, insurance services etc.

"Since AMM-based oracles (e.g., Uniswap, Curve) are often the target behind many recent hacks, we suggest to exercise extra care when referencing them as oracle prices as they can be easily manipulated."

The Attack on Akropolis - Nov. 12th

  • Attack style: Bug exploit + reentrancy
  • Amount lost: ~$2 million
  • Funds recovered: N/A

An attacker used an reentrancy attack in combination with a vulnerability in the Akropolis project’s savings pool to steal $2 million worth of the Dai stablecoin. This pool had notably been audited by Certik, Pessimistic, and SmartDec prior to the assault, yet another reminder that audits are not the end-all be-all for DeFi security.

Uj fogalom:

pool/vault/jar

Smart contract, ami akár jelentős számú wallet tokenjeit kezeli/használja fel jellemzően más protokollokon történő profitszerzés céljával.

De pool-nak hívjuk a decentralizált tözsdék likviditását kezelő contractokat is.

The Value DeFi Oracle Blitz - Nov. 14th

  • Attack style: Oracle manipulation
  • Amount lost: ~$7.5 million
  • Funds recovered: ~2 million

In November, upstart yield aggregator protocol Value DeFi saw its centralized oracle exploited and its MultiStables Vault drained. The episode came on the heels of Value DeFi infamously posting that one of its advantages was superior security. In the wake of the attack, the project’s team announced plans to integrate with decentralized oracle network Chainlink.

Uj fogalom:

rebase token

Olyan token, amiből minden walletben található mennyiség valamilyen egyedi mechanizmus szerint változik.

Origin Dollar Reentrancy Assault - Nov. 17th

  • Attack style: Bug exploit + reentrancy
  • Amount lost: ~$7.7 million
  • Funds recovered: N/A

November also saw stablecoin project Origin Dollar fall victim to a flash loan attack. The assault involved the attacker using a malicious contract to mint more OUSD than they should’ve been allowed to. After the incident, the Origin Dollar team offered a bounty of $1 million for information leading to the identity of the culprit.

Pickle Finance’s Big Pickle - Nov. 22nd

 

  • Attack style: Bug exploit
  • Amount lost: ~$19.7 million
  • Funds recovered: N/A

Yield aggregator protocol Pickle Finance saw its pDAI PickleJar drained to the tune of nearly 20 million Dai in November. The complex attack revolved around the offender installing an “Evil Jar” into pDAI’s system, which was used to compromise the funds within.

Title Text

Exploit input validation bug

+

Exploit arbitrary code execution

 

Link

The Warp Finance Oracle Attack - Nov. 22nd

  • Attack style: Oracle manipulation
  • Amount lost: ~$7.7 million
  • Funds recovered: ~$5.85 million

Warp Finance, a DeFi lending platform for liquidity provider (LP) tokens, was attacked earlier this month in an oracle manipulation blitz that netted the offender +$7 million. Due to a quirk in the project’s design, its team was able to recover $5.85 million worth of Uniswap ETH/DAI LP tokens that the attacker had used as collateral.

Cover Incident: The Unlimited Token-Minting Vulnerability - Dec. 28nd

  • Attack style: Bug exploit
  • Amount lost: ~$7 million
  • Funds recovered: ~$4 million

Cover’s Blacksmith contract was exploited to mess up the total amount of COVER tokens in circulation with currently 40+ quintillion COVERs (1 quintillion = 10^18). The incident was due to a business logic bug in the way of calculating the COVER rewards for staking users.

Konkluzio

  • a DeFi Farmokon nem véletlenül magas a hozam
  • Egyre több figyelmet kap a hackerektől is
  • Sokszínű attack vectorok
  • Nem történt katasztrófa, elhanyagolható az elveszett assetek összértéke a teljes likviditáshoz képest
  • A támadások szofisztikáltsága fokozódik
  • 2021?!

Arbace, hacker since the 80s

Brunya, COO

valid, knows what UX is

PumpkinSeed, chief blockchain atyauristen

strock77, how to Etherium

Peter, DeFi rockstar, ex-JP Morgan

JOIN

es meg sokan masok...

arch boi

dapp wiz

dapp mage

Mi az a DeFi, lol

By Robert Aaron Zawiasa

Mi az a DeFi, lol

  • 37
Loading comments...

More from Robert Aaron Zawiasa