Skip to content

Commit

Permalink
✋ user
Browse files Browse the repository at this point in the history
✋ user
  • Loading branch information
z0r0z authored Nov 16, 2022
1 parent 736c9b8 commit e72e3f3
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions test/utils/user/ERC1155BUser.sol
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);
}
}

0 comments on commit e72e3f3

Please sign in to comment.