Vectorized / solady

Optimized Solidity snippets.
MIT License
2.29k stars 306 forks source link

✨ Lifebuoy #964

Closed Vectorized closed 1 week ago

Vectorized commented 2 weeks ago

Description

Motivation

Incident A

Two users sent a total of 16 ETH to address X on Base instead of Ethereum mainnet. On Base, address X is an EOA. On Ethereum mainnet, address X is a Sales contract with a withdraw ETH function.

Initially, it was possible to rescue the funds on Base -- one just need to redeploy the Sales contract with the same deployer at nonce 0.

Unfortunately, the Foundry script was not configured for Base. Upon running it, it deployed a mock on nonce 0 instead of the desired Sales contract. The mock lacked the withdraw function, so the funds are stucked forever.

Incident B

A user thought that the DN404 Mirror will automatically reroll NFTs if they send the ERC20s to it. Unfortunately, the DN404 Mirror does not have a withdraw ERC20 / ERC721 function. The tokens are stuck there forever.

Rationale

Checklist

Ensure you completed all of the steps below before submitting your pull request:

Pull requests with an incomplete checklist will be thrown out.