From 8dbe7c3e41068b97e2bbc80023abf5914182dbf6 Mon Sep 17 00:00:00 2001 From: rpm Date: Mon, 12 Feb 2024 17:00:53 -0400 Subject: [PATCH] using proxy for sepolia, change onramp script to use ethers.getSigner --- deploy/002_deploy_deramp_vault.ts | 3 ++- scripts/onramp.ts | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/deploy/002_deploy_deramp_vault.ts b/deploy/002_deploy_deramp_vault.ts index 3136f2f..54d3320 100644 --- a/deploy/002_deploy_deramp_vault.ts +++ b/deploy/002_deploy_deramp_vault.ts @@ -7,7 +7,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { 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 = !hre.network.live; + const useProxy = true; const max = ethers.parseEther('1'); const min = ethers.parseEther('.001'); const fee = 0; diff --git a/scripts/onramp.ts b/scripts/onramp.ts index f171152..9582f99 100644 --- a/scripts/onramp.ts +++ b/scripts/onramp.ts @@ -16,21 +16,21 @@ async function main() { const benefactor = await ethers.getSigner(simpleERC20Beneficiary); const bob = await ethers.getSigner(offRamper); const alice = await ethers.getSigner(onRamper); - const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545"); - const backendWallet = new ethers.Wallet("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", provider); - // const backend = await ethers.getSigner(simpleOffchainVerifier); + //const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545"); + //const backendWallet = new ethers.Wallet("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", provider); + const backend = await ethers.getSigner(simpleOffchainVerifier); console.log("offramper addy: ", bob.address); console.log("onramper addy: ", alice.address); - console.log("backend addy: ", backendWallet.address); + console.log("backend addy: ", backend); const erc20Handle = await erc20imp.connect(bob).attach(erc.address); const see = await erc20Handle.approve(DeRampVault.address, ethers.parseEther('1000000000')); console.log("using erc20: ", erc.address); const MyContract2 = await ethers.getContractFactory('DeRampVault'); - const DeRampHandle = await MyContract2.connect(backendWallet).attach(DeRampVault.address); + const DeRampHandle = await MyContract2.connect(backend).attach(DeRampVault.address); //const supp2 = await DeRampHandle.deposit(ethers.parseEther(".05"), bob.address); const supp2 = await DeRampHandle.onramp(10, bob.address, alice.address);