mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
Fix .gitignore: stop tracking ignored files
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./ERC1155Receiver.sol";
|
||||
|
||||
/**
|
||||
* Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
|
||||
*
|
||||
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
|
||||
* stuck.
|
||||
*
|
||||
* @dev _Available since v3.1._
|
||||
*/
|
||||
contract ERC1155Holder is ERC1155Receiver {
|
||||
function onERC1155Received(
|
||||
address,
|
||||
address,
|
||||
uint256,
|
||||
uint256,
|
||||
bytes memory
|
||||
) public virtual override returns (bytes4) {
|
||||
return this.onERC1155Received.selector;
|
||||
}
|
||||
|
||||
function onERC1155BatchReceived(
|
||||
address,
|
||||
address,
|
||||
uint256[] memory,
|
||||
uint256[] memory,
|
||||
bytes memory
|
||||
) public virtual override returns (bytes4) {
|
||||
return this.onERC1155BatchReceived.selector;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../IERC1155Receiver.sol";
|
||||
import "../../../utils/introspection/ERC165.sol";
|
||||
|
||||
/**
|
||||
* @dev _Available since v3.1._
|
||||
*/
|
||||
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
|
||||
/**
|
||||
* @dev See {IERC165-supportsInterface}.
|
||||
*/
|
||||
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
|
||||
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user