feat: restore operator WIP — PMM JSON sync entrypoint, dotenv RPC trim + secrets, pool env alignment
- Resolve stash: merge load_deployment_env path with secure-secrets and CR/LF RPC strip - create-pmm-full-mesh-chain138.sh delegates to sync-chain138-pmm-pools-from-json.sh - env.additions.example: canonical PMM pool defaults (cUSDT/USDT per crosscheck) - Include Chain138 scripts, official mirror deploy scaffolding, and prior staged changes Made-with: Cursor
This commit is contained in:
@@ -11,6 +11,24 @@ contract MockERC20 is ERC20 {
|
||||
}
|
||||
}
|
||||
|
||||
contract MockDodoPool {
|
||||
address public immutable baseToken;
|
||||
address public immutable quoteToken;
|
||||
|
||||
constructor(address baseToken_, address quoteToken_) {
|
||||
baseToken = baseToken_;
|
||||
quoteToken = quoteToken_;
|
||||
}
|
||||
|
||||
function _BASE_TOKEN_() external view returns (address) {
|
||||
return baseToken;
|
||||
}
|
||||
|
||||
function _QUOTE_TOKEN_() external view returns (address) {
|
||||
return quoteToken;
|
||||
}
|
||||
}
|
||||
|
||||
contract DODOPMMIntegrationTest is Test {
|
||||
DODOPMMIntegration public integration;
|
||||
address public dvm = address(0xdEaD);
|
||||
@@ -90,4 +108,66 @@ contract DODOPMMIntegrationTest is Test {
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
function testImportExistingPoolRecordsMappings() public {
|
||||
address baseToken = address(officialUSDT);
|
||||
address quoteToken = address(compliantUSDC);
|
||||
MockDodoPool pool = new MockDodoPool(baseToken, quoteToken);
|
||||
|
||||
vm.prank(admin);
|
||||
integration.importExistingPool(
|
||||
address(pool),
|
||||
baseToken,
|
||||
quoteToken,
|
||||
3,
|
||||
1e18,
|
||||
0.5e18,
|
||||
false
|
||||
);
|
||||
|
||||
assertEq(integration.pools(baseToken, quoteToken), address(pool));
|
||||
assertEq(integration.pools(quoteToken, baseToken), address(pool));
|
||||
assertTrue(integration.isRegisteredPool(address(pool)));
|
||||
|
||||
DODOPMMIntegration.PoolConfig memory config = integration.getPoolConfig(address(pool));
|
||||
assertEq(config.baseToken, baseToken);
|
||||
assertEq(config.quoteToken, quoteToken);
|
||||
}
|
||||
|
||||
function testImportExistingPoolAcceptsReverseHintAndNormalizes() public {
|
||||
address baseToken = address(officialUSDT);
|
||||
address quoteToken = address(compliantUSDC);
|
||||
MockDodoPool pool = new MockDodoPool(baseToken, quoteToken);
|
||||
|
||||
vm.prank(admin);
|
||||
integration.importExistingPool(
|
||||
address(pool),
|
||||
quoteToken,
|
||||
baseToken,
|
||||
3,
|
||||
1e18,
|
||||
0.5e18,
|
||||
false
|
||||
);
|
||||
|
||||
DODOPMMIntegration.PoolConfig memory config = integration.getPoolConfig(address(pool));
|
||||
assertEq(config.baseToken, baseToken);
|
||||
assertEq(config.quoteToken, quoteToken);
|
||||
}
|
||||
|
||||
function testImportExistingPoolRevertsOnMismatch() public {
|
||||
MockDodoPool pool = new MockDodoPool(address(officialUSDT), address(compliantUSDC));
|
||||
|
||||
vm.prank(admin);
|
||||
vm.expectRevert("DODOPMMIntegration: pool token mismatch");
|
||||
integration.importExistingPool(
|
||||
address(pool),
|
||||
address(officialUSDT),
|
||||
address(compliantUSDT),
|
||||
3,
|
||||
1e18,
|
||||
0.5e18,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user