OpenZeppelin / openzeppelin-contracts

OpenZeppelin Contracts is a library for secure smart contract development.
https://openzeppelin.com/contracts
MIT License
24.44k stars 11.68k forks source link

Bubble up `returndata` from reverted Create2 deployments #5052

Closed dimitriospapathanasiou closed 1 month ago

dimitriospapathanasiou commented 1 month ago

Fixes #5046

I am uploading this PR to propose a solution for issue #5046. The current implementation simply reverts with a generic FailedDeployment error, which obscures potentially useful debugging information contained in the returndata. So in the changes, deploy function was enhanced in the following way:

The changes were tested locally, and the expected output was given.

Amxx commented 1 month ago

Thank you @dimitriospapathanasiou for this PR.

I like the idea ... but I'm not sure I like the current implementation.