diff --git a/scripts/verification/collateral-plugins/verify_cusdbcv3.ts b/scripts/verification/collateral-plugins/verify_cusdbcv3.ts index 497b3e5be..788d7c54f 100644 --- a/scripts/verification/collateral-plugins/verify_cusdbcv3.ts +++ b/scripts/verification/collateral-plugins/verify_cusdbcv3.ts @@ -44,8 +44,10 @@ async function main() { networkConfig[chainId].tokens.cUSDbCv3, networkConfig[chainId].COMET_REWARDS, networkConfig[chainId].tokens.COMP, + 'Wrapped cUSDCv3', + 'wcUSDCv3', ], - 'contracts/plugins/assets/compoundv3/CusdcV3Wrapper.sol:CusdcV3Wrapper' + 'contracts/plugins/assets/compoundv3/CFiatV3Wrapper.sol:CFiatV3Wrapper' ) /******** Verify Collateral - wcUSDbCv3 **************************/ diff --git a/scripts/verification/collateral-plugins/verify_cusdcv3.ts b/scripts/verification/collateral-plugins/verify_cusdcv3.ts index ac5dda113..7f058d39f 100644 --- a/scripts/verification/collateral-plugins/verify_cusdcv3.ts +++ b/scripts/verification/collateral-plugins/verify_cusdcv3.ts @@ -44,8 +44,10 @@ async function main() { networkConfig[chainId].tokens.cUSDCv3, networkConfig[chainId].COMET_REWARDS, networkConfig[chainId].tokens.COMP, + 'Wrapped cUSDCv3', + 'wcUSDCv3', ], - 'contracts/plugins/assets/compoundv3/CusdcV3Wrapper.sol:CusdcV3Wrapper' + 'contracts/plugins/assets/compoundv3/CFiatV3Wrapper.sol:CFiatV3Wrapper' ) /******** Verify Collateral - wcUSDCv3 **************************/ diff --git a/scripts/verification/collateral-plugins/verify_cusdtv3.ts b/scripts/verification/collateral-plugins/verify_cusdtv3.ts new file mode 100644 index 000000000..3d2f14a28 --- /dev/null +++ b/scripts/verification/collateral-plugins/verify_cusdtv3.ts @@ -0,0 +1,87 @@ +import hre, { ethers } from 'hardhat' +import { getChainId } from '../../../common/blockchain-utils' +import { baseL2Chains, developmentChains, networkConfig } from '../../../common/configuration' +import { fp, bn } from '../../../common/numbers' +import { + getDeploymentFile, + getAssetCollDeploymentFilename, + IAssetCollDeployments, +} from '../../deployment/common' +import { + getUsdtOracleError, + priceTimeout, + verifyContract, + revenueHiding, +} from '../../deployment/utils' + +let deployments: IAssetCollDeployments + +async function main() { + // ********** Read config ********** + const chainId = await getChainId(hre) + if (!networkConfig[chainId]) { + throw new Error(`Missing network configuration for ${hre.network.name}`) + } + + if (developmentChains.includes(hre.network.name)) { + throw new Error(`Cannot verify contracts for development chain ${hre.network.name}`) + } + + // Does not exist on Base L2 + if (baseL2Chains.includes(hre.network.name)) { + throw new Error(`Invalid network ${hre.network.name} - Not available on Base`) + } + + const assetCollDeploymentFilename = getAssetCollDeploymentFilename(chainId) + deployments = getDeploymentFile(assetCollDeploymentFilename) + + const collateral = await ethers.getContractAt( + 'CTokenV3Collateral', + deployments.collateral.cUSDTv3 as string + ) + + /******** Verify Wrapper token - wcUSDTv3 **************************/ + + await verifyContract( + chainId, + await collateral.erc20(), + [ + networkConfig[chainId].tokens.cUSDTv3, + networkConfig[chainId].COMET_REWARDS, + networkConfig[chainId].tokens.COMP, + 'Wrapped cUSDTv3', + 'wcUSDTv3', + ], + 'contracts/plugins/assets/compoundv3/CFiatV3Wrapper.sol:CFiatV3Wrapper' + ) + + /******** Verify Collateral - wcUSDTv3 **************************/ + + const usdtOracleTimeout = '86400' // 24 hr + const usdtOracleError = getUsdtOracleError(hre.network.name) + + await verifyContract( + chainId, + deployments.collateral.cUSDTv3, + [ + { + priceTimeout: priceTimeout.toString(), + chainlinkFeed: networkConfig[chainId].chainlinkFeeds.USDT, + oracleError: usdtOracleError.toString(), + erc20: await collateral.erc20(), + maxTradeVolume: fp('1e6').toString(), // $1m, + oracleTimeout: usdtOracleTimeout, // 24h hr, + targetName: hre.ethers.utils.formatBytes32String('USD'), + defaultThreshold: fp('0.01').add(usdtOracleError).toString(), + delayUntilDefault: bn('86400').toString(), // 24h + }, + revenueHiding, + ], + 'contracts/plugins/assets/compoundv3/CTokenV3Collateral.sol:CTokenV3Collateral' + ) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/scripts/verify_etherscan.ts b/scripts/verify_etherscan.ts index 55023fd71..b98df40b1 100644 --- a/scripts/verify_etherscan.ts +++ b/scripts/verify_etherscan.ts @@ -66,6 +66,7 @@ async function main() { 'collateral-plugins/verify_curve_stable_rtoken_metapool.ts', 'collateral-plugins/verify_stakedao_usdc_usdcplus.ts', 'collateral-plugins/verify_cusdcv3.ts', + 'collateral-plugins/verify_cusdtv3.ts', 'collateral-plugins/verify_reth.ts', 'collateral-plugins/verify_wsteth.ts', 'collateral-plugins/verify_cbeth.ts', @@ -95,6 +96,7 @@ async function main() { scripts.push( 'collateral-plugins/verify_aave_v3_usdc.ts', 'collateral-plugins/verify_cusdcv3.ts', + 'collateral-plugins/verify_cusdtv3.ts', 'collateral-plugins/verify_convex_crvusd_usdc.ts', 'collateral-plugins/verify_convex_crvusd_usdt.ts', 'collateral-plugins/verify_usdm.ts'