Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tether approvals #137

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WrappedVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ contract WrappedVault is Ownable, InitializableERC20, IWrappedVault {

_mint(address(0), 10_000); // Burn 10,000 wei to stop 'first share' front running attacks on depositors

DEPOSIT_ASSET.approve(vault, type(uint256).max);
DEPOSIT_ASSET.safeApprove(vault, type(uint256).max);
}

/// @param rewardsToken The new reward token / points program to be used as incentives
Expand Down
45 changes: 45 additions & 0 deletions test/DebugWV.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-Liense-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

import { MockERC20 } from "test/mocks/MockERC20.sol";
import { MockERC4626 } from "test/mocks/MockERC4626.sol";

import { ERC20 } from "lib/solmate/src/tokens/ERC20.sol";
import { ERC4626 } from "lib/solmate/src/tokens/ERC4626.sol";

import { WrappedVault } from "src/WrappedVault.sol";
import { WrappedVaultFactory } from "src/WrappedVaultFactory.sol";

import { FixedPointMathLib } from "lib/solmate/src/utils/FixedPointMathLib.sol";
import { Owned } from "lib/solmate/src/auth/Owned.sol";
import { Ownable2Step, Ownable } from "lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol";

import { PointsFactory } from "src/PointsFactory.sol";
import { Ownable as SoladyOwnable } from "lib/solady/src/auth/Ownable.sol";

import { Test, console } from "forge-std/Test.sol";

contract WrappedVaultTest is Test {
using FixedPointMathLib for *;

WrappedVaultFactory testFactory;
uint256 mainnetFork;
address owner = 0x85De42e5697D16b853eA24259C42290DaCe35190;

function setUp() public {
mainnetFork = vm.createFork("https://gateway.tenderly.co/public/mainnet");
vm.selectFork(mainnetFork);

testFactory = WrappedVaultFactory(0x75E502644284eDf34421f9c355D75DB79e343Bca);
}

function testTetherVault() external {
address wvi = address(new WrappedVault());

vm.startPrank(owner);
testFactory.updateWrappedVaultImplementation(wvi);
vm.stopPrank();

testFactory.wrapVault(ERC4626(0x5C20B550819128074FD538Edf79791733ccEdd18), 0x9FC3da866e7DF3a1c57adE1a97c9f00a70f010c8, "Test123", 5_000_000_000_000_000);
}
}
Loading