Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base deployment #94

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ forge script script/deploy_OrderTypes.s.sol:DeployOrderTypes --rpc-url $ETH_RPC_
The `broadcast` directory collects the latest run of the deployment script by network and is updated manually.
When the script is ran, the corresponding files can be found in the folder `broadcast/deploy_OrderTypes.s.sol/`.

#### Manual deployment

Because of the issue [#39](https://github.com/cowprotocol/composable-cow/issues/93), in order to achieve deterministic deployment it is needed to:

- Go to a deployed contract in another network, open the creation TX (e.g. [ExtensibleFallbackHandler](https://etherscan.io/tx/0x33dcbc73a8797c69a5b3956539dd8d191cf3f190bcb27a4d4eca8556f030f574) in mainnet)
- Go to `Click to show more` and copy the `Input Data` in Original format, also copy the `to` address
- Use your favourite tool to make a transaction (e.i. [swiss-knife](https://transact.swiss-knife.xyz/send-tx?chainId=1))
- Use the corresponding `Input Data` and `to` and send the tx
- A new contract will be deployed using `CREATE2` to the same deterministic address

How to verify the contracts:

- Some contracts will auto-verify themselves (rare), because they exist in other networks
- Some contracts can be verified with forge e.i. `forge verify-contract --etherscan-api-key $BASESCAN_API_KEY --rpc-url $RPC_URL 0x2f55e8b20D0B9FEFA187AA7d00B6Cbe563605bF5 lib/safe/contracts/handler/ExtensibleFallbackHandler.sol:ExtensibleFallbackHandler`
- For the contracts which can't be verified neither way, the standard json input has to be generated with forge: `forge verify-contract --verifier sourcify --show-standard-json-input --etherscan-api-key $BASESCAN_API_KEY --rpc-url $RPC_URL 0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74 src/ComposableCoW.sol:ComposableCoW > ComposableCoW.json`, and submit the json to the corresponding block explorer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fedgiac speaking with @fleupold about it, we agreed to upload the standard json input format for those contracts requiring it. Where do you think it is the best place to paste them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific repository, probably dev/, since it already has the script used to generate networks.json and it's somewhat related.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific repository, probably dev/, since it already has the script used to generate networks.json and it's somewhat related.

#### Local deployment

For local integration testing, including the use of [Watch Tower](https://github.com/cowprotocol/tenderly-watch-tower), it may be useful deploying to a _forked_ mainnet environment. This can be done with `anvil`.
Expand Down
Loading