Skip to content

Commit

Permalink
Deployment of NovaVaultV2 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
lakonema2000 authored Aug 14, 2024
1 parent 486b351 commit 45ab984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ forge test --fork-url optimism -vvv
## contracts

- [NovaAdapterVelo](https://optimistic.etherscan.io/address/0xA0E5013486E9fecC15835B9D9c76bB209eA48273)
- [NovaVault](https://optimistic.etherscan.io/address/0x7A8F265F2d1362ED8b6D5dd52E82741217BE8D3C)
- [NovaVault](https://optimistic.etherscan.io/address/0x7A8F265F2d1362ED8b6D5dd52E82741217BE8D3C)
- [NovaVaultV2](https://optimistic.etherscan.io/address/0x04b12a2590BD808F7aC01f066aae0e2f48A3991C)
51 changes: 5 additions & 46 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,28 @@
pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import {NovaVault} from "../src/NovaVault.sol";
import {NovaVaultV2} from "../src/NovaVaultV2.sol";
import {NovaAdapterVelo} from "../src/NovaAdapterVelo.sol";
import {IVelodromePool} from "../src/interfaces/IVelodromePool.sol";
import {GenericSwapFacet} from "@lifi/src/Facets/GenericSwapFacet.sol";
import {GenericSwapFacetV3} from "@lifi/src/Facets/GenericSwapFacetV3.sol";

// Deploy a contract to a deterministic address with create2 factory.
contract Deploy is Script {
function run() external {
string memory seedPhrase = vm.readFile(".secret");
uint256 privateKey = vm.deriveKey(seedPhrase, 0);
uint256 privateKey = vm.envUint("PRIVATE_KEY_OWNER");

vm.startBroadcast(privateKey);

address POOL = 0x131525f3FA23d65DC2B1EB8B6483a28c43B06916;
address sDAI = 0x2218a117083f5B482B0bB821d27056Ba9c04b1D3;
NovaAdapterVelo adapter;
NovaVault vault;
NovaVaultV2 vaultV2;
GenericSwapFacet swapFacet;
IVelodromePool veloPool;
address underlyingAddress;
address veloToken0;
address veloToken1;
address[] memory stables = new address[](1);
address[] memory novaAdapters = new address[](1);

veloPool = IVelodromePool(POOL);
veloToken0 = veloPool.token0();
veloToken1 = veloPool.token1();
if (veloToken0 == sDAI) {
underlyingAddress = veloToken1;
} else if (veloToken1 == sDAI) {
underlyingAddress = veloToken0;
} else {
revert("Velodrome pool should be made of `asset` and `sDAI`!");
}

//////////////////
// NovaAdapterVelo Deployment
//////////////////

adapter = new NovaAdapterVelo(underlyingAddress, sDAI, POOL);
console.log("NovaAdapterVelo address is ", address(adapter));

//////////////////
// NovaVault Deployment
//////////////////

stables[0] = underlyingAddress;
novaAdapters[0] = address(adapter);

vault = new NovaVault(sDAI, stables, novaAdapters);
console.log("NovaVault address is ", address(vault));
GenericSwapFacetV3 swapFacet;

//////////////////
// NovaVaultV2 Deployment
//////////////////

swapFacet = new GenericSwapFacet();
swapFacet = new GenericSwapFacetV3();

vaultV2 = new NovaVaultV2(sDAI, address(swapFacet));
console.log("NovaVault address is ", address(vault));
console.log("NovaVaultV2 address is ", address(vaultV2));

vm.stopBroadcast();
}
Expand Down

0 comments on commit 45ab984

Please sign in to comment.