Files
smom-dbis-138/script/hybx-omnl/RemediateOmnlM1Cap.s.sol
defiQUG c336809676
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m3s
CI/CD Pipeline / Security Scanning (push) Successful in 2m18s
CI/CD Pipeline / Lint and Format (push) Failing after 34s
CI/CD Pipeline / Terraform Validation (push) Failing after 20s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 22s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 40s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 21s
Validation / validate-genesis (push) Successful in 25s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 8s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m11s
Validation / validate-documentation (push) Failing after 14s
Verify Deployment / Verify Deployment (push) Failing after 45s
Add mainnet checkpoint stack: ISO attestation, participant Etherscan surface, and services.
Ship AddressActivityRegistry V1/V2, ISO20022IntakeGateway, Chain138ParticipantSurface,
checkpoint hub contracts, checkpoint-core package, aggregator/indexer/sdk services,
relay profile guards, M00 diamond bridge facet, and OMNL compliance contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 00:30:45 -07:00

48 lines
1.7 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Script, console2} from "forge-std/Script.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IMintableM0 {
function mint(address to, uint256 amount) external;
function mint(address to, uint256 amount, bytes32 reasonHash) external;
}
/// @notice Mint M0 (cUSDT) so that S1 <= 5 * S0 for the health line (policy cap remediation).
contract RemediateOmnlM1Cap is Script {
function run() external {
uint256 pk = vm.envUint("PRIVATE_KEY");
address tokenM0 = vm.envAddress("OMNL_TOKEN_M0");
address tokenM1 = vm.envAddress("OMNL_TOKEN_M1");
address mintTo = vm.envOr("OMNL_M1_REMEDIATION_MINT_TO", vm.addr(pk));
uint256 s0 = IERC20(tokenM0).totalSupply();
uint256 s1 = IERC20(tokenM1).totalSupply();
uint256 requiredS0 = (s1 + 4) / 5;
if (s0 >= requiredS0) {
console2.log("No mint required; s0", s0, "requiredS0", requiredS0);
return;
}
uint256 delta = requiredS0 - s0;
bytes32 reason = keccak256("OMNL-M1-CAP-REMEDIATION");
vm.startBroadcast(pk);
IMintableM0 m0 = IMintableM0(tokenM0);
try m0.mint(mintTo, delta, reason) {
} catch {
m0.mint(mintTo, delta);
}
vm.stopBroadcast();
uint256 s0After = IERC20(tokenM0).totalSupply();
uint256 s1After = IERC20(tokenM1).totalSupply();
bool m1OkAfter = s1After <= s0After * 5;
console2.log("Minted delta", delta, "to", mintTo);
console2.log("s0After", s0After);
console2.log("s1After", s1After);
console2.log("m1OkAfter", m1OkAfter);
}
}