generated from FraxFinance/frax-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: fraxtal deps * chore(script): rn Fraxtal{Deploy => Script}.s.sol for clarity * ops: all deploy scripts * refactor(factory): comptroller as initial feeToSetter and feeTo * fix: testnet comptroller
- Loading branch information
1 parent
42d697a
commit ecbe4f9
Showing
19 changed files
with
252 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const DEVNET = "devnet"; | ||
export const TESTNET = "testnet"; | ||
export const MAINNET = "mainnet"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const FPI_ERC20 = "0x67218f66a84809201CfBa5c8b46dBd3aB95A42da"; | ||
export const FPIS_ERC20 = "0xC0497C072d3015fd7D45893157bCDCC1BcfEb6b5"; | ||
export const FRAX_ERC20 = "0xac3E018457B222d93114458476f3E3416Abbe38F"; | ||
export const FXS_ERC20 = "0xbAFA44EFE7901E04E39Dad13167D089C559c1138"; | ||
export const SFRXETH_ERC20 = "0x56390acF12bce9675ab3922060D8d955149BE286"; | ||
export const FRXETH_ERC20 = "0xB1C4e5a15544f005166880749C46D35a00916462"; | ||
export const FRXETH_MINTER = "0x80f1C4F5CD94D49e98D0a975690796f1E8C0379e"; | ||
export const FRXBTC_ERC20 = "0x3fe0150F6Daa6a54C585f85f0e78d665532e5b74"; | ||
export const SFRAX_ERC20 = "0x1D348307745645b91c49716Fae22Ad5d4CC0b94a"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const FRAXCHAIN_ADMIN = "0x8b1E899ec5d51387a41Ee68261149F7d3Dfd7160"; | ||
export const PROXY_ADMIN = "0xfC00000000000000000000000000000000000009"; | ||
export const L2_STANDARD_BRIDGE = "0x4200000000000000000000000000000000000010"; | ||
|
||
export const COMPTROLLER = "0x8b1E899ec5d51387a41Ee68261149F7d3Dfd7160"; | ||
|
||
// Fraxswap-specific | ||
export const FRAXSWAP_FACTORY = "0x0000000000000000000000000000000000000000"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const FRAXCHAIN_ADMIN = "0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6"; | ||
export const PROXY_ADMIN = "0xfC00000000000000000000000000000000000009"; | ||
export const L2_STANDARD_BRIDGE = "0x4200000000000000000000000000000000000010"; | ||
|
||
export const COMPTROLLER = "0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6"; | ||
|
||
// Fraxswap-specific | ||
export const FRAXSWAP_FACTORY = "0x0000000000000000000000000000000000000000"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const FRAX_PROXY = "0xFc00000000000000000000000000000000000001"; | ||
export const FXS_PROXY = "0xFc00000000000000000000000000000000000002"; | ||
export const FPI_PROXY = "0xFc00000000000000000000000000000000000003"; | ||
export const FPIS_PROXY = "0xfc00000000000000000000000000000000000004"; | ||
export const SFRXETH_PROXY = "0xFC00000000000000000000000000000000000005"; | ||
export const WFRXETH_PROXY = "0xFC00000000000000000000000000000000000006"; | ||
export const STANDARD_BRIDGE_PROXY = "0x4200000000000000000000000000000000000010"; | ||
export const ERC20_FACTORY_PROXY = "0x4200000000000000000000000000000000000012"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const FRAXCHAIN_ADMIN = "0x8b1E899ec5d51387a41Ee68261149F7d3Dfd7160"; | ||
export const PROXY_ADMIN = "0xfC00000000000000000000000000000000000007"; | ||
export const L2_STANDARD_BRIDGE = "0x4200000000000000000000000000000000000010"; | ||
|
||
export const COMPTROLLER = "0x012fcFb933b9a4335B1BCC836e6a9a475146beBd"; | ||
|
||
// Fraxswap-specific | ||
export const FRAXSWAP_FACTORY = "0x0000000000000000000000000000000000000000"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const FPI_ERC20 = "0xfBCB0F967817c924f83e26e04F0FB28ED4d6276F"; | ||
export const FPIS_ERC20 = "0x0363a32D18c25a3FD19a0d00B02106C03d8b8182"; | ||
export const FRAX_ERC20 = "0x0304A365C0fbb4b1Ad423887861b9b69a5f0c00E"; | ||
export const FXS_ERC20 = "0x4e7300F74F59AFaEcCdc0d434758Df9be238F0BF"; | ||
export const SFRXETH_ERC20 = "0xa63f56985F9C7F3bc9fFc5685535649e0C1a55f3"; | ||
export const FRXETH_ERC20 = "0x17845EA6a9BfD2caF1b9E558948BB4999dF2656e"; | ||
export const FRXETH_MINTER = "0x5E8422345238F34275888049021821E8E08CAa1f"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
export * as Mainnet from "./mainnet"; | ||
export * as Holesky from "./holesky"; | ||
export * as FraxtalDeployment from "./fraxtal-deployments"; | ||
export * as FraxtalL1Devnet from "./fraxtal-devnet-l1"; | ||
export * as FraxtalL2Devnet from "./fraxtal-devnet-l2"; | ||
export * as FraxtalTestnet from "./fraxtal-testnet"; | ||
export * as FraxtalMainnet from "./fraxtal-mainnet"; | ||
export * as FraxtalProxies from "./fraxtal-proxies"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: ISC | ||
pragma solidity ^0.8.19; | ||
|
||
import { FraxtalScript } from "./FraxtalScript.s.sol"; | ||
import { console } from "frax-std/FraxTest.sol"; | ||
import { FraxswapFactory } from "src/contracts/core/FraxswapFactory.sol"; | ||
import "../Constants.sol" as Constants; | ||
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | ||
|
||
function deployFraxswapFactory(address _owner) returns (FraxswapFactory iFraxswapFactory, address fraxswapFactory) { | ||
iFraxswapFactory = new FraxswapFactory({ _owner: _owner }); | ||
fraxswapFactory = address(iFraxswapFactory); | ||
} | ||
|
||
contract DeployFraxswapFactory is FraxtalScript { | ||
function run() public broadcaster { | ||
address owner; | ||
if (Strings.equal(network, Constants.FraxtalDeployment.DEVNET)) { | ||
owner = Constants.FraxtalL2Devnet.COMPTROLLER; | ||
} else if (Strings.equal(network, Constants.FraxtalDeployment.TESTNET)) { | ||
owner = Constants.FraxtalTestnet.COMPTROLLER; | ||
} else if (Strings.equal(network, Constants.FraxtalDeployment.MAINNET)) { | ||
owner = Constants.FraxtalMainnet.COMPTROLLER; | ||
} | ||
require(owner != address(0), "FraxswapFactory not set in network"); | ||
|
||
(, address fraxswapFactory) = deployFraxswapFactory({ _owner: owner }); | ||
console.log("FraxswapFactory deployed to: ", fraxswapFactory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: ISC | ||
pragma solidity ^0.8.19; | ||
|
||
import { FraxtalScript } from "./FraxtalScript.s.sol"; | ||
import { console } from "frax-std/FraxTest.sol"; | ||
import { FraxswapRouter } from "src/contracts/periphery/FraxswapRouter.sol"; | ||
import "../Constants.sol" as Constants; | ||
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | ||
|
||
function deployFraxswapRouter( | ||
address _factory, | ||
address _WETH | ||
) returns (FraxswapRouter iFraxswapRouter, address fraxswapRouter) { | ||
iFraxswapRouter = new FraxswapRouter({ _factory: _factory, _WETH: _WETH }); | ||
fraxswapRouter = address(iFraxswapRouter); | ||
} | ||
|
||
contract DeployFraxswapRouter is FraxtalScript { | ||
function run() external broadcaster { | ||
address fraxswapFactory; | ||
if (Strings.equal(network, Constants.FraxtalDeployment.DEVNET)) { | ||
fraxswapFactory = Constants.FraxtalL2Devnet.FRAXSWAP_FACTORY; | ||
} else if (Strings.equal(network, Constants.FraxtalDeployment.TESTNET)) { | ||
fraxswapFactory = Constants.FraxtalTestnet.FRAXSWAP_FACTORY; | ||
} else if (Strings.equal(network, Constants.FraxtalDeployment.MAINNET)) { | ||
fraxswapFactory = Constants.FraxtalMainnet.FRAXSWAP_FACTORY; | ||
} | ||
require(fraxswapFactory != address(0), "FraxswapFactory not set in network"); | ||
|
||
deployFraxswapRouter({ _factory: fraxswapFactory, _WETH: Constants.FraxtalProxies.WFRXETH_PROXY }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: ISC | ||
pragma solidity ^0.8.19; | ||
|
||
import { FraxtalScript } from "./FraxtalScript.s.sol"; | ||
import { console } from "frax-std/FraxTest.sol"; | ||
import { FraxswapRouterMultihop } from "src/contracts/periphery/FraxswapRouterMultihop.sol"; | ||
import { IWETH } from "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; | ||
import "../Constants.sol" as Constants; | ||
|
||
function deployFraxswapRouterMultihop( | ||
address _WETH9, | ||
address _FRAX, | ||
bool _CHECK_AMOUNTOUT_IN_ROUTER | ||
) returns (FraxswapRouterMultihop iFraxswapRouterMultihop, address fraxswapRouterMultihop) { | ||
iFraxswapRouterMultihop = new FraxswapRouterMultihop({ | ||
_WETH9: IWETH(_WETH9), | ||
_FRAX: _FRAX, | ||
_CHECK_AMOUNTOUT_IN_ROUTER: _CHECK_AMOUNTOUT_IN_ROUTER | ||
}); | ||
fraxswapRouterMultihop = address(iFraxswapRouterMultihop); | ||
} | ||
|
||
contract DeployFraxswapRouterMultihop is FraxtalScript { | ||
function run() public broadcaster { | ||
(, address fraxswapRouterMultihop) = deployFraxswapRouterMultihop({ | ||
_WETH9: Constants.FraxtalProxies.WFRXETH_PROXY, | ||
_FRAX: Constants.FraxtalProxies.FRAX_PROXY, | ||
_CHECK_AMOUNTOUT_IN_ROUTER: true | ||
}); | ||
console.log("FraxswapRouterMultihop deployed to: ", fraxswapRouterMultihop); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: ISC | ||
pragma solidity >=0.8.0; | ||
|
||
import { BaseScript } from "frax-std/BaseScript.sol"; | ||
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | ||
import "../Constants.sol" as Constants; | ||
|
||
// @dev: Safety to ensure script is deployed to a fraxtal chain | ||
contract FraxtalScript is BaseScript { | ||
string internal network; | ||
|
||
function setUp() public virtual override { | ||
BaseScript.setUp(); | ||
network = vm.envString("NETWORK"); | ||
|
||
if ( | ||
!Strings.equal(network, Constants.FraxtalDeployment.DEVNET) && | ||
!Strings.equal(network, Constants.FraxtalDeployment.TESTNET) && | ||
!Strings.equal(network, Constants.FraxtalDeployment.MAINNET) | ||
) { | ||
revert("NETWORK env variable must be either 'devnet' or 'testnet' or 'mainnet'"); | ||
} | ||
} | ||
} |