diff --git a/contracts/integrations/dummy/GoerliDummy.sol b/contracts/integrations/dummy/GoerliDummy.sol index 7e51ff50e..c4a6151b4 100644 --- a/contracts/integrations/dummy/GoerliDummy.sol +++ b/contracts/integrations/dummy/GoerliDummy.sol @@ -16,13 +16,16 @@ contract GoerliDummy is DummyStrategy { constructor(StrategyConfig memory _config) DummyStrategy(_config) {} function deposit(uint256 amt) public payable override returns (uint256) { - IDummyERC20(config.yieldToken).mint(address(this), dummyAmt); - return super.deposit(amt); + IDummyERC20(config.yieldToken).mint(address(this), amt); + IERC20(config.baseToken).transferFrom(msg.sender, address(this), amt); + IDummyERC20(config.yieldToken).approve(msg.sender, amt); + return amt; } function withdraw(uint256 amt) public payable override returns (uint256) { - uint256 val = super.deposit(amt); - IDummyERC20(config.yieldToken).burn(address(this), val); - return val; + IERC20(config.yieldToken).transferFrom(msg.sender, address(this), amt); + IERC20(config.baseToken).approve(msg.sender, amt); + IDummyERC20(config.yieldToken).burn(address(this), amt); + return amt; } } diff --git a/tasks/deploy/integrations/dummyIntegration.ts b/tasks/deploy/integrations/dummyIntegration.ts index 83cf70249..12d18970f 100644 --- a/tasks/deploy/integrations/dummyIntegration.ts +++ b/tasks/deploy/integrations/dummyIntegration.ts @@ -1,5 +1,5 @@ import {task} from "hardhat/config"; -import {APVault_V1__factory, DummyERC20__factory, GoerliDummy__factory} from "typechain-types"; +import {APVault_V1__factory, VaultEmitter__factory, DummyERC20__factory, GoerliDummy__factory} from "typechain-types"; import {VaultType} from "types"; import { StratConfig, @@ -8,8 +8,12 @@ import { getSigners, logger, writeStrategyAddresses, + getVaultAddress, + getStrategyAddress, + getAPTeamOwner } from "utils"; import {allStrategyConfigs} from "../../../contracts/integrations/stratConfig"; +import {submitMultiSigTx} from "tasks/helpers"; type TaskArgs = { name: string; @@ -82,6 +86,36 @@ task("Deploy:dummyIntegration", "Will deploy a set of vaults and a dummy strateg }; let liqVault = await Vault.deploy(liquidConfig, addresses.vaultEmitter.proxy, admin); logger.pad(30, "Liquid Vault deployed to", liqVault.address); + + const emitter = VaultEmitter__factory.connect(addresses.vaultEmitter.proxy, deployer); + + await emitter.vaultCreated( + lockVault.address, + { + vaultType: VaultType.LOCKED, + strategyId: config.id, + strategy: strategy.address, + registrar: addresses.registrar.proxy, + baseToken: addresses.tokens.usdc, + yieldToken: yieldToken.address, + apTokenName: "LockedTestVault", + apTokenSymbol: "LockTV", + } + ) + await emitter.vaultCreated( + liqVault.address, + { + vaultType: VaultType.LIQUID, + strategyId: config.id, + strategy: strategy.address, + registrar: addresses.registrar.proxy, + baseToken: addresses.tokens.usdc, + yieldToken: "0x2811747e3336aa28caf71c51454766e1b95f56e8", + apTokenName: "LiquidTestVault", + apTokenSymbol: "LiqTV", + + } + ) const data: StrategyObject = { strategy: strategy.address,