Home

Awesome

Foundry Multichain

This repo provides an example of a multichain Solidity Deployment/Upgradability script pattern. It can also be applicable for non-upgradable contracts (remove UUPSProxy)

Scripts are located at the script directory:

Minimal set of tests are located at the tests directory.

Before running anything, make sure your .env variables are set. You can use .env-example as a template

Things you can learn & get inspiration

Running Tests

To build & run tests, run the following command

  forge test -vvvv 

Examples

Deploy to testnets

forge script DeployCounter -s "deployCounterTestnet(uint256, uint256)" 5 6 --force --multi 

Deploy to selected chains

forge script DeployCounter -s "deployCounterSelectedChains(uint256, uint256, uint8[] calldata, uint8)" 154 155 "[3,4,5,6]" 1 --force --multi 

Upgrade on testnets

forge script UpgradeCounter -s "upgradeTestnet()" --force --multi

Upgrade on selected chains

forge script UpgradeCounter -s "upgradeSelectedChains(uint8[] calldata, uint8)" "[3]" 1 --force --multi 

Acknowledgements

License

MIT