chore: update deployment-status and validate-deployment-status

Made-with: Cursor
This commit is contained in:
defiQUG
2026-04-21 22:00:54 -07:00
parent 5aa162e6b3
commit 68647ff4d4
2 changed files with 443 additions and 120 deletions

View File

@@ -24,6 +24,7 @@ const PHASE1_CW = ['cWUSDT', 'cWUSDC'];
const VALID_ROLES = ['defense', 'public_routing', 'truu_routing'];
const VALID_REFERENCE_PROTOCOLS = ['uniswap_v3', 'balancer', 'curve', '1inch'];
const VALID_NATIVE_REFERENCE_PROTOCOLS = ['uniswap_v3', 'balancer', 'curve'];
const HOME_CHAIN_CANONICAL_PREFIXES = ['c'];
function looksPlaceholderAddress(address) {
if (!address || typeof address !== 'string') return false;
@@ -105,6 +106,7 @@ function validateUniswapV2Entries(chainId, pools, knownTokens, errors) {
function main() {
const status = loadJson(DEPLOYMENT_STATUS_PATH);
const chains = status.chains || {};
const homeChainId = String(status.homeChainId || '');
const errors = [];
for (const [chainId, chain] of Object.entries(chains)) {
@@ -119,7 +121,10 @@ function main() {
const gasReferenceVenues = chain.gasReferenceVenues || [];
const bridgeAvailable = chain.bridgeAvailable;
if (bridgeAvailable === true) {
const isHomeChain = chainId === homeChainId;
const skipPhase1Requirement = isHomeChain || chainId === '651940';
if (bridgeAvailable === true && !skipPhase1Requirement) {
for (const sym of PHASE1_CW) {
if (!cwTokens[sym] || typeof cwTokens[sym] !== 'string' || !cwTokens[sym].trim()) {
errors.push(`Chain ${chainId} (${chain.name}): bridgeAvailable=true but cwTokens.${sym} missing or empty`);
@@ -134,6 +139,19 @@ function main() {
...Object.keys(gasQuoteAddresses),
]);
if (isHomeChain) {
for (const pool of [...pmmPools, ...pmmPoolsVolatile]) {
const base = pool.base ?? pool.tokenIn;
const quote = pool.quote ?? pool.tokenOut;
if (typeof base === 'string' && HOME_CHAIN_CANONICAL_PREFIXES.some((prefix) => base.startsWith(prefix))) {
knownTokens.add(base);
}
if (typeof quote === 'string' && HOME_CHAIN_CANONICAL_PREFIXES.some((prefix) => quote.startsWith(prefix))) {
knownTokens.add(quote);
}
}
}
validatePoolEntries(chainId, pmmPools, 'pmmPools', knownTokens, errors);
validateUniswapV2Entries(chainId, uniswapV2Pools, knownTokens, errors);
validatePoolEntries(chainId, pmmPoolsVolatile, 'pmmPoolsVolatile', knownTokens, errors);