diff --git a/deploy/001_deploy_simple_erc20.ts b/deploy/001_deploy_simple_erc20.ts index eb2bcc2..ce5d3ed 100644 --- a/deploy/001_deploy_simple_erc20.ts +++ b/deploy/001_deploy_simple_erc20.ts @@ -10,7 +10,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await deploy('SimpleERC20', { from: deployer, - args: [simpleOffchainVerifier, parseEther('1000000000')], + args: [deployer, parseEther('1000000000')], log: true, autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks }); diff --git a/deploy/002_deploy_deramp_vault.ts b/deploy/002_deploy_deramp_vault.ts index a05085e..3136f2f 100644 --- a/deploy/002_deploy_deramp_vault.ts +++ b/deploy/002_deploy_deramp_vault.ts @@ -17,7 +17,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await deploy('DeRampVault', { from: deployer, proxy: useProxy && { - owner: deployer, + owner: simpleOffchainVerifier, proxyContract: 'UUPS', execute: { diff --git a/hardhat.config.ts b/hardhat.config.ts index 9f330fe..06660c2 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -34,7 +34,7 @@ const config: HardhatUserConfig = { onRamper: 2, offRamper: 3, simpleOffchainVerifier: { - default: 4, + default: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', sepolia: '0x36e7Fda8CC503D5Ec7729A42eb86EF02Af315Bf9' }, diff --git a/scripts/getBalance.ts b/scripts/getBalance.ts index 16302ae..382b713 100644 --- a/scripts/getBalance.ts +++ b/scripts/getBalance.ts @@ -27,11 +27,11 @@ async function main() { console.log('deramp balance: ', supp2); */ - const { owner, simpleOffchainVerifier, offRamper, onRamper } = await getNamedAccounts(); + const { deployer, simpleOffchainVerifier, offRamper, onRamper } = await getNamedAccounts(); const SimpleERC20Factory = await deployments.get('SimpleERC20'); const DeRampVault = await deployments.get('DeRampVault'); - const benefactor = await ethers.getSigner(simpleOffchainVerifier); + const benefactor = await ethers.getSigner(deployer); const bobby = await ethers.getSigner(offRamper); const alice = await ethers.getSigner(onRamper); diff --git a/scripts/onramp.ts b/scripts/onramp.ts index 0f7753b..f171152 100644 --- a/scripts/onramp.ts +++ b/scripts/onramp.ts @@ -16,22 +16,23 @@ async function main() { const benefactor = await ethers.getSigner(simpleERC20Beneficiary); const bob = await ethers.getSigner(offRamper); const alice = await ethers.getSigner(onRamper); - 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: ", backend.address); - + console.log("backend addy: ", backendWallet.address); 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(backend).attach(DeRampVault.address); + const DeRampHandle = await MyContract2.connect(backendWallet).attach(DeRampVault.address); //const supp2 = await DeRampHandle.deposit(ethers.parseEther(".05"), bob.address); - const supp2 = await DeRampHandle.onramp(100, bob.address, alice.address); + const supp2 = await DeRampHandle.onramp(10, bob.address, alice.address); } diff --git a/scripts/transferERC20.ts b/scripts/transferERC20.ts index 4956f52..b4cef48 100644 --- a/scripts/transferERC20.ts +++ b/scripts/transferERC20.ts @@ -8,11 +8,11 @@ const account = args[0]; const message = args[1]; async function main() { - const { owner, simpleOffchainVerifier, offRamper } = await getNamedAccounts(); - const benefactor = await ethers.getSigner(simpleOffchainVerifier); + const { deployer, simpleOffchainVerifier, offRamper } = await getNamedAccounts(); + const benefactor = await ethers.getSigner(deployer); const bob = await ethers.getSigner(offRamper); - console.log('simpleERC20Beneficiary: ', simpleOffchainVerifier); + console.log('simpleERC20Beneficiary: ', deployer); console.log('bob.address: ', bob.address); const erc20Deployment = await deployments.get('SimpleERC20'); diff --git a/scripts/withdrawDeposit.ts b/scripts/withdrawDeposit.ts index 572c1c7..2bc8ef4 100644 --- a/scripts/withdrawDeposit.ts +++ b/scripts/withdrawDeposit.ts @@ -8,11 +8,11 @@ const account = args[0]; const message = args[1]; async function main() { - const { owner, simpleERC20Beneficiary, offRamper } = await getNamedAccounts(); - const benefactor = await ethers.getSigner(simpleERC20Beneficiary); + const { owner, simpleERC20Beneficiary, offRamper, simpleOffchainVerifier } = await getNamedAccounts(); + const benefactor = await ethers.getSigner(simpleOffchainVerifier); const bob = await ethers.getSigner(offRamper); - console.log('account: ', simpleERC20Beneficiary); + console.log('account: ', simpleOffchainVerifier); console.log('account: ', bob.address); const DeRampVault = await deployments.get('DeRampVault'); @@ -21,8 +21,8 @@ async function main() { const contract2 = MyContract2.attach(DeRampVault.address); - const DeRampHandle = await MyContract2.connect(bob).attach(DeRampVault.address); - const supp2 = await DeRampHandle.withdrawDeposit(1, bob.address); + const DeRampHandle = await MyContract2.connect(benefactor).attach(DeRampVault.address); + const supp2 = await DeRampHandle.withdrawDeposit(50, bob.address); } main()