From 9987ad2143845073419af0dd6797feed395cbb4b Mon Sep 17 00:00:00 2001 From: "A.L" Date: Sat, 16 Sep 2023 17:25:15 -0500 Subject: [PATCH] script: add deploy quoter script --- package.json | 1 + script/deploy_quoter.s.sol | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 script/deploy_quoter.s.sol diff --git a/package.json b/package.json index c178b0d..b24a122 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "clean": "forge clean", "deploy:avax:test": "forge script script/deploy_router_timelock_asset_manager.s.sol --target-contract DeployRouterTimeLockAaveManager --fork-url \"http://127.0.0.1:8545\" --broadcast -vvvv --verify --ledger --mnemonic-derivation-paths \"m/44'/60'/0'/0/4\" --sender 0x5c5c2a70504AfD08845D5Ee6fD77E98E0bC3dFcd", "deploy:avax": "forge script script/deploy_router_timelock_asset_manager.s.sol --target-contract DeployRouterTimeLockAaveManager --fork-url \"https://api.avax.network/ext/bc/C/rpc\" --broadcast -vvvv --verify --ledger --mnemonic-derivation-paths \"m/44'/60'/0'/0/4\" --sender 0x5c5c2a70504AfD08845D5Ee6fD77E98E0bC3dFcd", + "deploy:avax:quoter": "forge script script/deploy_quoter.s.sol --target-contract DeployQuoter --fork-url \"https://api.avax.network/ext/bc/C/rpc\" --broadcast -vvvv --verify --ledger --mnemonic-derivation-paths \"m/44'/60'/0'/0/4\" --sender 0x5c5c2a70504AfD08845D5Ee6fD77E98E0bC3dFcd", "eslint": "npm run eslint:check", "eslint:check": "eslint scripts", "eslint:fix": "eslint scripts --fix", diff --git a/script/deploy_quoter.s.sol b/script/deploy_quoter.s.sol new file mode 100644 index 0000000..cc14c5c --- /dev/null +++ b/script/deploy_quoter.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import "forge-std/Script.sol"; + +import { Quoter } from "src/Quoter.sol"; + +contract DeployQuoter is Script { + address internal constant FACTORY = 0xDd723D9273642D82c5761a4467fD5265d94a22da; + address internal constant WETH_AVAX_MAINNET = 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7; + + function run() external { + vm.startBroadcast(msg.sender); + _deployQuoter(); + vm.stopBroadcast(); + } + + function _deployQuoter() internal { + Quoter lQuoter = new Quoter(FACTORY, WETH_AVAX_MAINNET); + require(address(lQuoter.factory()) == FACTORY); + require(address(lQuoter.WETH()) == WETH_AVAX_MAINNET); + } +}