Files
smom-dbis-138/script/dex/CreateCUSDCUSDCPool.s.sol
2026-03-02 12:14:09 -08:00

44 lines
1.5 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 CreateCUSDCUSDCPool
* @notice Call createCUSDCUSDCPool on existing DODOPMMIntegration (Chain 138).
* @dev Requires caller to have POOL_MANAGER_ROLE. Run with --broadcast.
*/
contract CreateCUSDCUSDCPool is Script {
uint256 constant LP_FEE_BPS = 3;
uint256 constant INITIAL_PRICE_1E18 = 1e18;
uint256 constant K_50PCT = 0.5e18;
bool constant USE_TWAP = true;
function run() external {
uint256 pk = vm.envUint("PRIVATE_KEY");
address integrationAddr = vm.envAddress("DODO_PMM_INTEGRATION");
if (integrationAddr == address(0)) {
integrationAddr = vm.envAddress("DODO_PMM_INTEGRATION_ADDRESS");
}
require(integrationAddr != address(0), "DODO_PMM_INTEGRATION not set");
address deployer = vm.addr(pk);
uint64 nextNonce = uint64(vm.envOr("NEXT_NONCE", uint256(0)));
if (nextNonce > 0) {
vm.setNonce(deployer, nextNonce);
}
DODOPMMIntegration integration = DODOPMMIntegration(integrationAddr);
vm.startBroadcast(pk);
address pool = integration.createCUSDCUSDCPool(
LP_FEE_BPS,
INITIAL_PRICE_1E18,
K_50PCT,
USE_TWAP
);
console.log("cUSDC/USDC pool created at:", pool);
vm.stopBroadcast();
}
}