Files
smom-dbis-138/script/deploy/rwa/RegisterRWAIndicesInUAR138.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

69 lines
3.0 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "forge-std/Script.sol";
import {RWATokenRegistry} from "../../../contracts/rwa/RWATokenRegistry.sol";
import {UniversalAssetRegistry} from "../../../contracts/registry/UniversalAssetRegistry.sol";
import {IRWAToken} from "../../../contracts/rwa/IRWAToken.sol";
/**
* @title RegisterRWAIndicesInUAR138
* @notice Register deployed Li* tokens in UniversalAssetRegistry (run after factory deploy + REGISTRAR_ROLE grant).
* @dev Requires RWA_TOKEN_REGISTRY and UNIVERSAL_ASSET_REGISTRY. Broadcaster must hold UAR REGISTRAR_ROLE
* or factory must have been granted REGISTRAR_ROLE and this script calls via factory (not implemented — direct UAR calls).
*
* Env: PRIVATE_KEY, RWA_TOKEN_REGISTRY, UNIVERSAL_ASSET_REGISTRY
* Optional: LI_TICKERS=LiXAU,LiPMG,LiBMG1,LiBMG2,LiBMG3 (default all five)
*/
contract RegisterRWAIndicesInUAR138 is Script {
function run() external {
uint256 pk = vm.envUint("PRIVATE_KEY");
address registryAddr = vm.envAddress("RWA_TOKEN_REGISTRY");
address uarAddr = vm.envAddress("UNIVERSAL_ASSET_REGISTRY");
RWATokenRegistry registry = RWATokenRegistry(registryAddr);
UniversalAssetRegistry uar = UniversalAssetRegistry(uarAddr);
vm.startBroadcast(pk);
string memory tickersEnv = vm.envOr("LI_TICKERS", string(""));
if (bytes(tickersEnv).length > 0) {
string[] memory parts = vm.split(tickersEnv, ",");
for (uint256 i = 0; i < parts.length; i++) {
_registerOne(registry, uar, parts[i]);
}
} else {
_registerOne(registry, uar, "LiXAU");
_registerOne(registry, uar, "LiPMG");
_registerOne(registry, uar, "LiBMG1");
_registerOne(registry, uar, "LiBMG2");
_registerOne(registry, uar, "LiBMG3");
}
vm.stopBroadcast();
}
function _registerOne(RWATokenRegistry registry, UniversalAssetRegistry uar, string memory ticker) internal {
address token = registry.getToken(ticker);
require(token != address(0), "token missing");
IRWAToken rwa = IRWAToken(token);
uar.registerRWAIndexAsset(
token,
_nameFor(ticker),
ticker,
6,
"International"
);
console.log("UAR registered", ticker, token);
}
function _nameFor(string memory ticker) internal pure returns (string memory) {
if (keccak256(bytes(ticker)) == keccak256("LiXAU")) return "XAU Liquidity Index (M00)";
if (keccak256(bytes(ticker)) == keccak256("LiPMG")) return "Precious Metals Group Index (M00)";
if (keccak256(bytes(ticker)) == keccak256("LiBMG1")) return "Base Metals Group Index 1 (M00)";
if (keccak256(bytes(ticker)) == keccak256("LiBMG2")) return "Base Metals Group Index 2 (M00)";
if (keccak256(bytes(ticker)) == keccak256("LiBMG3")) return "Base Metals Group Index 3 (M00)";
return ticker;
}
}