Download contracts/src/ReceivingVault.sol from UTSCybeR/nftbench: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/contracts/src/ReceivingVault.sol
- Command line
-
hf download hf://datasets/UTSCybeR/nftbench/contracts/src/ReceivingVault.sol
-
curl -L -o ReceivingVault.sol https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/contracts/src/ReceivingVault.sol
861 Bytes
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.20; | |
| import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; | |
| import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; | |
| contract ReceivingVault is IERC721Receiver { | |
| address public immutable owner; | |
| address public immutable forwardTo; | |
| constructor(address owner_, address forwardTo_) { | |
| owner = owner_; | |
| forwardTo = forwardTo_; | |
| } | |
| function onERC721Received(address, address, uint256 tokenId, bytes calldata) external override returns (bytes4) { | |
| return IERC721Receiver.onERC721Received.selector; | |
| } | |
| function withdraw(address collection, uint256 tokenId, address to) external { | |
| require(msg.sender == owner, "only owner"); | |
| IERC721(collection).safeTransferFrom(address(this), to, tokenId); | |
| } | |
| } | |