-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be4372b
commit 4e39856
Showing
3 changed files
with
73 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
packages/lsp8-contracts/contracts/Mocks/UniversalReceiver.sol
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,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import { | ||
ILSP1UniversalReceiver | ||
} from "@lukso/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol"; | ||
import { | ||
_INTERFACEID_LSP1 | ||
} from "@lukso/lsp1-contracts/contracts/LSP1Constants.sol"; | ||
|
||
contract MockUniversalReceiver is ILSP1UniversalReceiver { | ||
event UniversalReceiverCalled( | ||
address indexed from, | ||
bytes32 indexed typeId, | ||
bytes receivedData | ||
); | ||
|
||
function universalReceiver( | ||
bytes32 typeId, | ||
bytes calldata receivedData | ||
) external payable override returns (bytes memory) { | ||
emit UniversalReceiverCalled(msg.sender, typeId, receivedData); | ||
return ""; | ||
} | ||
|
||
function supportsInterface(bytes4 interfaceId) public view returns (bool) { | ||
return interfaceId == _INTERFACEID_LSP1; | ||
} | ||
} |
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