Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
||
| ## Revoker | ||
|
|
||
| `Revoker` lets vault sentinels cancel pending vault or adapter actions whose data is too large to send in a transaction. It builds the data onchain and must also be a vault sentinel. |
There was a problem hiding this comment.
| `Revoker` lets vault sentinels cancel pending vault or adapter actions whose data is too large to send in a transaction. It builds the data onchain and must also be a vault sentinel. | |
| `Revoker` lets vault sentinels cancel pending vault or adapter actions whose data is too large to send in a transaction. It is recommended to add it as a vault sentinel. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c254fd3391
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
MathisGD
left a comment
There was a problem hiding this comment.
- weird that this gets discovered now
- should we really be doing this contract ourselves
- in future contracts, should we change timelocked to revert decoding data too long?
| function revoke(address vault, address target, bytes memory creationCode) external { | ||
| require(target == vault || IMorphoMarketV1AdapterV2(target).parentVault() == vault, InvalidTarget()); | ||
| require(IVaultV2(vault).isSentinel(msg.sender), NotSentinel()); | ||
|
|
||
| address source; | ||
| assembly ("memory-safe") { | ||
| source := create(0, add(creationCode, 32), mload(creationCode)) | ||
| } | ||
| require(source != address(0), DeploymentFailed()); | ||
|
|
||
| IVaultV2(target).revoke(RevokeSource(source).revokeData()); | ||
| } |
There was a problem hiding this comment.
| function revoke(address vault, address target, bytes memory creationCode) external { | |
| require(target == vault || IMorphoMarketV1AdapterV2(target).parentVault() == vault, InvalidTarget()); | |
| require(IVaultV2(vault).isSentinel(msg.sender), NotSentinel()); | |
| address source; | |
| assembly ("memory-safe") { | |
| source := create(0, add(creationCode, 32), mload(creationCode)) | |
| } | |
| require(source != address(0), DeploymentFailed()); | |
| IVaultV2(target).revoke(RevokeSource(source).revokeData()); | |
| } | |
| function revoke(address vault, address target, bytes memory creationCode) external { | |
| require(target == vault || IMorphoMarketV1AdapterV2(target).parentVault() == vault, InvalidTarget()); | |
| require(IVaultV2(vault).isSentinel(msg.sender), NotSentinel()); | |
| IVaultV2(target).revoke(RevokeSource(source).revokeData()); | |
| } |
There was a problem hiding this comment.
Do you mean revoke(address vault, address target, address source), with the caller deploying the source beforehand? Removing deployment while keeping bytes memory creationCode leaves source undefined.
Summary
Pending actions can contain too much data to send in a revocation transaction. Add a Revoker that deploys a source contract from supplied creation code, reads the action data from it, and calls revoke on the vault or adapter.
The caller and Revoker must both be vault sentinels. The target must be the vault or an adapter with that parent vault. The source can reconstruct the data onchain; execution must still fit within the transaction gas limit.
Addresses Sherlock #14.
Checks
forge build src/periphery/Revoker.solforge fmt --check src/periphery/Revoker.solgit diff --check