Skip to content

Commit

Permalink
Merge pull request #1 from 0xJomo/onramp
Browse files Browse the repository at this point in the history
sepolia deployment
  • Loading branch information
maceip authored Feb 12, 2024
2 parents 41b7a91 + ef7f209 commit b6bcad3
Show file tree
Hide file tree
Showing 35 changed files with 5,497 additions and 1,437 deletions.
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

0 comments on commit b6bcad3

Please sign in to comment.