diff --git a/.github/workflows/create-PR-implement.yml b/.github/workflows/create-PR-implement.yml index 33d00a5..85cbbd6 100644 --- a/.github/workflows/create-PR-implement.yml +++ b/.github/workflows/create-PR-implement.yml @@ -41,7 +41,7 @@ jobs: toBranch: ${{ env.FEATURE_BRANCH }} - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6.0.1 with: branch: ${{ env.HEAD_BRANCH }} base: ${{env.FEATURE_BRANCH}} diff --git a/.github/workflows/create-PR-release.yml b/.github/workflows/create-PR-release.yml index 87944c6..b9dec20 100644 --- a/.github/workflows/create-PR-release.yml +++ b/.github/workflows/create-PR-release.yml @@ -75,7 +75,7 @@ jobs: toBranch: ${{matrix.branch_name}} - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6.0.1 with: labels: automated PR delete-branch: true diff --git a/lib/contract-libs b/lib/contract-libs index e5fdb79..2388600 160000 --- a/lib/contract-libs +++ b/lib/contract-libs @@ -1 +1 @@ -Subproject commit e5fdb79848c7635680581fd241b316580706c202 +Subproject commit 2388600fbc1874ac588c5f779c498beb52213ca3 diff --git a/lib/forge-std b/lib/forge-std index 1d0766b..b6a506d 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 1d0766bc5d814f117c7b1e643828f7d85024fb51 +Subproject commit b6a506db2262cad5ff982a87789ee6d1558ec861 diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts index bd325d5..fd81a96 160000 --- a/lib/openzeppelin-contracts +++ b/lib/openzeppelin-contracts @@ -1 +1 @@ -Subproject commit bd325d56b4c62c9c5c1aff048c37c6bb18ac0290 +Subproject commit fd81a96f01cc42ef1c9a5399364968d0e07e9e90 diff --git a/script/BaseMigration.s.sol b/script/BaseMigration.s.sol index f10cf71..d0fb3d2 100644 --- a/script/BaseMigration.s.sol +++ b/script/BaseMigration.s.sol @@ -143,7 +143,7 @@ abstract contract BaseMigration is ScriptExtended { address proxyAdmin = _getProxyAdmin(); assertTrue(proxyAdmin != address(0x0), "BaseMigration: Null ProxyAdmin"); - vm.broadcast(sender()); + _prankOrBroadcast(sender()); deployed = payable(address(new Proxy(logic, proxyAdmin, args))); // validate proxy admin @@ -172,7 +172,7 @@ abstract contract BaseMigration is ScriptExtended { returns (address payable deployed, uint256 nonce) { nonce = vm.getNonce(sender()); - vm.broadcast(sender()); + _prankOrBroadcast(sender()); deployed = payable(deployCode(filename, args)); } @@ -265,7 +265,7 @@ abstract contract BaseMigration is ScriptExtended { // if proxyAdmin is External Owned Wallet if (proxyAdmin.code.length == 0) { - vm.broadcast(proxyAdmin); + _prankOrBroadcast(proxyAdmin); if (args.length == 0) iProxy.upgradeTo(logic); else iProxy.upgradeToAndCall(logic, args); } else { @@ -278,7 +278,7 @@ abstract contract BaseMigration is ScriptExtended { if (owner.code.length != 0) { _cheatUpgrade(owner, wProxyAdmin, iProxy, logic); } else { - vm.broadcast(owner); + _prankOrBroadcast(owner); wProxyAdmin.upgrade(iProxy, logic); } } else { @@ -288,7 +288,7 @@ abstract contract BaseMigration is ScriptExtended { if (owner.code.length != 0) { _cheatUpgradeAndCall(owner, wProxyAdmin, iProxy, logic, args); } else { - vm.broadcast(owner); + _prankOrBroadcast(owner); wProxyAdmin.upgradeAndCall(iProxy, logic, args); } } @@ -296,7 +296,7 @@ abstract contract BaseMigration is ScriptExtended { if (owner.code.length != 0) { _cheatUpgradeAndCall(owner, wProxyAdmin, iProxy, logic, args); } else { - vm.broadcast(owner); + _prankOrBroadcast(owner); wProxyAdmin.upgradeAndCall(iProxy, logic, args); } } @@ -402,6 +402,14 @@ abstract contract BaseMigration is ScriptExtended { wProxyAdmin.upgradeAndCall(iProxy, logic, args); } + function _prankOrBroadcast(address to) internal virtual { + if (CONFIG.isPostChecking()) { + vm.prank(to); + } else { + vm.broadcast(to); + } + } + function _setDependencyDeployScript(TContract contractType, IScriptExtended deployScript) internal virtual { _deployScript[contractType] = IMigrationScript(address(deployScript)); } diff --git a/script/extensions/ScriptExtended.s.sol b/script/extensions/ScriptExtended.s.sol index cf39c48..a9faa95 100644 --- a/script/extensions/ScriptExtended.s.sol +++ b/script/extensions/ScriptExtended.s.sol @@ -17,7 +17,6 @@ abstract contract ScriptExtended is Script, StdAssertions, IScriptExtended { bytes public constant EMPTY_ARGS = ""; IGeneralConfig public constant CONFIG = IGeneralConfig(LibSharedAddress.CONFIG); - bool internal _isPostChecking; modifier logFn(string memory fnName) { _logFn(fnName);