69 lines
2.9 KiB
Solidity
69 lines
2.9 KiB
Solidity
|
|
// SPDX-License-Identifier: MIT
|
||
|
|
pragma solidity ^0.8.19;
|
||
|
|
|
||
|
|
import {Script, console} from "forge-std/Script.sol";
|
||
|
|
import {DODOPMMIntegration} from "../../contracts/dex/DODOPMMIntegration.sol";
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @title DeployDODOPMMIntegration
|
||
|
|
* @notice Deploy DODO PMM Integration contract for liquidity pools
|
||
|
|
* @dev This contract should be deployed on the same chain as compliant tokens (Chain 138)
|
||
|
|
* and on chains where official USDT/USDC exist for pool creation
|
||
|
|
*/
|
||
|
|
contract DeployDODOPMMIntegration is Script {
|
||
|
|
function run() external {
|
||
|
|
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
|
||
|
|
address deployer = vm.addr(deployerPrivateKey);
|
||
|
|
|
||
|
|
// Load environment variables
|
||
|
|
address admin = vm.envOr("DODO_INTEGRATION_ADMIN", deployer);
|
||
|
|
|
||
|
|
// DODO contracts (check DODO documentation for actual addresses per chain)
|
||
|
|
address dodoVendingMachine = vm.envAddress("DODO_VENDING_MACHINE_ADDRESS");
|
||
|
|
address dodoApprove = vm.envOr("DODO_APPROVE_ADDRESS", address(0)); // Optional
|
||
|
|
|
||
|
|
// Official token addresses
|
||
|
|
address officialUSDT = vm.envOr("OFFICIAL_USDT_ADDRESS", address(0));
|
||
|
|
address officialUSDC = vm.envOr("OFFICIAL_USDC_ADDRESS", address(0));
|
||
|
|
|
||
|
|
// Compliant token addresses
|
||
|
|
address compliantUSDT = vm.envAddress("COMPLIANT_USDT_ADDRESS");
|
||
|
|
address compliantUSDC = vm.envAddress("COMPLIANT_USDC_ADDRESS");
|
||
|
|
|
||
|
|
console.log("Deploying DODOPMMIntegration with deployer:", vm.toString(deployer));
|
||
|
|
console.log("Admin:", vm.toString(admin));
|
||
|
|
console.log("DODO Vending Machine:", vm.toString(dodoVendingMachine));
|
||
|
|
console.log("DODO Approve:", vm.toString(dodoApprove));
|
||
|
|
console.log("Official USDT:", vm.toString(officialUSDT));
|
||
|
|
console.log("Official USDC:", vm.toString(officialUSDC));
|
||
|
|
console.log("Compliant USDT:", vm.toString(compliantUSDT));
|
||
|
|
console.log("Compliant USDC:", vm.toString(compliantUSDC));
|
||
|
|
|
||
|
|
vm.startBroadcast(deployerPrivateKey);
|
||
|
|
|
||
|
|
DODOPMMIntegration integration = new DODOPMMIntegration(
|
||
|
|
admin,
|
||
|
|
dodoVendingMachine,
|
||
|
|
dodoApprove,
|
||
|
|
officialUSDT,
|
||
|
|
officialUSDC,
|
||
|
|
compliantUSDT,
|
||
|
|
compliantUSDC
|
||
|
|
);
|
||
|
|
|
||
|
|
console.log("DODOPMMIntegration deployed at:", vm.toString(address(integration)));
|
||
|
|
|
||
|
|
vm.stopBroadcast();
|
||
|
|
|
||
|
|
console.log("\n=== Deployment Summary ===");
|
||
|
|
console.log("DODOPMMIntegration:", vm.toString(address(integration)));
|
||
|
|
console.log("Admin:", vm.toString(admin));
|
||
|
|
console.log("DODO Vending Machine:", vm.toString(dodoVendingMachine));
|
||
|
|
console.log("\nNext Steps:");
|
||
|
|
console.log("1. Create pools using createCUSDTUSDTPool() and createCUSDCUSDCPool()");
|
||
|
|
console.log("2. Add initial liquidity to pools");
|
||
|
|
console.log("3. Configure pool parameters (lpFeeRate, k, initialPrice)");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|