Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NestedMultisigBuilder] Don't override signerSafe owner #105

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions script/universal/MultisigBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ abstract contract MultisigBase is CommonBase {
returns (Simulation.StateOverride memory)
{
uint256 _nonce = _getNonce(_safe);
if (_owner == address(0)) {
return Simulation.overrideSafeThresholdAndNonce(_safe, _nonce);
}
return Simulation.overrideSafeThresholdOwnerAndNonce(_safe, _owner, _nonce);
}

Expand Down
2 changes: 1 addition & 1 deletion script/universal/NestedMultisigBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ abstract contract NestedMultisigBuilder is MultisigBase {
Simulation.StateOverride[] memory simOverrides = _simulationOverrides();
Simulation.StateOverride[] memory overrides = new Simulation.StateOverride[](2 + simOverrides.length);
overrides[0] = _safeOverrides(_signerSafe, MULTICALL3_ADDRESS);
overrides[1] = _safeOverrides(_safe, msg.sender);
overrides[1] = _safeOverrides(_safe, address(0));
for (uint256 i = 0; i < simOverrides.length; i++) {
overrides[i + 2] = simOverrides[i];
}
Expand Down
7 changes: 7 additions & 0 deletions script/universal/Simulation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ library Simulation {
return accesses;
}

function overrideSafeThresholdAndNonce(address _safe, uint256 _nonce) public view returns (StateOverride memory) {
StateOverride memory state = StateOverride({contractAddress: _safe, overrides: new StorageOverride[](0)});
state = addThresholdOverride(_safe, state);
state = addNonceOverride(_safe, state, _nonce);
return state;
}

function overrideSafeThresholdOwnerAndNonce(address _safe, address _owner, uint256 _nonce)
public
view
Expand Down