-
Notifications
You must be signed in to change notification settings - Fork 2
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
Setting multisig guards via Guard factory #70
base: guard
Are you sure you want to change the base?
Conversation
kupermind
commented
Apr 13, 2023
- Proof of concept to set a multisig guar via the Guard factory;
- Preliminary test works, need to add more tests.
constructor (address _owner) { | ||
/// @dev Initializes the Safe Guard instance by setting its owner. | ||
/// @param _owner Safe Guard owner address. | ||
function initialize (address _owner) external { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe Guard contract is initializable via the Safe Guard factory now.
|
||
// Execute the payload, if provided | ||
// The payload must be executed before the safe guard is set, as the payload could potentially break the guard | ||
if (payloadLength > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom payload is called also via a delegatecall(), as it would be called from the module manager of the GnosisSafe contract initialization.
assembly { | ||
guard := create2(0, add(bytecode, 0x20), mload(bytecode), salt) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe Guard instance is created, and the last multisig owner is set as the created Safe Guard owner.
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
contract DelegateCall { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test DelegateCall contract
refactor: reward function for protocol-owned services
chore and test: creating fuzzer auxiliary contract