Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/plugins/owner/SingleOwnerPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ contract SingleOwnerPlugin is BasePlugin, ISingleOwnerPlugin, IERC1271 {
functionId: uint8(FunctionId.VALIDATION_OWNER_OR_SELF),
dependencyIndex: 0 // Unused.
});
manifest.validationFunctions = new ManifestAssociatedFunction[](7);
manifest.validationFunctions = new ManifestAssociatedFunction[](8);
manifest.validationFunctions[0] = ManifestAssociatedFunction({
executionSelector: this.transferOwnership.selector,
associatedFunction: ownerValidationFunction
Expand Down Expand Up @@ -191,6 +191,10 @@ contract SingleOwnerPlugin is BasePlugin, ISingleOwnerPlugin, IERC1271 {
executionSelector: this.isValidSignature.selector,
associatedFunction: alwaysAllowRuntime
});
manifest.validationFunctions[7] = ManifestAssociatedFunction({
executionSelector: this.owner.selector,
associatedFunction: alwaysAllowRuntime
});

return manifest;
}
Expand Down
9 changes: 9 additions & 0 deletions test/account/UpgradeableModularAccount.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,15 @@ contract UpgradeableModularAccountTest is AccountTestBase {
assertEq(address(account3), address(uint160(uint256(vm.load(address(account1), slot)))));
}

function test_transferOwnership() public {
assertEq(SingleOwnerPlugin(address(account1)).owner(), owner1);

vm.prank(owner1);
SingleOwnerPlugin(address(account1)).transferOwnership(owner2);

assertEq(SingleOwnerPlugin(address(account1)).owner(), owner2);
}

// Internal Functions

function _printStorageReadsAndWrites(address addr) internal {
Expand Down