Skip to content

Instantly share code, notes, and snippets.

@naddison36
Last active February 25, 2021 01:05
Show Gist options
  • Save naddison36/8eaec14ab553a9340662b6f12674a512 to your computer and use it in GitHub Desktop.
Save naddison36/8eaec14ab553a9340662b6f12674a512 to your computer and use it in GitHub Desktop.
Punk #1737

Punk 1737 Hack

https://www.larvalabs.com/cryptopunks/details/1737

Punk #1737 received a legitimate 26.25 bid and accepted, but before his tx hit the chain, a contract flashloaned 26.25 eth + 1 wei and bid himself. The owner got 1 wei in return for his sale, and the contract now owns the punk. https://twitter.com/aradtski/status/1364714105525964811

The attacker entered 2 bids for #1,737:

  • enterBidForPunk(1737, 26.25 ETH)
  • withdrawBidForPunk(1737)
  • enterBidForPunk(1737, 0 ETH)

https://etherscan.io/tx/0x8cc3c4774cf08f17c87a1815871ea935fc030d511d002e4fbc521b3c69d82ad8

Then acceptBidForPunk https://etherscan.io/tx/0x65ab81ab49c09a695bdd768e44e635e14212064871a96902dc94fdc2746d78f6

Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="393px" preserveAspectRatio="none" style="width:730px;height:393px;" version="1.1" viewBox="0 0 730 393" width="730px" zoomAndPan="magnify"><defs><filter height="300%" id="f1wcjfyhvrwggj" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="705" x="9" y="29.4023">0x65ab81ab49c09a695bdd768e44e635e14212064871a96902dc94fdc2746d78f6</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="225" x="249" y="385.1484">Wed, 24 Feb 2021 22:20:44 GMT</text><rect fill="#FFFFFF" filter="url(#f1wcjfyhvrwggj)" height="14" style="stroke:#A80036;stroke-width:1.0;" width="10" x="430" y="271.1484"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="284" x2="284" y1="108.6641" y2="303.1484"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="435" x2="435" y1="108.6641" y2="303.1484"/><rect fill="#FEFECE" filter="url(#f1wcjfyhvrwggj)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="111" x="227" y="73.1758"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="97" x="234" y="93.7109">0x9059..22be</text><rect fill="#FEFECE" filter="url(#f1wcjfyhvrwggj)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="111" x="227" y="302.1484"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="97" x="234" y="322.6836">0x9059..22be</text><rect fill="#FEFECE" filter="url(#f1wcjfyhvrwggj)" height="63.4648" style="stroke:#A80036;stroke-width:1.5;" width="162" x="352" y="40.1992"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="139" x="363.5" y="60.7344">«CRYPTOPUNKS (Ͼ)»</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="148" x="359" y="77.2227">«CryptoPunksMarket»</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="97" x="384.5" y="93.7109">0xb47e..3bbb</text><rect fill="#FEFECE" filter="url(#f1wcjfyhvrwggj)" height="63.4648" style="stroke:#A80036;stroke-width:1.5;" width="162" x="352" y="302.1484"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="139" x="363.5" y="322.6836">«CRYPTOPUNKS (Ͼ)»</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="148" x="359" y="339.1719">«CryptoPunksMarket»</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="97" x="384.5" y="355.6602">0xb47e..3bbb</text><rect fill="#FFFFFF" filter="url(#f1wcjfyhvrwggj)" height="14" style="stroke:#A80036;stroke-width:1.0;" width="10" x="430" y="271.1484"/><path d="M205,123.6641 L205,209.6641 L361,209.6641 L361,133.6641 L351,123.6641 L205,123.6641 " fill="#FBFB77" filter="url(#f1wcjfyhvrwggj)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M351,123.6641 L351,133.6641 L361,133.6641 L351,123.6641 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="84" x="211" y="141.2324">Nonce: 1,653</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="135" x="211" y="156.543">Gas Price: 204.0 Gwei</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="119" x="211" y="171.8535">Gas Limit: 200,000</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="110" x="211" y="187.1641">Gas Used: 63,498</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="114" x="211" y="202.4746">Tx Fee: 0.013 ETH</text><polygon fill="#A80036" points="418,267.1484,428,271.1484,418,275.1484,422,271.1484" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="284.5" x2="424" y1="271.1484" y2="271.1484"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="115" x="291.5" y="235.7852">acceptBidForPunk(</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="115" x="291.5" y="251.0957">punkIndex: 1,737,</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="74" x="291.5" y="266.4063">minPrice: 0)</text><polygon fill="#A80036" points="295.5,281.1484,285.5,285.1484,295.5,289.1484,291.5,285.1484" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="289.5" x2="434" y1="285.1484" y2="285.1484"/><!--MD5=[01e39400e0b6b17d9f51b6b25939802f]
@startuml
title 0x65ab81ab49c09a695bdd768e44e635e14212064871a96902dc94fdc2746d78f6
caption Wed, 24 Feb 2021 22:20:44 GMT
participant "0x9059..22be" as 905922be
participant "0xb47e..3bbb" as b47e3bbb <<CRYPTOPUNKS (Ͼ)>><<CryptoPunksMarket>>
note over 905922be
Nonce: 1,653
Gas Price: 204.0 Gwei
Gas Limit: 200,000
Gas Used: 63,498
Tx Fee: 0.013 ETH
end note
905922be -> b47e3bbb: acceptBidForPunk(\npunkIndex: 1,737,\nminPrice: 0)
activate b47e3bbb
return
@endumls
PlantUML version 1.2020.26(Tue Dec 22 04:45:07 AEDT 2020)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: AU
--></g></svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment