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
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>
86 lines
3.3 KiB
Solidity
86 lines
3.3 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {Script, console} from "forge-std/Script.sol";
|
|
import {VaultFactory} from "../../../contracts/vault/VaultFactory.sol";
|
|
|
|
/**
|
|
* @title DeployAcVdcSdcVaultsGRU
|
|
* @notice Create M1 ac/vdc vault pairs with GRU tier + IBAN + policy profile anchors.
|
|
*/
|
|
contract DeployAcVdcSdcVaultsGRU is Script {
|
|
uint8 constant DECIMALS = 6;
|
|
bool constant DEBT_TRANSFERABLE = true;
|
|
uint8 constant GRU_TIER_M1 = 2;
|
|
|
|
struct TokenSpec {
|
|
string envPrimary;
|
|
string envAlt;
|
|
string label;
|
|
}
|
|
|
|
TokenSpec[] internal tokens;
|
|
|
|
function _initTokens() internal {
|
|
tokens.push(TokenSpec("CUSDC_ADDRESS_138", "COMPLIANT_USDC_ADDRESS", "USDC"));
|
|
tokens.push(TokenSpec("CUSDT_ADDRESS_138", "COMPLIANT_USDT_ADDRESS", "USDT"));
|
|
tokens.push(TokenSpec("cEURC_ADDRESS_138", "", "EURC"));
|
|
tokens.push(TokenSpec("cEURT_ADDRESS_138", "", "EURT"));
|
|
tokens.push(TokenSpec("cGBPC_ADDRESS_138", "", "GBPC"));
|
|
tokens.push(TokenSpec("cGBPT_ADDRESS_138", "", "GBPT"));
|
|
tokens.push(TokenSpec("cAUDC_ADDRESS_138", "", "AUDC"));
|
|
tokens.push(TokenSpec("cJPYC_ADDRESS_138", "", "JPYC"));
|
|
tokens.push(TokenSpec("cCHFC_ADDRESS_138", "", "CHFC"));
|
|
tokens.push(TokenSpec("cCADC_ADDRESS_138", "", "CADC"));
|
|
tokens.push(TokenSpec("cXAUC_ADDRESS_138", "", "XAUC"));
|
|
tokens.push(TokenSpec("cXAUT_ADDRESS_138", "", "XAUT"));
|
|
}
|
|
|
|
function run() external {
|
|
_initTokens();
|
|
uint256 pk = vm.envUint("PRIVATE_KEY");
|
|
address deployer = vm.addr(pk);
|
|
address owner = vm.envOr("OWNER", deployer);
|
|
address entity = vm.envOr("ENTITY", vm.envOr("GRU_OMNL_ENTITY_ADDRESS", deployer));
|
|
|
|
address factoryAddr = vm.envAddress("VAULT_FACTORY_ADDRESS");
|
|
VaultFactory factory = VaultFactory(factoryAddr);
|
|
|
|
bytes32 ibanHash = vm.envBytes32("GRU_IBAN_HASH");
|
|
bytes32 policyProfileKey = vm.envOr("GRU_POLICY_PROFILE_KEY", bytes32(0));
|
|
uint256 startIdx = vm.envOr("GRU_VAULT_START_INDEX", uint256(0));
|
|
uint256 endIdx = vm.envOr("GRU_VAULT_END_INDEX", tokens.length);
|
|
|
|
vm.startBroadcast(pk);
|
|
|
|
for (uint256 i = startIdx; i < endIdx && i < tokens.length; i++) {
|
|
address base = _getToken(tokens[i].envPrimary, tokens[i].envAlt);
|
|
if (base == address(0)) continue;
|
|
(address vault, address depositToken, address debtToken) = factory.createVaultWithDecimalsGRU(
|
|
owner,
|
|
entity,
|
|
base,
|
|
base,
|
|
DECIMALS,
|
|
DECIMALS,
|
|
DEBT_TRANSFERABLE,
|
|
GRU_TIER_M1,
|
|
ibanHash,
|
|
policyProfileKey
|
|
);
|
|
console.log(string.concat(tokens[i].label, " vault:"), vault);
|
|
console.log(string.concat("ac", tokens[i].label, ":"), depositToken);
|
|
console.log(string.concat("vdc", tokens[i].label, ":"), debtToken);
|
|
}
|
|
|
|
vm.stopBroadcast();
|
|
}
|
|
|
|
function _getToken(string memory primary, string memory altKey) internal view returns (address) {
|
|
address a = vm.envOr(primary, address(0));
|
|
if (a != address(0)) return a;
|
|
if (bytes(altKey).length == 0) return address(0);
|
|
return vm.envOr(altKey, address(0));
|
|
}
|
|
}
|