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

Setting multisig guards via Guard factory #70

Open
wants to merge 5 commits into
base: guard
Choose a base branch
from
Open

Conversation

kupermind
Copy link
Collaborator

  • 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 {
Copy link
Collaborator Author

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) {
Copy link
Collaborator Author

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.

Comment on lines +127 to +129
assembly {
guard := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
}
Copy link
Collaborator Author

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 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test DelegateCall contract

77ph pushed a commit that referenced this pull request Oct 12, 2023
refactor: reward function for protocol-owned services
77ph pushed a commit that referenced this pull request Oct 12, 2023
chore and test: creating fuzzer auxiliary contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants