Skip to content

Commit

Permalink
Bump deps again
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Oct 29, 2024
1 parent 9dd4e2a commit 4457df7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 75 deletions.
31 changes: 3 additions & 28 deletions script/NestedSignFromJson.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ pragma solidity ^0.8.15;

import {JsonTxBuilderBase} from "src/JsonTxBuilderBase.sol";
import {NestedMultisigBuilder} from "@base-contracts/script/universal/NestedMultisigBuilder.sol";
import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {IGnosisSafe} from "@eth-optimism-bedrock/scripts/interfaces/IGnosisSafe.sol";
import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol";
import {stdJson} from "forge-std/StdJson.sol";
import {console} from "forge-std/console.sol";
import {Vm} from "forge-std/Vm.sol";

contract NestedSignFromJson is NestedMultisigBuilder, JsonTxBuilderBase {
abstract contract NestedSignFromJson is NestedMultisigBuilder, JsonTxBuilderBase {
address globalSignerSafe; // Hack to avoid passing signerSafe as an input to many functions.

/// @dev Signs the approveHash transaction from the Nested Safe to the System Owner Safe.
function signJson(string memory _path, IGnosisSafe _signerSafe) public {
function signJson(string memory _path, address _signerSafe) public {
_loadJson(_path);
sign(_signerSafe);
}

/// @dev Submits signatures to call approveHash on the System Owner Safe.
function approveJson(string memory _path, IGnosisSafe _signerSafe, bytes memory _signatures) public {
function approveJson(string memory _path, address _signerSafe, bytes memory _signatures) public {
_loadJson(_path);
approve(_signerSafe, _signatures);
}
Expand All @@ -38,28 +37,4 @@ contract NestedSignFromJson is NestedMultisigBuilder, JsonTxBuilderBase {
function _ownerSafe() internal view override returns (address) {
return vm.envAddress("OWNER_SAFE");
}

function _postSign(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postRun(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postCheck() internal virtual override {}

function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload) internal virtual {
accesses; // Silences compiler warnings.
simPayload;
require(false, "_postCheck not implemented");
}
}
23 changes: 3 additions & 20 deletions script/PresignPauseFromJson.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract PresignPauseFromJson is MultisigBuilder, JsonTxBuilderBase {
// address into the owners list.
if (vm.envOr("SIMULATE_WITHOUT_LEDGER", false) || vm.envOr("SIMULATE_WITHOUT_LEDGER", uint256(0)) == 1) {
console.log("Adding override for test sender");
IGnosisSafe safe = IGnosisSafe(_ownerSafe());
address safe = _ownerSafe();
uint256 nonce = _getNonce(safe);
overrides_ = new Simulation.StateOverride[](1);
overrides_[0] = Simulation.overrideSafeThresholdOwnerAndNonce(safe, vm.envAddress("TEST_SENDER"), nonce);
Expand All @@ -42,7 +42,7 @@ contract PresignPauseFromJson is MultisigBuilder, JsonTxBuilderBase {

/// @notice Overrides the MultisigBuilder's _addOverrides function to prevent creating multiple separate state
/// overrides for the owner safe when using SIMULATE_WITHOUT_LEDGER.
function _safeOverrides(IGnosisSafe _safe, address _owner)
function _safeOverrides(address _safe, address _owner)
internal
view
override
Expand All @@ -65,31 +65,14 @@ contract PresignPauseFromJson is MultisigBuilder, JsonTxBuilderBase {
return vm.envAddress("PRESIGNER_SAFE");
}

function _postSign(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postRun(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postCheck() internal virtual override {}

/// @notice This function is called after the simulation of the transactions is done.
/// It checks that the transactions only write to the nonce of the PRESIGNER_SAFE contract and the paused slot of
/// the SuperchainConfig contract.
function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
view
virtual
override
{
checkStateDiff(accesses);
for (uint256 i; i < accesses.length; i++) {
Expand Down
27 changes: 1 addition & 26 deletions script/SignFromJson.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ pragma solidity ^0.8.15;

import {JsonTxBuilderBase} from "src/JsonTxBuilderBase.sol";
import {MultisigBuilder} from "@base-contracts/script/universal/MultisigBuilder.sol";
import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol";
import {stdJson} from "forge-std/StdJson.sol";
import {console} from "forge-std/console.sol";
import {Vm} from "forge-std/Vm.sol";

contract SignFromJson is MultisigBuilder, JsonTxBuilderBase {
abstract contract SignFromJson is MultisigBuilder, JsonTxBuilderBase {
function signJson(string memory _path) public {
_loadJson(_path);
sign();
Expand All @@ -28,28 +27,4 @@ contract SignFromJson is MultisigBuilder, JsonTxBuilderBase {
function _ownerSafe() internal view override returns (address) {
return vm.envAddress("OWNER_SAFE");
}

function _postSign(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postRun(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload)
internal
virtual
override
{
_postCheck(accesses, simPayload);
}

function _postCheck() internal virtual override {}

function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory simPayload) internal virtual {
accesses; // Silences compiler warnings.
simPayload;
require(false, "_postCheck not implemented");
}
}

0 comments on commit 4457df7

Please sign in to comment.