Skip to main content

A 1904x960 PNG rendering of the function in the CryptoPhunksMarket contract that allows users to withdraw ETH from sales.

It contains a helpful comment about avoiding re-entrancy attacks. If you're anything like me, when you read this code for the first time you thought "what's a re-entrancy attack"?

And then if you read it's a bit terrifying—when you send ETH with transfer() you need to have your contract's state indicate "this user is not allowed to withdraw more" before you send the ETH. Otherwise you lose all your money.

This is wild because in every other case intra-function code ordering doesn't matter in Solidity.

These days, the standard way to send ETH is this tongue twister: (bool success, ) = msg.sender.call{value: amount}(""), which actually generates a compiler warning.

Anyway, a true work of art, has probably saved devs millions, available for the first time ever in PNG form. All proceeds go toward furthering the Phunk movement through technology!

This collection has no description yet.

Contract Address0x5eec...8c41
Token ID2
Token StandardERC-721
ChainEthereum
Creator Earnings
0%

CryptoPhunksMarket Re-entrancy Note

visibility
4 views
  • Price
    USD Price
    Quantity
    Expiration
    From
  • Price
    USD Price
    Quantity
    Floor Difference
    Expiration
    From
keyboard_arrow_down
Event
Price
From
To
Date

CryptoPhunksMarket Re-entrancy Note

visibility
4 views
  • Price
    USD Price
    Quantity
    Expiration
    From
  • Price
    USD Price
    Quantity
    Floor Difference
    Expiration
    From

A 1904x960 PNG rendering of the function in the CryptoPhunksMarket contract that allows users to withdraw ETH from sales.

It contains a helpful comment about avoiding re-entrancy attacks. If you're anything like me, when you read this code for the first time you thought "what's a re-entrancy attack"?

And then if you read it's a bit terrifying—when you send ETH with transfer() you need to have your contract's state indicate "this user is not allowed to withdraw more" before you send the ETH. Otherwise you lose all your money.

This is wild because in every other case intra-function code ordering doesn't matter in Solidity.

These days, the standard way to send ETH is this tongue twister: (bool success, ) = msg.sender.call{value: amount}(""), which actually generates a compiler warning.

Anyway, a true work of art, has probably saved devs millions, available for the first time ever in PNG form. All proceeds go toward furthering the Phunk movement through technology!

This collection has no description yet.

Contract Address0x5eec...8c41
Token ID2
Token StandardERC-721
ChainEthereum
Creator Earnings
0%
keyboard_arrow_down
Event
Price
From
To
Date