Skip to content

Commit

Permalink
Remove invalid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Jun 12, 2024
1 parent f4e2856 commit a7237a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
3 changes: 1 addition & 2 deletions src/PermissionedERC20Wrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ contract PermissionedERC20Wrapper is Auth, ERC20PermissionedBase {
else revert("PermissionedERC20Wrapper/file-unrecognized-param");
}

// --- ERC20 wrapping ---
// --- Permission checks ---
function _update(address from, address to, uint256 value) internal virtual override {
require(hasPermission(to), "PermissionedERC20Wrapper/no-permission");
super._update(from, to, value);
}

// --- Permission checks ---
function hasPermission(address account) public view override returns (bool attested) {
if (
account == address(this) || account == address(0) || account == MORPHO || account == BUNDLER
Expand Down
29 changes: 0 additions & 29 deletions test/unit/PermissionedERC20Wrapper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,6 @@ contract PermissionedERC20WrapperTest is Test {
assertEq(usdc.balanceOf(userNonUS1), 100);
}

function test_WithdrawTo_WithNonPermissioned_Works() public {
deal(address(wrappedUSDC), userUS, 100);
deal(address(usdc), address(wrappedUSDC), 100);
vm.startPrank(userUS);
wrappedUSDC.approve(address(wrappedUSDC), 100);
wrappedUSDC.withdrawTo(userUS, 100);
vm.stopPrank();
assertEq(wrappedUSDC.balanceOf(userUS), 0);
assertEq(usdc.balanceOf(userUS), 100);
}

function test_WithdrawTo_FromNonPermissionedToPermissioned_Works() public {
deal(address(wrappedUSDC), userUS, 100);
deal(address(usdc), address(wrappedUSDC), 100);
vm.startPrank(userUS);
wrappedUSDC.approve(address(wrappedUSDC), 100);
wrappedUSDC.withdrawTo(userNonUS1, 100);
vm.stopPrank();
assertEq(wrappedUSDC.balanceOf(userNonUS1), 0);
assertEq(usdc.balanceOf(userNonUS1), 100);
}

function test_transfer_FromPermissionedToPermissioned_Works() public {
deal(address(wrappedUSDC), userNonUS1, 100);
vm.prank(userNonUS1);
Expand All @@ -187,11 +165,4 @@ contract PermissionedERC20WrapperTest is Test {
vm.prank(userNonUS1);
wrappedUSDC.transfer(userUS, 100);
}

function test_transfer_FromNonPermissionedToPermissioned_Works() public {
deal(address(wrappedUSDC), userUS, 100);
vm.prank(userUS);
wrappedUSDC.transfer(userNonUS1, 100);
assertEq(wrappedUSDC.balanceOf(userNonUS1), 100);
}
}

0 comments on commit a7237a9

Please sign in to comment.