Skip to content

Commit

Permalink
Add scripts to deploy NovaVault and add addresses of deployed contrac…
Browse files Browse the repository at this point in the history
…ts (#38)
  • Loading branch information
lakonema2000 authored Sep 16, 2024
1 parent 9cb6107 commit 0345d05
Showing 4 changed files with 60 additions and 33 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,6 @@ forge test --fork-url optimism -vvv

## contracts

- [NovaAdapterVelo](https://optimistic.etherscan.io/address/0xA0E5013486E9fecC15835B9D9c76bB209eA48273)
- [NovaVault](https://optimistic.etherscan.io/address/0x7A8F265F2d1362ED8b6D5dd52E82741217BE8D3C)
- [NovaVaultV2](https://optimistic.etherscan.io/address/0x04b12a2590BD808F7aC01f066aae0e2f48A3991C)
- [NovaAdapterVeloCLPool](https://optimistic.etherscan.io/address/0xD4Cd6B3e3fcd6399D534F7a07c18ed804B64e13e)
- [NovaVault](https://optimistic.etherscan.io/address/0xbf3ccf927eD469229ed834FD67004533f37a7291)
- [NovaVaultV2](https://optimistic.etherscan.io/address/0x04b12a2590BD808F7aC01f066aae0e2f48A3991C)
30 changes: 0 additions & 30 deletions script/Deploy.s.sol

This file was deleted.

57 changes: 57 additions & 0 deletions script/DeployNovaVaultAndAdapter.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.17;

import "forge-std/Script.sol";
import {NovaVault} from "../src/NovaVault.sol";
import {NovaAdapterVeloCLPool} from "../src/adapters/NovaAdapterVeloCLPool.sol";
import {IVelodromeCLPool} from "../src/interfaces/IVelodromeCLPool.sol";

// Deploy a contract to a deterministic address with create2 factory.
contract Deploy is Script {
function run() external {
uint256 privateKey = vm.envUint("PRIVATE_KEY_OWNER");

vm.startBroadcast(privateKey);

address POOL = 0x131525f3FA23d65DC2B1EB8B6483a28c43B06916;
address sDAI = 0x2218a117083f5B482B0bB821d27056Ba9c04b1D3;
NovaAdapterVeloCLPool adapter;
NovaVault vault;
IVelodromeCLPool veloPool;
address stable;
address veloToken0;
address veloToken1;
address[] memory stables = new address[](1);
address[] memory novaAdapters = new address[](1);

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

//////////////////
// NovaAdapterVeloCLPool Deployment
//////////////////

adapter = new NovaAdapterVeloCLPool(stable, sDAI, POOL);
console.log("NovaAdapterVeloCLPool address is ", address(adapter));

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

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

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

vm.stopBroadcast();
}
}
File renamed without changes.

0 comments on commit 0345d05

Please sign in to comment.