Skip to content

(pausable option A) Add PayloadSwitchSapient#93

Closed
ScreamingHawk wants to merge 7 commits intomasterfrom
payload-switch
Closed

(pausable option A) Add PayloadSwitchSapient#93
ScreamingHawk wants to merge 7 commits intomasterfrom
payload-switch

Conversation

@ScreamingHawk
Copy link
Copy Markdown
Contributor

@ScreamingHawk ScreamingHawk commented Apr 8, 2026

Adds the ability to lock "subdigest" authorisations behind an ownable kill switch.

This replaces the current "subdigest" leaf. The leaf should instead be a sapient call to this contract and expect the image hash to be the same leaf digest as the wallet any address subdigest would have been.

For Trails, this gives Polygon the ability to lock preapproved payload interactions on a given chain with a single flag. This does not impact recovery or prevent the owner from interacting with the intent directly.

@ScreamingHawk ScreamingHawk requested a review from a team April 8, 2026 20:02
@Agusx1211 Agusx1211 changed the title Add PayloadSwitchSapient (pausable option A) Add PayloadSwitchSapient Apr 15, 2026
Copy link
Copy Markdown
Contributor Author

@ScreamingHawk ScreamingHawk left a comment

Choose a reason for hiding this comment

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

nits

Comment on lines +137 to +139
interface IPauseSource {
function paused() external view returns (bool);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Move to it's own file and inherit in PayloadSwitchSapient.

revert ZeroAddress();
}

isOperator[operator] = true;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

emit OperatorSet


/// @notice Disables ownership renunciation so the pause switch cannot become permanently stuck.
function renounceOwnership() public view override onlyOwner {
revert OwnershipRenunciationDisabled();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

transferOwnership(address(1)) effectively does the same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cleaner to remove the OZ ownable inheritance instead?

Comment thread src/TrailsUtils.sol
/// - {HydrateProxy} for hydrate + execute flows
/// - {RequireUtils} for precondition checks
contract TrailsUtils is MalleableSapient, HydrateProxy, RequireUtils {}
contract TrailsUtils is MalleableSapient, HydrateProxy, RequireUtils {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Have we looked at including PayloadSwitchSapient in the inheritance graph? Fewer addresses to warm at the expense of flag/logic to split between recoverSapientSignature implementations.

Comment on lines +73 to +81
/// @notice Updates whether `operator` is allowed to pause.
function setOperator(address operator, bool allowed) external onlyOwner {
if (operator == address(0)) {
revert ZeroAddress();
}

isOperator[operator] = allowed;
emit OperatorSet(operator, allowed);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Move operator logic to parent contract and expose a modifier?

@Agusx1211
Copy link
Copy Markdown
Member

Closed in favor of C

@Agusx1211 Agusx1211 closed this Apr 17, 2026
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