You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB
Solidity

2 years ago
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import {SendIt} from "../src/SendIt.sol";
import {NFT} from "../src/NFT.sol";
2 years ago
contract SendItTest is Test {
using stdStorage for StdStorage;
2 years ago
SendIt public sendit;
NFT public nft;
2 years ago
function setUp() public {
sendit = new SendIt();
nft = new NFT();
2 years ago
}
function testBulkTransferSucceeds() public {
2 years ago
uint256 amt = 20;
uint256[] memory tokenIndexes = new uint256[](amt);
address[] memory recipients = new address[](amt);
for (uint256 i; i < amt; i++) {
tokenIndexes[i] = i + 1;
recipients[i] = address(1);
}
vm.startPrank(address(5));
nft.mint(address(5), amt);
nft.setApprovalForAll(address(sendit), true);
sendit.contractBulkTransfer(
address(nft),
tokenIndexes,
recipients,
false
);
vm.stopPrank();
2 years ago
}
2 years ago
function testSingleTransfer() public {
nft.mint(address(5), 20);
vm.startPrank(address(5));
for (uint256 i; i < 20; i++) {
nft.safeTransferFrom(address(5), address(1), i + 1);
}
vm.stopPrank();
}
// function testUpdateVault() public {
// sendit.updateVault(address(3));
// console.log(address(sendit));
// // console.log(sendit);
// assertEq(sendit.addressVault(address(2)), address(0));
// }
2 years ago
}