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

feat: add foundry and create2 deployment script for MixedRouteQuoterV1 #73

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ crytic-export/
node_modules/
typechain/
.env
.vscode
.vscode

broadcast/
out/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
6 changes: 6 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[profile.default]
src = 'contracts'
out = 'out'
bytecode_hash = "none"
libs = ["lib"]
optimizer_runs = 1000000
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at bb4cee
13 changes: 13 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@ensdomains/=node_modules/@ensdomains/
@openzeppelin/=node_modules/@openzeppelin/
@solidity-parser/=node_modules/solhint/node_modules/@solidity-parser/
@uniswap/=node_modules/@uniswap/
@uniswap/swap-router-contracts/=contracts/
base64-sol/=node_modules/base64-sol/
hardhat/=node_modules/hardhat/
base/=contracts/base/
interfaces/=contracts/interfaces/
lens/=contracts/lens/
libraries/=contracts/libraries/
test/=contracts/test/
forge-std/=lib/forge-std/src/
23 changes: 23 additions & 0 deletions script/DeployMixedRouteQuoterV1.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;

import 'forge-std/console2.sol';
import 'forge-std/Script.sol';
import {MixedRouteQuoterV1} from 'contracts/lens/MixedRouteQuoterV1.sol';

contract DeployMixedRouteQuoterV1 is Script {
function setUp() public {}

function run() public returns (MixedRouteQuoterV1 mixedRouteQuoterV1) {
address V3_FACTORY = vm.envAddress('FOUNDRY_MIXEDROUTE_QUOTER_DEPLOY_V3_FACTORY');
address V2_FACTORY = vm.envAddress('FOUNDRY_MIXEDROUTE_QUOTER_DEPLOY_V2_FACTORY');
address WETH9 = vm.envAddress('FOUNDRY_MIXEDROUTE_QUOTER_DEPLOY_WETH9');

vm.startBroadcast();

mixedRouteQuoterV1 = new MixedRouteQuoterV1{salt: 0x00}(V3_FACTORY, V2_FACTORY, WETH9);
console2.log('MixedRouteQuoterV1 deployed at', address(mixedRouteQuoterV1));

vm.stopBroadcast();
}
}