This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
ProxyFactory create2 and blackholing of funds #3392
Labels
bug
Something isn't working as intended
P2
Small number of users are affected, major cosmetic issue
smart contracts
This is a bit of an edge case, but does actually waste money. If a user attempts to deploy a proxy (with the same proxyfactory nonce) when one already exists, it dies. When it dies, it continues running the
initializer
(wrapped transaction) to0x0000000000000000000000000000000000000000
. Of course this isn't an actual contract, and if the the transaction carried any value(ETH), that value would be sent to the black hole that is0x00..00
. Example tx:0x8a9650f337466d6d4ecda51ec95fd500d914ad5b3e5abb50eb253eea4240f4fc
1 event was fired:
I propose adding a check to see if the address returned by
create2
is zero to bothcreateProxyWithNonce()
andcreateProxyWithSenderNonce()
. If it is, revert. Absolutely do not run this initializer.origin/packages/contracts/contracts/proxy/ProxyFactory.s
Lines 76 to 82 in 42aa0be
I think uprading will be clean. We will need to add support for multiple
ProxyFactory
contracts for anything that tracks events(e.g. listener). Already deployed user proxies are not affected.The text was updated successfully, but these errors were encountered: