Skip to content

Commit

Permalink
deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Mar 14, 2024
1 parent 880e89d commit 30bb3cc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/zevm-app-contracts/data/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"zetaSwap": "0xA8168Dc495Ed61E70f5c1941e2860050AB902cEF",
"zetaSwapBtcInbound": "0x358E2cfC0E16444Ba7D3164Bbeeb6bEA7472c559",
"invitationManager": "0x3649C03C472B698213926543456E9c21081e529d",
"withdrawERC20": "0xB5De3Eb98e29853a99adA24029786aa670f6D580"
"withdrawERC20": "0xB958746620Aa3E6F83B4cF2eA371fe475190A632"
}
}
}
20 changes: 0 additions & 20 deletions packages/zevm-app-contracts/scripts/withdrawERC20/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { isProtocolNetworkName } from "@zetachain/protocol-contracts";
import { ethers, network } from "hardhat";

import { ERC20__factory } from "../../typechain-types";
import { WithdrawERC20__factory } from "../../typechain-types/factories/contracts/withdrawErc20/withdrawErc20.sol";
import { getSystemContractAddress, saveAddress } from "../address.helpers";

const networkName = network.name;

const SYSTEM_CONTRACT = getSystemContractAddress();

const ZUSDC_ADDRESS = "0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a";
const AMOUNT = ethers.utils.parseUnits("0.5", 6);

async function main() {
if (!isProtocolNetworkName(networkName)) throw new Error("Invalid network name");

Expand All @@ -22,22 +18,6 @@ async function main() {

console.log("WithdrawERC20 deployed to:", withdrawERC20.address);
saveAddress("withdrawERC20", withdrawERC20.address, networkName);
{
const [signer] = await ethers.getSigners();
const withdrawERC20Address = withdrawERC20.address;

const WithdrawERC20Factory = (await ethers.getContractFactory("WithdrawERC20")) as WithdrawERC20__factory;
const WithdrawERC20 = WithdrawERC20Factory.attach(withdrawERC20Address);

const ERC20Factory = (await ethers.getContractFactory("ERC20")) as ERC20__factory;
const erc20 = ERC20Factory.attach(ZUSDC_ADDRESS);

await erc20.approve(WithdrawERC20.address, AMOUNT);
const tx = await WithdrawERC20.withdraw(erc20.address, AMOUNT, signer.address);
console.log(`Sending transaction ${tx.hash}`);
const receipt = await tx.wait();
console.log(receipt);
}
}

main().catch((error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getZEVMAppAddress } from "../address.helpers";
const networkName = network.name;

const ZUSDC_ADDRESS = "0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a";
const AMOUNT = ethers.utils.parseUnits("5", 6);
const AMOUNT = ethers.utils.parseUnits("0.5", 6);

async function main() {
if (!isProtocolNetworkName(networkName)) throw new Error("Invalid network name");
Expand Down

0 comments on commit 30bb3cc

Please sign in to comment.