-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from orcaprotocol/willkim/qsp-14
fix: QSP-14
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pragma solidity 0.8.7; | ||
|
||
// These functions are not used by the SafeTeller directly, so have been moved | ||
// to their own contract | ||
contract DelegateSetupHelper { | ||
// In our `SafeTeller.createSafe()` function, we call `GnosisSafeProxyFactory.createProxyWithNonce()` | ||
// with a callback to this `delegateSetup()` function. The proxy factory will then call this function | ||
// via a delegate call. | ||
// In the context of this delegate call, `this` will refer to the proxy factory, which then in turn makes a | ||
// delegate call to GnosisSafe, and `this` will then refer to GnosisSafe | ||
// therefore this function will call `GnosisSafe.enableModule()`, which is inherited from `ModuleManager`. | ||
function delegateSetup(address _context) external { | ||
this.enableModule(_context); | ||
} | ||
|
||
// This function is here solely to allow compilation. | ||
// This function should not be called, see the above doc block for explanation. | ||
function enableModule(address) external { | ||
revert("should not be called"); | ||
} | ||
} |