forked from Sol-DAO/solbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✋ user
- Loading branch information
Showing
1 changed file
with
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import {ERC1155TokenReceiver} from "../../../src/tokens/ERC1155/ERC1155.sol"; | ||
import {ERC1155B} from "../../../src/tokens/ERC1155/ERC1155B.sol"; | ||
|
||
contract ERC1155BUser is ERC1155TokenReceiver { | ||
ERC1155B token; | ||
|
||
constructor(ERC1155B _token) { | ||
token = _token; | ||
} | ||
|
||
function onERC1155Received( | ||
address, | ||
address, | ||
uint256, | ||
uint256, | ||
bytes calldata | ||
) external virtual override returns (bytes4) { | ||
return ERC1155TokenReceiver.onERC1155Received.selector; | ||
} | ||
|
||
function onERC1155BatchReceived( | ||
address, | ||
address, | ||
uint256[] calldata, | ||
uint256[] calldata, | ||
bytes calldata | ||
) external virtual override returns (bytes4) { | ||
return ERC1155TokenReceiver.onERC1155BatchReceived.selector; | ||
} | ||
|
||
function setApprovalForAll(address operator, bool approved) public virtual { | ||
token.setApprovalForAll(operator, approved); | ||
} | ||
|
||
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) public virtual { | ||
token.safeTransferFrom(from, to, id, amount, data); | ||
} | ||
|
||
function safeBatchTransferFrom( | ||
address from, | ||
address to, | ||
uint256[] memory ids, | ||
uint256[] memory amounts, | ||
bytes memory data | ||
) public virtual { | ||
token.safeBatchTransferFrom(from, to, ids, amounts, data); | ||
} | ||
} |