Skip to content

Comment on std::unique_ptr implementation backed by Ethereum NFTs

Comments

The author has an excellent reply to a question on twitter

> What are the gas prices like for copying a pointer?
Copying an nft_ptr is illegal. Moving an nft_ptr takes 87,169 gas: https://goerli.etherscan.io/tx/0xcbe06fdd54bd9d221993c875022... at mainnet gas prices of ~100 Gwei, equal to 0.0087169 ETH, or $18.69 USD. (This was intentionally written to waste resources for no benefit, just like cryptocurrencies themselves)
The C++ "as-if" rule means the compiler is allowed to optimize away the move, but it still needs to charge the $18.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.