fix syntax
This commit is contained in:
@@ -14,18 +14,20 @@ import {IERC721Receiver} from "../../intf/IERC721Receiver.sol";
|
||||
import {IERC1155} from "../../intf/IERC1155.sol";
|
||||
import {IERC1155Receiver} from "../../intf/IERC1155Receiver.sol";
|
||||
|
||||
contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, ReentrancyGuard {
|
||||
contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, IERC1155Receiver {
|
||||
|
||||
function transferOwnership(address newOwner) external override onlyOwner {
|
||||
function transferOwnership(address newOwner) public override onlyOwner {
|
||||
emit OwnershipTransferred(_OWNER_, newOwner);
|
||||
_OWNER_ = newOwner;
|
||||
}
|
||||
|
||||
function withdrawERC721(address nftContract, uint256 tokenId) onlyOwner {
|
||||
//TODO? assetTo
|
||||
function withdrawERC721(address nftContract, uint256 tokenId) public onlyOwner {
|
||||
IERC721(nftContract).safeTransferFrom(msg.sender, _OWNER_, tokenId, "");
|
||||
}
|
||||
|
||||
function withdrawERC1155(address nftContract, uint256[] tokenIds, uint256[] amounts) onlyOwner {
|
||||
//TODO? assetTo
|
||||
function withdrawERC1155(address nftContract, uint256[] memory tokenIds, uint256[] memory amounts) public onlyOwner {
|
||||
IERC1155(nftContract).safeBatchTransferFrom(msg.sender, _OWNER_, tokenIds, amounts, "");
|
||||
}
|
||||
|
||||
@@ -34,7 +36,7 @@ contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, Reentrancy
|
||||
address from,
|
||||
uint256 tokenId,
|
||||
bytes calldata data
|
||||
) external returns (bytes4) {
|
||||
) external override returns (bytes4) {
|
||||
return IERC721Receiver.onERC721Received.selector;
|
||||
}
|
||||
|
||||
@@ -44,9 +46,9 @@ contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, Reentrancy
|
||||
uint256 id,
|
||||
uint256 value,
|
||||
bytes calldata data
|
||||
) external returns (bytes4){
|
||||
) external override returns (bytes4){
|
||||
return IERC1155Receiver.onERC1155Received.selector;
|
||||
};
|
||||
}
|
||||
|
||||
function onERC1155BatchReceived(
|
||||
address operator,
|
||||
@@ -54,7 +56,12 @@ contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, Reentrancy
|
||||
uint256[] calldata ids,
|
||||
uint256[] calldata values,
|
||||
bytes calldata data
|
||||
) external returns (bytes4){
|
||||
return IERC1155BatchReceiver.onERC1155BatchReceived.selector;
|
||||
};
|
||||
) external override returns (bytes4){
|
||||
return IERC1155Receiver.onERC1155BatchReceived.selector;
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId) public override view returns (bool) {
|
||||
return interfaceId == type(IERC1155).interfaceId
|
||||
|| interfaceId == type(IERC721).interfaceId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user