Skip to content

Commit

Permalink
refactor: add the hooks in LSP14 and LSP9
Browse files Browse the repository at this point in the history
  • Loading branch information
YamenMerhi committed Nov 6, 2023
1 parent a877794 commit 113f4be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {

newOwner.notifyUniversalReceiver(
_TYPEID_LSP14_OwnershipTransferStarted,
""
abi.encode(currentOwner, newOwner)
);

// reset the transfer ownership lock
Expand All @@ -118,12 +118,12 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {

previousOwner.notifyUniversalReceiver(
_TYPEID_LSP14_OwnershipTransferred_SenderNotification,
""
abi.encode(previousOwner, msg.sender)
);

msg.sender.notifyUniversalReceiver(
_TYPEID_LSP14_OwnershipTransferred_RecipientNotification,
""
abi.encode(previousOwner, msg.sender)
);
}

Expand All @@ -144,7 +144,7 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
if (owner() == address(0)) {
previousOwner.notifyUniversalReceiver(
_TYPEID_LSP14_OwnershipTransferred_SenderNotification,
""
abi.encode(previousOwner, address(0))
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ contract LSP9VaultCore is

newOwner.notifyUniversalReceiver(
_TYPEID_LSP9_OwnershipTransferStarted,
""
abi.encode(currentOwner, newOwner)
);

// reset the transfer ownership lock
Expand All @@ -462,12 +462,12 @@ contract LSP9VaultCore is

previousOwner.notifyUniversalReceiver(
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
""
abi.encode(previousOwner, msg.sender)
);

msg.sender.notifyUniversalReceiver(
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
""
abi.encode(previousOwner, msg.sender)
);
}

Expand All @@ -490,7 +490,7 @@ contract LSP9VaultCore is
if (owner() == address(0)) {
previousOwner.notifyUniversalReceiver(
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
""
abi.encode(previousOwner, address(0))
);
}
}
Expand Down
5 changes: 4 additions & 1 deletion tests/LSP9Vault/LSP9Vault.behaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,10 @@ export const shouldBehaveLikeLSP9 = (
context.lsp9Vault.address,
0,
LSP1_TYPE_IDS.LSP9OwnershipTransferStarted,
'0x',
abiCoder.encode(
['address', 'address'],
[context.accounts.owner.address, context.universalProfile.address],
),
abiCoder.encode(
['bytes', 'bytes'],
[ethers.utils.hexlify(ethers.utils.toUtf8Bytes('LSP1: typeId out of scope')), '0x'],
Expand Down

0 comments on commit 113f4be

Please sign in to comment.