foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(cast) add creation-code method [#8973]

Open pawurb opened this issue 4 months ago • 2 comments

Motivation

As described in https://github.com/foundry-rs/foundry/issues/8973, currently there's no simple way to obtain contract creation code without compiling them locally. It is needed to deploy contracts with sol! macro.

If this is accepted I'll add artifact method generating file that can be used directly with sol! macro.

Solution

This PR adds cast creation-code method. It outputs the contract creation code.

Example usage

cast creation-code 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 --etherscan-api-key API_KEY --rpc-url RPC_URL

pawurb avatar Oct 04 '24 08:10 pawurb