diff --git a/common/configuration.ts b/common/configuration.ts index e6e1f846e3..2276396baf 100644 --- a/common/configuration.ts +++ b/common/configuration.ts @@ -543,6 +543,7 @@ export const networkConfig: { [key: string]: INetworkConfig } = { RSR: '0xAa98aE504658766Dfe11F31c5D95a0bdcABDe0b1', // 2%, 24hr wstETHstETHexr: '0xB88BAc61a4Ca37C43a3725912B1f472c9A5bc061', // 0.5%, 24hr cbETHETHexr: '0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04', // 0.5%, 24hr + STG: '0x63Af8341b62E683B87bB540896bF283D96B4D385' }, GNOSIS_EASY_AUCTION: '0xb1875Feaeea32Bbb02DE83D81772e07E37A40f02', // mock COMET_REWARDS: '0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1', diff --git a/scripts/addresses/base-3.0.1/8453-tmp-assets-collateral.json b/scripts/addresses/base-3.0.1/8453-tmp-assets-collateral.json index ec42edd113..3346f1f60f 100644 --- a/scripts/addresses/base-3.0.1/8453-tmp-assets-collateral.json +++ b/scripts/addresses/base-3.0.1/8453-tmp-assets-collateral.json @@ -1,6 +1,7 @@ { "assets": { - "COMP": "0x277FD5f51fE53a9B3707a0383bF930B149C74ABf" + "COMP": "0x277FD5f51fE53a9B3707a0383bF930B149C74ABf", + "STG": "0xf37adF141BD754e9C9E645de88bB28B5e4a6Db96" }, "collateral": { "DAI": "0x5EBE8927e5495e0A7731888C81AF463cD63602fb", @@ -17,6 +18,7 @@ "USDbC": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", "cbETH": "0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22", "cUSDbCv3": "0xbC0033679AEf41Fb9FeB553Fdf55a8Bb2fC5B29e", - "aBasUSDbC": "0x308447562442Cc43978f8274fA722C9C14BafF8b" + "aBasUSDbC": "0x308447562442Cc43978f8274fA722C9C14BafF8b", + "STG": "0xE3B53AF74a4BF62Ae5511055290838050bf764Df" } -} +} \ No newline at end of file diff --git a/scripts/deployment/phase2-assets/assets/deploy_stg.ts b/scripts/deployment/phase2-assets/assets/deploy_stg.ts new file mode 100644 index 0000000000..98c81e2be1 --- /dev/null +++ b/scripts/deployment/phase2-assets/assets/deploy_stg.ts @@ -0,0 +1,66 @@ +import fs from 'fs' +import hre, { ethers } from 'hardhat' +import { getChainId } from '../../../../common/blockchain-utils' +import { networkConfig } from '../../../../common/configuration' +import { fp } from '../../../../common/numbers' +import { + getDeploymentFile, + getDeploymentFilename, + getAssetCollDeploymentFilename, + IAssetCollDeployments, + fileExists, +} from '../../../deployment/common' +import { priceTimeout, oracleTimeout } from '../../../deployment/utils' +import { Asset } from '../../../../typechain' + +async function main() { + // ==== Read Configuration ==== + const [burner] = await hre.ethers.getSigners() + const chainId = await getChainId(hre) + + console.log(`Deploying STG asset to network ${hre.network.name} (${chainId}) + with burner account: ${burner.address}`) + + if (!networkConfig[chainId]) { + throw new Error(`Missing network configuration for ${hre.network.name}`) + } + + // Get phase1 deployment + const phase1File = getDeploymentFilename(chainId) + if (!fileExists(phase1File)) { + throw new Error(`${phase1File} doesn't exist yet. Run phase 1`) + } + // Check previous step completed + const assetCollDeploymentFilename = getAssetCollDeploymentFilename(chainId) + const assetCollDeployments = getDeploymentFile(assetCollDeploymentFilename) + + const deployedAssets: string[] = [] + + /******** Deploy STG asset **************************/ + const { asset: stgAsset } = await hre.run('deploy-asset', { + priceTimeout: priceTimeout.toString(), + priceFeed: networkConfig[chainId].chainlinkFeeds.STG, + oracleError: fp('0.02').toString(), // 2% + tokenAddress: networkConfig[chainId].tokens.STG, + maxTradeVolume: fp('1e6').toString(), // $1m, + oracleTimeout: oracleTimeout(chainId, '86400').toString(), // 24 hr + }) + await (await ethers.getContractAt('Asset', stgAsset)).refresh() + + assetCollDeployments.assets.STG = stgAsset + assetCollDeployments.erc20s.STG = networkConfig[chainId].tokens.STG + deployedAssets.push(stgAsset.toString()) + + /**************************************************************/ + + fs.writeFileSync(assetCollDeploymentFilename, JSON.stringify(assetCollDeployments, null, 2)) + + console.log(`Deployed STG asset to ${hre.network.name} (${chainId}): + New deployments: ${deployedAssets} + Deployment file: ${assetCollDeploymentFilename}`) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +})