Add mainnet cW market registry and align ops scripts with Stack A.
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m18s
CI/CD Pipeline / Security Scanning (push) Successful in 2m27s
CI/CD Pipeline / Lint and Format (push) Failing after 46s
CI/CD Pipeline / Terraform Validation (push) Failing after 28s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 29s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 1m0s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 30s
Validation / validate-terraform (push) Failing after 32s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 13s
Validation / validate-security (push) Failing after 1m23s
Validation / validate-documentation (push) Failing after 22s
Verify Deployment / Verify Deployment (push) Failing after 11m53s
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m18s
CI/CD Pipeline / Security Scanning (push) Successful in 2m27s
CI/CD Pipeline / Lint and Format (push) Failing after 46s
CI/CD Pipeline / Terraform Validation (push) Failing after 28s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 29s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 1m0s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 30s
Validation / validate-terraform (push) Failing after 32s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 13s
Validation / validate-security (push) Failing after 1m23s
Validation / validate-documentation (push) Failing after 22s
Verify Deployment / Verify Deployment (push) Failing after 11m53s
- CWTokenMarketRegistry + USD feeds for mainnet cW* market anchors - HYBX cross-chain treasury line registry expansion - PMM seed default → live DODOPMMIntegration (0x86ADA6Ef…) - mint-xau-chain138: troy-ounce mint helper with multisig path - relay: prefer CCIP_MAINNET_LINK138 relayer key on default profile Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
59
script/mainnet-market/DeployCWTokenMarketRegistry.s.sol
Normal file
59
script/mainnet-market/DeployCWTokenMarketRegistry.s.sol
Normal file
@@ -0,0 +1,59 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console2} from "forge-std/Script.sol";
|
||||
import {CWTokenMarketRegistry} from "../../contracts/mainnet-market/CWTokenMarketRegistry.sol";
|
||||
import {CWTokenUsdFeed} from "../../contracts/mainnet-market/CWTokenUsdFeed.sol";
|
||||
|
||||
contract DeployCWTokenMarketRegistry is Script {
|
||||
struct TokenSeed {
|
||||
address token;
|
||||
uint8 decimals;
|
||||
uint64 faceUsdE8;
|
||||
address uniV3Pool;
|
||||
bool cwIsToken0;
|
||||
string feedDescription;
|
||||
}
|
||||
|
||||
function run() external {
|
||||
vm.startBroadcast();
|
||||
address admin = msg.sender;
|
||||
|
||||
CWTokenMarketRegistry registry = new CWTokenMarketRegistry(admin);
|
||||
|
||||
TokenSeed[] memory seeds = _seeds();
|
||||
for (uint256 i = 0; i < seeds.length; i++) {
|
||||
TokenSeed memory s = seeds[i];
|
||||
CWTokenUsdFeed feed = new CWTokenUsdFeed(registry, s.token, s.feedDescription);
|
||||
registry.registerToken(
|
||||
s.token, s.decimals, s.faceUsdE8, s.uniV3Pool, s.cwIsToken0, address(feed)
|
||||
);
|
||||
console2.log("Registered", s.token);
|
||||
console2.log(" feed", address(feed));
|
||||
}
|
||||
|
||||
vm.stopBroadcast();
|
||||
console2.log("CWTokenMarketRegistry", address(registry));
|
||||
}
|
||||
|
||||
function _seeds() internal pure returns (TokenSeed[] memory) {
|
||||
TokenSeed[] memory seeds = new TokenSeed[](2);
|
||||
seeds[0] = TokenSeed({
|
||||
token: 0x2de5F116bFcE3d0f922d9C8351e0c5Fc24b9284a,
|
||||
decimals: 6,
|
||||
faceUsdE8: 100_000_000,
|
||||
uniV3Pool: 0x1Cf2e685682C7F7beF508F0Af15Dfb5CDda01ee3,
|
||||
cwIsToken0: true,
|
||||
feedDescription: "cWUSDC / USD (GRU market anchor)"
|
||||
});
|
||||
seeds[1] = TokenSeed({
|
||||
token: 0xaF5017d0163ecb99D9B5D94e3b4D7b09Af44D8AE,
|
||||
decimals: 6,
|
||||
faceUsdE8: 100_000_000,
|
||||
uniV3Pool: 0x6eF5A392BcbE42F3D0a855595bEa60CFf9451784,
|
||||
cwIsToken0: true,
|
||||
feedDescription: "cWUSDT / USD (GRU market anchor)"
|
||||
});
|
||||
return seeds;
|
||||
}
|
||||
}
|
||||
60
script/mainnet-market/RegisterAdditionalCWMarketTokens.s.sol
Normal file
60
script/mainnet-market/RegisterAdditionalCWMarketTokens.s.sol
Normal file
@@ -0,0 +1,60 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console2} from "forge-std/Script.sol";
|
||||
import {CWTokenMarketRegistry} from "../../contracts/mainnet-market/CWTokenMarketRegistry.sol";
|
||||
import {CWTokenUsdFeed} from "../../contracts/mainnet-market/CWTokenUsdFeed.sol";
|
||||
|
||||
/// @notice Register remaining mainnet CompliantWrappedToken assets on deployed registry.
|
||||
contract RegisterAdditionalCWMarketTokens is Script {
|
||||
struct Seed {
|
||||
address token;
|
||||
uint8 decimals;
|
||||
uint64 faceUsdE8;
|
||||
address uniV3Pool;
|
||||
bool cwIsToken0;
|
||||
string symbol;
|
||||
}
|
||||
|
||||
function run() external {
|
||||
address registryAddr = vm.envAddress("CW_MARKET_REGISTRY_MAINNET");
|
||||
CWTokenMarketRegistry registry = CWTokenMarketRegistry(registryAddr);
|
||||
|
||||
Seed[] memory seeds = _seeds();
|
||||
vm.startBroadcast();
|
||||
for (uint256 i = 0; i < seeds.length; i++) {
|
||||
Seed memory s = seeds[i];
|
||||
if (registry.tokenFeed(s.token) != address(0)) {
|
||||
console2.log("skip already registered", s.symbol, s.token);
|
||||
continue;
|
||||
}
|
||||
CWTokenUsdFeed feed = new CWTokenUsdFeed(
|
||||
registry, s.token, string.concat(s.symbol, " / USD (GRU market anchor)")
|
||||
);
|
||||
registry.registerToken(
|
||||
s.token, s.decimals, s.faceUsdE8, s.uniV3Pool, s.cwIsToken0, address(feed)
|
||||
);
|
||||
console2.log("Registered", s.symbol, s.token);
|
||||
console2.log(" feed", address(feed));
|
||||
}
|
||||
vm.stopBroadcast();
|
||||
console2.log("CWTokenMarketRegistry", registryAddr);
|
||||
}
|
||||
|
||||
function _seeds() internal pure returns (Seed[] memory) {
|
||||
// face $1.00 e8 for ISO fiat stables; pool=0 when no live UniV3 peg pool (DODO/UniV2 only)
|
||||
Seed[] memory seeds = new Seed[](10);
|
||||
seeds[0] = Seed(0xD4aEAa8cD3fB41Dc8437FaC7639B6d91B60A5e8d, 6, 100_000_000, address(0), true, "cWEURC");
|
||||
seeds[1] = Seed(0x855d74FFB6CF75721a9bAbc8B2ed35c8119241dC, 6, 100_000_000, address(0), true, "cWEURT");
|
||||
seeds[2] = Seed(0xc074007dc0Bfb384B1cf6426a56287Ed23FE4D52, 6, 100_000_000, address(0), true, "cWGBPC");
|
||||
seeds[3] = Seed(0x1dDF9970F01c76A692Fdba2706203E6f16e0C46F, 6, 100_000_000, address(0), true, "cWGBPT");
|
||||
seeds[4] = Seed(0x5020Db641B3Fc0dAbBc0c688C845bc4E3699f35F, 6, 100_000_000, address(0), true, "cWAUDC");
|
||||
seeds[5] = Seed(0x07EEd0D7dD40984e47B9D3a3bdded1c536435582, 6, 100_000_000, address(0), true, "cWJPYC");
|
||||
seeds[6] = Seed(0x0F91C5E6Ddd46403746aAC970D05d70FFe404780, 6, 100_000_000, address(0), true, "cWCHFC");
|
||||
seeds[7] = Seed(0x209FE32fe7B541751D190ae4e50cd005DcF8EDb4, 6, 100_000_000, address(0), true, "cWCADC");
|
||||
seeds[8] = Seed(0x572Be0fa8CA0534d642A567CEDb398B771D8a715, 6, 3_300_000_000_00, address(0), true, "cWXAUC");
|
||||
seeds[9] = Seed(0xACE1DBF857549a11aF1322e1f91F2F64b029c906, 6, 3_300_000_000_00, address(0), true, "cWXAUT");
|
||||
// cWBTC: register separately with live BTC/USD face (volatile)
|
||||
return seeds;
|
||||
}
|
||||
}
|
||||
41
script/mainnet-market/RegisterCWBTMarketToken.s.sol
Normal file
41
script/mainnet-market/RegisterCWBTMarketToken.s.sol
Normal file
@@ -0,0 +1,41 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console2} from "forge-std/Script.sol";
|
||||
import {CWTokenMarketRegistry} from "../../contracts/mainnet-market/CWTokenMarketRegistry.sol";
|
||||
import {CWTokenUsdFeed} from "../../contracts/mainnet-market/CWTokenUsdFeed.sol";
|
||||
import {IAggregatorV3} from "../../contracts/mainnet-market/interfaces/IAggregatorV3.sol";
|
||||
|
||||
/// @notice Register mainnet cWBTC with live Chainlink BTC/USD face (8 decimals).
|
||||
contract RegisterCWBTMarketToken is Script {
|
||||
address internal constant CWBTC = 0x2BBe3c809386FA5349EB2da31E0848ee9f54EE59;
|
||||
address internal constant CHAINLINK_BTC_USD = 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c;
|
||||
|
||||
function run() external {
|
||||
address registryAddr = vm.envAddress("CW_MARKET_REGISTRY_MAINNET");
|
||||
CWTokenMarketRegistry registry = CWTokenMarketRegistry(registryAddr);
|
||||
|
||||
if (registry.tokenFeed(CWBTC) != address(0)) {
|
||||
console2.log("skip already registered cWBTC", CWBTC);
|
||||
console2.log(" feed", registry.tokenFeed(CWBTC));
|
||||
return;
|
||||
}
|
||||
|
||||
(, int256 answer,, uint256 updatedAt,) = IAggregatorV3(CHAINLINK_BTC_USD).latestRoundData();
|
||||
require(answer > 0, "chainlink btc/usd stale");
|
||||
require(updatedAt > 0, "chainlink btc/usd no timestamp");
|
||||
uint64 faceUsdE8 = uint64(uint256(answer));
|
||||
require(faceUsdE8 > 0, "zero btc usd");
|
||||
|
||||
console2.log("Chainlink BTC/USD faceUsdE8", faceUsdE8);
|
||||
|
||||
vm.startBroadcast();
|
||||
CWTokenUsdFeed feed = new CWTokenUsdFeed(registry, CWBTC, "cWBTC / USD (GRU market anchor)");
|
||||
registry.registerToken(CWBTC, 8, faceUsdE8, address(0), true, address(feed));
|
||||
vm.stopBroadcast();
|
||||
|
||||
console2.log("Registered cWBTC", CWBTC);
|
||||
console2.log(" feed", address(feed));
|
||||
console2.log("CWTokenMarketRegistry", registryAddr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user