-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #606 from mysofinance/myt-token-manager
myt token manager
- Loading branch information
Showing
7 changed files
with
200 additions
and
39 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { ethers } from 'hardhat' | ||
import { Logger } from '../../helpers/misc' | ||
|
||
const hre = require('hardhat') | ||
const path = require('path') | ||
const scriptName = path.parse(__filename).name | ||
const logger = new Logger(__dirname, scriptName) | ||
|
||
async function main() { | ||
logger.log(`Starting ${scriptName}...`) | ||
logger.log('Loading signer info (check hardhat.config.ts)...') | ||
|
||
const [deployer] = await ethers.getSigners() | ||
const deployerBal = await ethers.provider.getBalance(deployer.address) | ||
const network = await ethers.getDefaultProvider().getNetwork() | ||
const hardhatNetworkName = hre.network.name | ||
const hardhatChainId = hre.network.config.chainId | ||
|
||
logger.log('Running script with the following deployer:', deployer.address) | ||
logger.log('Deployer ETH balance:', ethers.utils.formatEther(deployerBal.toString())) | ||
logger.log(`Deploying to network '${hardhatNetworkName}' (default provider network name '${network.name}')`) | ||
logger.log(`Configured chain id '${hardhatChainId}' (default provider config chain id '${network.chainId}')`) | ||
const TestnetMysoOracle = await ethers.getContractFactory('TestnetMysoOracle') | ||
const testnetMysoOracleAddr = "0x16B67F0dc94e0fAd995d4dFAB77170d30848c277" | ||
const testnetMysoOracle = await TestnetMysoOracle.attach(testnetMysoOracleAddr) | ||
const mysoTestnetTokenManager = "0xC71dBB6b1a9735F3259F0CF746C1c000BF02615c" | ||
await testnetMysoOracle.connect(deployer).setMysoTokenManager(mysoTestnetTokenManager) | ||
|
||
/* | ||
const maxPrice = "55000000" // 8 decimals | ||
const k = "660000000000000000" // 18 decimals | ||
const a = "1350" // scaled by 1000 | ||
const b = "600" // scaled by 1000 | ||
await testnetMysoOracle.connect(deployer).setMysoPriceParams(maxPrice, k, a, b) | ||
logger.log('testnetMysoOracle deployed at:', testnetMysoOracle.address) | ||
*/ | ||
} | ||
|
||
main().catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ethers } from 'hardhat' | ||
import { Logger } from '../../helpers/misc' | ||
|
||
const hre = require('hardhat') | ||
const path = require('path') | ||
const scriptName = path.parse(__filename).name | ||
const logger = new Logger(__dirname, scriptName) | ||
|
||
async function main() { | ||
logger.log(`Starting ${scriptName}...`) | ||
logger.log('Loading signer info (check hardhat.config.ts)...') | ||
|
||
const [deployer] = await ethers.getSigners() | ||
const deployerBal = await ethers.provider.getBalance(deployer.address) | ||
const network = await ethers.getDefaultProvider().getNetwork() | ||
const hardhatNetworkName = hre.network.name | ||
const hardhatChainId = hre.network.config.chainId | ||
|
||
logger.log('Running script with the following deployer:', deployer.address) | ||
logger.log('Deployer ETH balance:', ethers.utils.formatEther(deployerBal.toString())) | ||
logger.log(`Deploying to network '${hardhatNetworkName}' (default provider network name '${network.name}')`) | ||
logger.log(`Configured chain id '${hardhatChainId}' (default provider config chain id '${network.chainId}')`) | ||
const TestnetMysoOracle = await ethers.getContractFactory('TestnetMysoOracle') | ||
const owner = deployer.address | ||
const mysoTokenManager = ethers.constants.AddressZero | ||
const maxPrice = "55000000" // 8 decimals | ||
const k = "66000000000000000000" // 18 decimals | ||
const a = "1350" // scaled by 1000 | ||
const b = "600" // scaled by 1000 | ||
const testnetMysoOracle = await TestnetMysoOracle.connect(deployer).deploy(owner, mysoTokenManager, maxPrice, k, a, b) | ||
await testnetMysoOracle.deployed() | ||
logger.log('testnetMysoOracle deployed at:', testnetMysoOracle.address) | ||
// npx hardhat verify 0x16B67F0dc94e0fAd995d4dFAB77170d30848c277 "0xcE3d0e78c15C30ecf631ef529581Af3de0478895" "0x0000000000000000000000000000000000000000" "5500000000000000" "66000000000000000000" "1350" "600" --network sepolia | ||
} | ||
|
||
main().catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ethers } from 'hardhat' | ||
import { Logger } from '../../helpers/misc' | ||
|
||
const hre = require('hardhat') | ||
const path = require('path') | ||
const scriptName = path.parse(__filename).name | ||
const logger = new Logger(__dirname, scriptName) | ||
|
||
async function main() { | ||
logger.log(`Starting ${scriptName}...`) | ||
logger.log('Loading signer info (check hardhat.config.ts)...') | ||
|
||
const [deployer] = await ethers.getSigners() | ||
const deployerBal = await ethers.provider.getBalance(deployer.address) | ||
const network = await ethers.getDefaultProvider().getNetwork() | ||
const hardhatNetworkName = hre.network.name | ||
const hardhatChainId = hre.network.config.chainId | ||
|
||
logger.log('Running script with the following deployer:', deployer.address) | ||
logger.log('Deployer ETH balance:', ethers.utils.formatEther(deployerBal.toString())) | ||
logger.log(`Deploying to network '${hardhatNetworkName}' (default provider network name '${network.name}')`) | ||
logger.log(`Configured chain id '${hardhatChainId}' (default provider config chain id '${network.chainId}')`) | ||
const TestnetTokenManager = await ethers.getContractFactory('TestnetTokenManager') | ||
const testnetTokenManager = await TestnetTokenManager.connect(deployer).deploy() | ||
await testnetTokenManager.deployed() | ||
logger.log('testnetTokenManager deployed at:', testnetTokenManager.address) | ||
} | ||
|
||
main().catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |