Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed May 9, 2024
1 parent 9e9e429 commit abd90dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
18 changes: 5 additions & 13 deletions packages/protocol/test/tokenvault/ERC1155Vault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -974,18 +974,10 @@ contract ERC1155VaultTest is TaikoTest {
vm.expectRevert("ERC1155: caller is not token owner or approved");
destChainErc1155Vault.sendToken{ value: GAS_LIMIT }(sendOpts);

// TODO
// // Also Vault cannot burn tokens it does not own (even if the priv key compromised)
// uint256[] memory randomIdAndLength = new uint256[](1);
// randomIdAndLength[0] = 20;
// vm.prank(address(destChainErc1155Vault), address(destChainErc1155Vault));
// vm.expectRevert("ERC1155: burn amount exceeds balance");
// BridgedERC1155(deployedContract).burnBatch(randomIdAndLength, randomIdAndLength);

// // After setApprovalForAll() ERC1155Vault can transfer and burn
// vm.prank(Alice, Alice);
// ERC1155(deployedContract).setApprovalForAll(address(destChainErc1155Vault), true);
// vm.prank(Alice, Alice);
// destChainErc1155Vault.sendToken{ value: GAS_LIMIT }(sendOpts);
// After setApprovalForAll() ERC1155Vault can transfer and burn
vm.prank(Alice, Alice);
ERC1155(deployedContract).setApprovalForAll(address(destChainErc1155Vault), true);
vm.prank(Alice, Alice);
destChainErc1155Vault.sendToken{ value: GAS_LIMIT }(sendOpts);
}
}
19 changes: 5 additions & 14 deletions packages/protocol/test/tokenvault/ERC721Vault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -904,19 +904,10 @@ contract ERC721VaultTest is TaikoTest {
vm.expectRevert("ERC721: caller is not token owner or approved");
destChainErc721Vault.sendToken{ value: GAS_LIMIT }(sendOpts);

// Also Vault cannot burn tokens it does not own (even if the priv key compromised)
vm.prank(address(destChainErc721Vault), address(destChainErc721Vault));
vm.expectRevert(BridgedERC721.BTOKEN_INVALID_BURN.selector);

// TODO???
// tokenIds = new uint256[](1);
// tokenIds[0] = 1;
// BridgedERC721(deployedContract).batchBurn(tokenIds);

// // After approve() ERC721Vault can transfer and burn
// vm.prank(Alice, Alice);
// ERC721(deployedContract).approve(address(destChainErc721Vault), 1);
// vm.prank(Alice, Alice);
// destChainErc721Vault.sendToken{ value: GAS_LIMIT }(sendOpts);
// After approve() ERC721Vault can transfer and burn
vm.prank(Alice, Alice);
ERC721(deployedContract).approve(address(destChainErc721Vault), 1);
vm.prank(Alice, Alice);
destChainErc721Vault.sendToken{ value: GAS_LIMIT }(sendOpts);
}
}

0 comments on commit abd90dd

Please sign in to comment.