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

sepolia deployment #1

Merged
merged 8 commits into from
Feb 12, 2024
Merged
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
14 changes: 7 additions & 7 deletions deploy/001_deploy_simple_erc20.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';
import {parseEther} from 'ethers';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { parseEther } from 'ethers';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts} = hre;
const {deploy} = deployments;
const { deployments, getNamedAccounts } = hre;
const { deploy } = deployments;

const {deployer, simpleERC20Beneficiary} = await getNamedAccounts();
const { deployer, simpleERC20Beneficiary, simpleOffchainVerifier } = await getNamedAccounts();

await deploy('SimpleERC20', {
from: deployer,
args: [simpleERC20Beneficiary, parseEther('1000000000')],
args: [deployer, parseEther('1000000000')],
log: true,
autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks
});
Expand Down
45 changes: 45 additions & 0 deletions deploy/002_deploy_deramp_vault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer, simpleOffchainVerifier } = await hre.getNamedAccounts();
const asset = await (await hre.ethers.getContract('SimpleERC20', deployer)).getAddress();
console.log('vault asset: ', asset);
const { deploy } = hre.deployments;
//const useProxy = !hre.network.live;
const useProxy = true;
const max = ethers.parseEther('1');
const min = ethers.parseEther('.001');
const fee = 0;

// proxy only in non-live network (localhost and hardhat network) enabling HCR (Hot Contract Replacement)
// in live network, proxy is disabled and constructor is invoked
await deploy('DeRampVault', {
from: deployer,
proxy: useProxy && {
owner: simpleOffchainVerifier,
proxyContract: 'UUPS',

execute: {
init: {
methodName: 'initialize',
args: [asset, 'DeRamp Token', 'RAMP', max, min, fee, simpleOffchainVerifier],
},

onUpgrade: {
methodName: 'postUpgrade',
args: [asset, 'DeRamp Token', 'RAMP', max, min, fee, simpleOffchainVerifier],
},
},
},

log: true,
autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks
});

return !useProxy; // when live network, record the script as executed to prevent rexecution
};
export default func;
func.id = 'deploy_deramp_vault'; // id required to prevent reexecution
func.tags = ['DeRampVault'];
23 changes: 0 additions & 23 deletions deploy/002_deploy_greetings_registry.ts

This file was deleted.

1 change: 1 addition & 0 deletions deployments/sepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11155111
Loading
Loading