Closed robert-e-davidson3 closed 4 years ago
See https://github.com/Zoltu/deterministic-deployment-proxy for a system that makes deterministic addresses easy. TL;DR: replace the to
address on your deploys with 0x7A0D94F55792C434d74a40883C6ed8545E406D12
instead of 0
.
If you are deploying to a private network, you'll need to send 100,000 * 100 / 10^18
ETH to 0x4c8D290a1B368ac4728d83a9e8321fC3af2b39b1
and then submit this (pre-signed) transaction 0xf87e8085174876e800830186a08080ad601f80600e600039806000f350fe60003681823780368234f58015156014578182fd5b80825250506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222
once for the life of the chain.
These are the lines you'll want to change to switch to using the deterministic deployment proxy: https://github.com/AugurProject/augur/blob/60cb84f1638f26d11e5846affd6d5e636088333a/packages/augur-core/source/libraries/ContractDeployer.ts#L289-L293
At the moment, you are using ethers to do the contract deploy and unfortunately you won't be able to do this because you need to set the to
address. I suspect you can still use ethers to construct the deployment call (combine deployment bytecode + constructor arguments) but you'll need to construct a custom transaction with that as the data.
Since new contracts will still need a new address.json for deploy we really need to handle that anyway.
Gonna close this issue as wont-do for now (though I do like the idea).
This is still necessary for the frontend smoketest to be auto-runnable but I'll leave this closed because it's ultimately low enough priority that CREATE3 (heh) may exist by the time we get time for it.
Contract addresses are not consistent using the default deploy method. This is a problem for system (end-to-end) tests because the process goes like this:
addresses.json
to use the new addresses.Building the UI in step #1 uses the
addresses.json
as it exists while building but the correct addresses aren't available until step #3.Another solution is to build the UI within test setup. That works as a backup plan.