Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transfer old price #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion deploy/main/002_deploy_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { DeployFunction } from 'hardhat-deploy/types';
import { networkConfig } from '../../helper-hardhat-config';

const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) {
const { deploy, get, log } = deployments;
const { deploy, get, read, execute, log } = deployments;
const { deployer } = await getNamedAccounts();

const oldOraclePrice = await read('PriceOracle', 'currentPrice');

const args = [(await get('PostageStamp')).address];
await deploy('PriceOracle', {
from: deployer,
Expand All @@ -13,6 +15,8 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts, ne
waitConfirmations: networkConfig[network.name]?.blockConfirmations || 6,
});

await execute('PriceOracle', { from: deployer }, 'setPrice', oldOraclePrice);

log('----------------------------------------------------');
};

Expand Down
6 changes: 5 additions & 1 deletion deploy/test/002_deploy_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { DeployFunction } from 'hardhat-deploy/types';
import { networkConfig } from '../../helper-hardhat-config';

const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) {
const { deploy, get, log } = deployments;
const { deploy, get, read, execute, log } = deployments;
const { deployer } = await getNamedAccounts();

const oldOraclePrice = await read('PriceOracle', 'currentPrice');

const args = [(await get('PostageStamp')).address];
await deploy('PriceOracle', {
from: deployer,
Expand All @@ -13,6 +15,8 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts, ne
waitConfirmations: networkConfig[network.name]?.blockConfirmations || 6,
});

await execute('PriceOracle', { from: deployer }, 'setPrice', oldOraclePrice);

log('----------------------------------------------------');
};

Expand Down
Loading