Skip to content

Commit

Permalink
Merge pull request #6 from dfx-finance/update-deploy-script
Browse files Browse the repository at this point in the history
update deploy script
  • Loading branch information
hottyage authored Nov 10, 2023
2 parents 91874d1 + 105d9c2 commit b24d93d
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 105 deletions.
5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ out = 'out'
libs = ['lib']
optimizer = true
optimizer_runs = 200

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
[rpc_endpoints]
polygon = "${POLYGON_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
193 changes: 95 additions & 98 deletions script/ArbitrumDeployment.s.sol
Original file line number Diff line number Diff line change
@@ -1,113 +1,110 @@
// // SPDX-License-Identifier: UNLICENSED
// pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

// import "forge-std/Script.sol";
// import "./CurveParams.sol";
import "forge-std/Script.sol";
import "./CurveParams.sol";

// // Libraries
// import "../src/Curve.sol";
// import "../src/Config.sol";
// Libraries
import "../src/Curve.sol";
import "../src/Config.sol";

// // Factories
// import "../src/CurveFactoryV3.sol";
// Factories
import "../src/CurveFactoryV3.sol";

// // Zap
// import "../src/Zap.sol";
// import "../src/Router.sol";
// import "./Addresses.sol";
// Zap
import "../src/Zap.sol";
import "../src/Router.sol";
import "./Addresses.sol";

// // Arbitrum DEPLOYMENT
// contract ContractScript is Script {
// function run() external {
// address OWNER = 0x1246E96b7BC94107aa10a08C3CE3aEcc8E19217B;
// uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
// vm.startBroadcast(deployerPrivateKey);
// Arbitrum DEPLOYMENT
contract ContractScript is Script {
function run() external {
address OWNER = 0x6E714c42438EC860bD3a50cbe104d2dab50193b3;
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);

// // first deploy the config
// int128 protocolFee = 50_000;
// Config config = new Config(protocolFee, OWNER);
// first deploy the config
int128 protocolFee = 50_000;
Config config = new Config(protocolFee, OWNER);

// // Deploy Assimilator
// AssimilatorFactory deployedAssimFactory = new AssimilatorFactory(
// address(config)
// );
// Deploy Assimilator
AssimilatorFactory deployedAssimFactory = new AssimilatorFactory(
address(config)
);

// // Deploy CurveFactoryV3
// CurveFactoryV3 deployedCurveFactory = new CurveFactoryV3(
// address(deployedAssimFactory),
// address(config),
// Arbitrum.WETH
// );
// Deploy CurveFactoryV3
CurveFactoryV3 deployedCurveFactory = new CurveFactoryV3(
address(deployedAssimFactory),
address(config),
Arbitrum.WETH
);

// // Attach CurveFactoryV3 to Assimilator
// deployedAssimFactory.setCurveFactory(address(deployedCurveFactory));
// Attach CurveFactoryV3 to Assimilator
deployedAssimFactory.setCurveFactory(address(deployedCurveFactory));

// // deploy usdc-cadc, cadc-crv, crv-dodo
// deploy usdc-cadc, cadc-crv, crv-dodo

// IOracle usdOracle = IOracle(Arbitrum.CHAINLINK_USDC_USD);
// IOracle cadOracle = IOracle(Arbitrum.CHAINLINK_CADC_USD);
// IOracle gyenOracle = IOracle(Arbitrum.CHAINLINK_GYEN_USD);
IOracle usdOracle = IOracle(Arbitrum.CHAINLINK_USDC_USD);
IOracle cadOracle = IOracle(Arbitrum.CHAINLINK_CADC_USD);
IOracle gyenOracle = IOracle(Arbitrum.CHAINLINK_GYEN_USD);

// // usdc-cadc curve info
// CurveFactoryV3.CurveInfo memory usdcUsdceCurveInfo = CurveFactoryV3
// .CurveInfo(
// "dfx-usdc-usdce-v3",
// "dfx-usdc-usdce-v3",
// Arbitrum.USDCe,
// Arbitrum.USDC,
// CurveParams.BASE_WEIGHT,
// CurveParams.QUOTE_WEIGHT,
// cadOracle,
// usdOracle,
// CurveParams.ALPHA,
// CurveParams.BETA,
// CurveParams.MAX,
// Arbitrum.USDCe_EPSILON,
// CurveParams.LAMBDA
// );
// usdc-usdce curve info
CurveFactoryV3.CurveInfo memory usdcUsdceCurveInfo = CurveFactoryV3.CurveInfo(
"dfx-usdc-usdce-v3",
"dfx-usdc-usdce-v3",
Arbitrum.USDCe,
Arbitrum.USDC,
CurveParams.BASE_WEIGHT,
CurveParams.QUOTE_WEIGHT,
usdOracle,
usdOracle,
CurveParams.ALPHA,
CurveParams.BETA,
CurveParams.MAX,
Arbitrum.USDCe_EPSILON,
CurveParams.LAMBDA
);

// // usdc-cadc curve info
// CurveFactoryV3.CurveInfo memory cadcUsdcCurveInfo = CurveFactoryV3
// .CurveInfo(
// "dfx-cadc-usdc-v3",
// "dfx-cadc-usdc-v3",
// Arbitrum.CADC,
// Arbitrum.USDC,
// CurveParams.BASE_WEIGHT,
// CurveParams.QUOTE_WEIGHT,
// cadOracle,
// usdOracle,
// CurveParams.ALPHA,
// CurveParams.BETA,
// CurveParams.MAX,
// Arbitrum.CADC_EPSILON,
// CurveParams.LAMBDA
// );
// usdc-cadc curve info
CurveFactoryV3.CurveInfo memory cadcUsdcCurveInfo = CurveFactoryV3.CurveInfo(
"dfx-cadc-usdc-v3",
"dfx-cadc-usdc-v3",
Arbitrum.CADC,
Arbitrum.USDC,
CurveParams.BASE_WEIGHT,
CurveParams.QUOTE_WEIGHT,
cadOracle,
usdOracle,
CurveParams.ALPHA,
CurveParams.BETA,
CurveParams.MAX,
Arbitrum.CADC_EPSILON,
CurveParams.LAMBDA
);

// // cadc-crv curve info
// CurveFactoryV3.CurveInfo memory gyenUsdcCurveInfo = CurveFactoryV3
// .CurveInfo(
// "dfx-gyen-usdc-v3",
// "dfx-gyen-usdc-v3",
// Arbitrum.CADC,
// Arbitrum.GYEN,
// CurveParams.BASE_WEIGHT,
// CurveParams.QUOTE_WEIGHT,
// cadOracle,
// gyenOracle,
// CurveParams.ALPHA,
// CurveParams.BETA,
// CurveParams.MAX,
// Arbitrum.GYEN_EPSILON,
// CurveParams.LAMBDA
// );
// gyen-usdc curve info
CurveFactoryV3.CurveInfo memory gyenUsdcCurveInfo = CurveFactoryV3.CurveInfo(
"dfx-gyen-usdc-v3",
"dfx-gyen-usdc-v3",
Arbitrum.GYEN,
Arbitrum.USDC,
CurveParams.BASE_WEIGHT,
CurveParams.QUOTE_WEIGHT,
gyenOracle,
usdOracle,
CurveParams.ALPHA,
CurveParams.BETA,
CurveParams.MAX,
Arbitrum.GYEN_EPSILON,
CurveParams.LAMBDA
);

// // Deploy all new Curves
// deployedCurveFactory.newCurve(usdcUsdceCurveInfo);
// deployedCurveFactory.newCurve(cadcUsdcCurveInfo);
// deployedCurveFactory.newCurve(gyenUsdcCurveInfo);
// Zap zap = new Zap(address(deployedCurveFactory));
// Router router = new Router(address(deployedCurveFactory));
// vm.stopBroadcast();
// }
// }
// Deploy all new Curves
deployedCurveFactory.newCurve(usdcUsdceCurveInfo);
deployedCurveFactory.newCurve(cadcUsdcCurveInfo);
deployedCurveFactory.newCurve(gyenUsdcCurveInfo);
Zap zap = new Zap(address(deployedCurveFactory));
Router router = new Router(address(deployedCurveFactory));
vm.stopBroadcast();
}
}
14 changes: 7 additions & 7 deletions script/PolygonDeployment.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import "./Addresses.sol";
// POLYGON DEPLOYMENT
contract ContractScript is Script {
function run() external {
// address OWNER = 0x6E714c42438EC860bD3a50cbe104d2dab50193b3;
address OWNER = 0x1246E96b7BC94107aa10a08C3CE3aEcc8E19217B;
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_1");
address OWNER = 0x6E714c42438EC860bD3a50cbe104d2dab50193b3;
// address OWNER = 0x1246E96b7BC94107aa10a08C3CE3aEcc8E19217B;
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
// first deploy the config
int128 protocolFee = 50_000;
Expand Down Expand Up @@ -130,9 +130,9 @@ contract ContractScript is Script {
}

// function run() external {
// // uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_1");
// // vm.startBroadcast(deployerPrivateKey);
// // Zap zap = new Zap(address(0x8955300082645728E2C2e5C75d8ceb82e51aDf56));
// // vm.stopBroadcast();
// uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_1");
// vm.startBroadcast(deployerPrivateKey);
// Zap zap = new Zap(address(0x1dD11E6607D8C7aAab3d61ae1d8Da7B82aCa1ae9));
// vm.stopBroadcast();
// }
}

0 comments on commit b24d93d

Please sign in to comment.