Skip to content

Commit

Permalink
deployed.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmckelvy1 committed Oct 27, 2023
1 parent c7e65a3 commit d6a2ed9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
1 change: 1 addition & 0 deletions common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 5 additions & 3 deletions scripts/addresses/base-3.0.1/8453-tmp-assets-collateral.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"assets": {
"COMP": "0x277FD5f51fE53a9B3707a0383bF930B149C74ABf"
"COMP": "0x277FD5f51fE53a9B3707a0383bF930B149C74ABf",
"STG": "0xf37adF141BD754e9C9E645de88bB28B5e4a6Db96"
},
"collateral": {
"DAI": "0x5EBE8927e5495e0A7731888C81AF463cD63602fb",
Expand All @@ -17,6 +18,7 @@
"USDbC": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
"cbETH": "0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22",
"cUSDbCv3": "0xbC0033679AEf41Fb9FeB553Fdf55a8Bb2fC5B29e",
"aBasUSDbC": "0x308447562442Cc43978f8274fA722C9C14BafF8b"
"aBasUSDbC": "0x308447562442Cc43978f8274fA722C9C14BafF8b",
"STG": "0xE3B53AF74a4BF62Ae5511055290838050bf764Df"
}
}
}
66 changes: 66 additions & 0 deletions scripts/deployment/phase2-assets/assets/deploy_stg.ts
Original file line number Diff line number Diff line change
@@ -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 = <IAssetCollDeployments>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 (<Asset>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
})

0 comments on commit d6a2ed9

Please sign in to comment.