From 8920664801c8f1d262cc3c881898a5a50213ac60 Mon Sep 17 00:00:00 2001 From: vicnaum Date: Mon, 6 Nov 2023 18:34:26 +0100 Subject: [PATCH] misc: deployment scripts improved --- script/S06_InteractWithLensV2.s.sol | 24 +++++++++++++++++------- script/addBalance.sh | 2 ++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/script/S06_InteractWithLensV2.s.sol b/script/S06_InteractWithLensV2.s.sol index 27377e5..39a6254 100644 --- a/script/S06_InteractWithLensV2.s.sol +++ b/script/S06_InteractWithLensV2.s.sol @@ -178,13 +178,21 @@ contract S06_InteractWithLensV2 is Script, ForkManagement, ArrayHelpers { address governanceContractAdmin = json.readAddress( string(abi.encodePacked('.', targetEnv, '.GovernanceContractAdmin')) ); - if (governance.owner != governanceContractAdmin) { - console.log( - 'Mock Governance %s != Governance contract admin %s', - governance.owner, - governanceContractAdmin - ); - revert(); + + if (isEnvSet('DEPLOYMENT_ENVIRONMENT')) { + if (!LibString.eq(vm.envString('DEPLOYMENT_ENVIRONMENT'), 'production')) { + console.log('DEPLOYMENT_ENVIRONMENT is not production'); + revert(); + } + } else { + if (governance.owner != governanceContractAdmin) { + console.log( + 'Mock Governance %s != Governance contract admin %s', + governance.owner, + governanceContractAdmin + ); + revert(); + } } profileCreator = json.readAddress(string(abi.encodePacked('.', targetEnv, '.ProfileCreator'))); @@ -260,6 +268,7 @@ contract S06_InteractWithLensV2 is Script, ForkManagement, ArrayHelpers { }); vm.stopBroadcast(); + // TODO: Replace this with a true governance for a fork from production vm.startBroadcast(governance.ownerPk); governanceContract.lensHub_whitelistProfileCreator(address(temporarilyCreationProxy), true); vm.stopBroadcast(); @@ -440,6 +449,7 @@ contract S06_InteractWithLensV2 is Script, ForkManagement, ArrayHelpers { vm.stopBroadcast(); + // TODO: Replace this with a true governance for a fork from production vm.startBroadcast(governance.ownerPk); governanceContract.lensHub_whitelistProfileCreator(address(temporarilyCreationProxy), false); vm.stopBroadcast(); diff --git a/script/addBalance.sh b/script/addBalance.sh index 9e89db5..b0a7dc0 100644 --- a/script/addBalance.sh +++ b/script/addBalance.sh @@ -4,3 +4,5 @@ ADDRESS=$1 cast rpc --rpc-url mumbai tenderly_addBalance "[[\"$ADDRESS\"], \"0x8AC7230489E80000\"]" --raw + +# cast rpc --rpc-url polygon anvil_autoImpersonateAccount "[true]" --raw