diff --git a/packages/ethereum-contracts/ops-scripts/deploy-deterministically.js b/packages/ethereum-contracts/ops-scripts/deploy-deterministically.js index d9aa814b13..a9d50aecd5 100644 --- a/packages/ethereum-contracts/ops-scripts/deploy-deterministically.js +++ b/packages/ethereum-contracts/ops-scripts/deploy-deterministically.js @@ -21,7 +21,7 @@ const MacroForwarder = artifacts.require("MacroForwarder"); * @param web3 The web3 instance to be used * @param from address to use for funding the deployer account * - * Usage: npx truffle exec ops-scripts/deploy-deterministically.js : {CONTRACT NAME} [{NONCE}] + * Usage: npx truffle exec ops-scripts/deploy-deterministically.js : {CONTRACT NAME} * CONTRACT NAME must be one of SuperfluidLoader, AgreementForwarder * If NONCE is not defined, 0 is assumed (-> first tx done from the deployer account) * @@ -32,6 +32,7 @@ const MacroForwarder = artifacts.require("MacroForwarder"); * GAS_PRICE: override the estimated gas price * EST_TX_COST: override the estimated tx cost (amount to be sent to deployer) * for networks with different cost derivation structure (Optimism) + * NONCE: if NONCE is not defined, 0 is assumed (-> first tx done from the deployer account) */ module.exports = eval(`(${S.toString()})()`)(async function ( args, @@ -41,18 +42,12 @@ module.exports = eval(`(${S.toString()})()`)(async function ( console.log("======== Deploying deterministically ========"); - let nonce = 0; - if (args.length === 2) { - nonce = parseInt(args.pop()); - if (nonce < 0) { - console.error("nonce must be >= 0"); - process.exit(1); - } - } else if (args.length !== 1) { + if (args.length !== 1) { throw new Error("Wrong number of arguments"); } const contractName = args.pop(); + const nonce = parseInt(process.env.NONCE) || 0; const privKey = process.env.DETERMINISTIC_DEPLOYER_PK; const deployer = web3.eth.accounts.privateKeyToAccount(privKey); console.log("deployer:", deployer.address); @@ -100,10 +95,7 @@ module.exports = eval(`(${S.toString()})()`)(async function ( const deployerTxCnt = await web3.eth.getTransactionCount(deployer.address); if (nonce !== deployerTxCnt) { - console.error( - `### ERR: requested nonce is ${nonce}, but next usable nonce is ${deployerTxCnt}` - ); - process.exit(1); + throw new Error(`### ERR: requested nonce is ${nonce}, but next usable nonce is ${deployerTxCnt}`); } const deployerBalance = await web3.eth.getBalance(deployer.address); diff --git a/packages/ethereum-contracts/tasks/deploy-macro-forwarder.sh b/packages/ethereum-contracts/tasks/deploy-macro-forwarder.sh index 29065255fc..efc6299255 100755 --- a/packages/ethereum-contracts/tasks/deploy-macro-forwarder.sh +++ b/packages/ethereum-contracts/tasks/deploy-macro-forwarder.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eu +set -o pipefail # Usage: # tasks/deploy-macro-forwarder.sh @@ -23,7 +24,7 @@ source .env set -x network=$1 -expectedContractAddr="0xfD01285b9435bc45C243E5e7F978E288B2912de6" +expectedContractAddr="0xFD0268E33111565dE546af2675351A4b1587F89F" deployerPk=$MACROFWD_DEPLOYER_PK tmpfile="/tmp/$(basename "$0").addr" @@ -35,13 +36,18 @@ rm "$tmpfile" echo "deployed to $contractAddr" if [[ $contractAddr != "$expectedContractAddr" ]]; then - echo "oh no!" - exit + echo "contract address not as expected!" + if [ -z "$SKIP_ADDRESS_CHECK" ]; then + exit + fi fi # verify (give it a few seconds to pick up the code) sleep 5 +# allow to fail +set +e npx truffle run --network "$network" verify MacroForwarder@"$contractAddr" +set -e # set resolver ALLOW_UPDATE=1 npx truffle exec --network "$network" ops-scripts/resolver-set-key-value.js : MacroForwarder "$contractAddr" diff --git a/packages/metadata/main/networks/list.cjs b/packages/metadata/main/networks/list.cjs index 354d420c26..6f2967d25d 100644 --- a/packages/metadata/main/networks/list.cjs +++ b/packages/metadata/main/networks/list.cjs @@ -28,7 +28,7 @@ module.exports = "wrapStrategy": "0x1D65c6d3AD39d454Ea8F682c49aE7744706eA96d" }, "existentialNFTCloneFactory": "0xF76529ddEE7AA7890323eCa40C212758DD93B888", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3220000, "logsQueryRange": 50000, @@ -71,7 +71,7 @@ module.exports = "superfluidLoader": "0x862F59081FC7907F940bE4227b9f485d700E6cdD", "batchLiquidator": "0x79aE8BF8EE9238d8E848F7dbBF74Ddb3365f6c11", "existentialNFTCloneFactory": "0x0D1F0d4629B722b4dFabd195c14F12f2095418d9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3322400, "logsQueryRange": 10000, @@ -115,7 +115,7 @@ module.exports = }, "superfluidLoader": "0x109412E3C84f0539b43d39dB691B08c90f58dC7c", "batchLiquidator": "0x9539B21cC67844417E80aE168bc28c831E7Ed271", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 6886559, "logsQueryRange": 50000, @@ -164,7 +164,7 @@ module.exports = "superfluidLoader": "0xe25603df330027d91A0BAcc3e80a7f9e84930FC6", "batchLiquidator": "0x70bbB7a057A13070dF11d533e8f299357D778637", "superTokenFactory": "0x87560833d59Be057aFc63cFFa3fc531589Ba428F", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 2823800, "logsQueryRange": 50000, @@ -198,7 +198,7 @@ module.exports = "superTokenFactory": "0x7447E94Dfe3d804a9f46Bf12838d467c912C8F6C", "superfluidLoader": "0x777Be25F9fdcA87e8a0E06Ad4be93d65429FCb9f", "batchLiquidator": "0x95043eC349476B413eF5c369c4d2454a1a65eaB9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 10604500, "logsQueryRange": 50000, diff --git a/packages/metadata/module/networks/list.js b/packages/metadata/module/networks/list.js index 90f9f98640..492f04ba33 100644 --- a/packages/metadata/module/networks/list.js +++ b/packages/metadata/module/networks/list.js @@ -28,7 +28,7 @@ export default "wrapStrategy": "0x1D65c6d3AD39d454Ea8F682c49aE7744706eA96d" }, "existentialNFTCloneFactory": "0xF76529ddEE7AA7890323eCa40C212758DD93B888", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3220000, "logsQueryRange": 50000, @@ -71,7 +71,7 @@ export default "superfluidLoader": "0x862F59081FC7907F940bE4227b9f485d700E6cdD", "batchLiquidator": "0x79aE8BF8EE9238d8E848F7dbBF74Ddb3365f6c11", "existentialNFTCloneFactory": "0x0D1F0d4629B722b4dFabd195c14F12f2095418d9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3322400, "logsQueryRange": 10000, @@ -115,7 +115,7 @@ export default }, "superfluidLoader": "0x109412E3C84f0539b43d39dB691B08c90f58dC7c", "batchLiquidator": "0x9539B21cC67844417E80aE168bc28c831E7Ed271", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 6886559, "logsQueryRange": 50000, @@ -164,7 +164,7 @@ export default "superfluidLoader": "0xe25603df330027d91A0BAcc3e80a7f9e84930FC6", "batchLiquidator": "0x70bbB7a057A13070dF11d533e8f299357D778637", "superTokenFactory": "0x87560833d59Be057aFc63cFFa3fc531589Ba428F", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 2823800, "logsQueryRange": 50000, @@ -198,7 +198,7 @@ export default "superTokenFactory": "0x7447E94Dfe3d804a9f46Bf12838d467c912C8F6C", "superfluidLoader": "0x777Be25F9fdcA87e8a0E06Ad4be93d65429FCb9f", "batchLiquidator": "0x95043eC349476B413eF5c369c4d2454a1a65eaB9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 10604500, "logsQueryRange": 50000, diff --git a/packages/metadata/networks.json b/packages/metadata/networks.json index 656e8216ad..d7ef240adf 100644 --- a/packages/metadata/networks.json +++ b/packages/metadata/networks.json @@ -26,7 +26,7 @@ "wrapStrategy": "0x1D65c6d3AD39d454Ea8F682c49aE7744706eA96d" }, "existentialNFTCloneFactory": "0xF76529ddEE7AA7890323eCa40C212758DD93B888", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3220000, "logsQueryRange": 50000, @@ -69,7 +69,7 @@ "superfluidLoader": "0x862F59081FC7907F940bE4227b9f485d700E6cdD", "batchLiquidator": "0x79aE8BF8EE9238d8E848F7dbBF74Ddb3365f6c11", "existentialNFTCloneFactory": "0x0D1F0d4629B722b4dFabd195c14F12f2095418d9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 3322400, "logsQueryRange": 10000, @@ -113,7 +113,7 @@ }, "superfluidLoader": "0x109412E3C84f0539b43d39dB691B08c90f58dC7c", "batchLiquidator": "0x9539B21cC67844417E80aE168bc28c831E7Ed271", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 6886559, "logsQueryRange": 50000, @@ -162,7 +162,7 @@ "superfluidLoader": "0xe25603df330027d91A0BAcc3e80a7f9e84930FC6", "batchLiquidator": "0x70bbB7a057A13070dF11d533e8f299357D778637", "superTokenFactory": "0x87560833d59Be057aFc63cFFa3fc531589Ba428F", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 2823800, "logsQueryRange": 50000, @@ -196,7 +196,7 @@ "superTokenFactory": "0x7447E94Dfe3d804a9f46Bf12838d467c912C8F6C", "superfluidLoader": "0x777Be25F9fdcA87e8a0E06Ad4be93d65429FCb9f", "batchLiquidator": "0x95043eC349476B413eF5c369c4d2454a1a65eaB9", - "macroForwarder": "0xfD01285b9435bc45C243E5e7F978E288B2912de6" + "macroForwarder": "0xFD0268E33111565dE546af2675351A4b1587F89F" }, "startBlockV1": 10604500, "logsQueryRange": 50000,