Skip to content

Commit

Permalink
Update to toolkit v6 (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Mar 28, 2024
1 parent c119bdd commit 11f8d95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/developers/omnichain/tutorials/hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { parseUnits } from "@ethersproject/units";
import { getAddress } from "@zetachain/protocol-contracts";
import ERC20Custody from "@zetachain/protocol-contracts/abi/evm/ERC20Custody.sol/ERC20Custody.json";
import { prepareData } from "@zetachain/toolkit/helpers";
import { prepareData } from "@zetachain/toolkit/client";
import { utils, ethers } from "ethers";
import ERC20 from "@openzeppelin/contracts/build/contracts/ERC20.json";

Expand All @@ -203,6 +203,11 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {

if (args.token) {
const custodyAddress = getAddress("erc20Custody", hre.network.name as any);
if (!custodyAddress) {
throw new Error(
`No ERC20 Custody contract found for ${hre.network.name} network`
);
}
const custodyContract = new ethers.Contract(
custodyAddress,
ERC20Custody.abi,
Expand Down
8 changes: 7 additions & 1 deletion docs/developers/omnichain/tutorials/swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { parseEther } from "@ethersproject/units";
import { getAddress } from "@zetachain/protocol-contracts";
import { prepareData } from "@zetachain/toolkit/helpers";
import { prepareData } from "@zetachain/toolkit/client";
// highlight-next-line
import bech32 from "bech32";

Expand Down Expand Up @@ -219,6 +219,12 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {

if (args.token) {
const custodyAddress = getAddress("erc20Custody", hre.network.name as any);
if (!custodyAddress) {
throw new Error(
`No ERC20 Custody contract found for ${hre.network.name} network`
);
}

const custodyContract = new ethers.Contract(
custodyAddress,
ERC20Custody.abi,
Expand Down

0 comments on commit 11f8d95

Please sign in to comment.