Skip to content

Commit

Permalink
fix: remove abis & use @hyperlane-xyz/core
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongsu-hong committed Feb 28, 2024
1 parent 477de6e commit 58e04ca
Show file tree
Hide file tree
Showing 11 changed files with 1,053 additions and 16,748 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
2,831 changes: 0 additions & 2,831 deletions example/abi/HypERC20.ts

This file was deleted.

4,297 changes: 0 additions & 4,297 deletions example/abi/ITransparentUpgradeableProxy.ts

This file was deleted.

2,110 changes: 0 additions & 2,110 deletions example/abi/ProxyAdmin.ts

This file was deleted.

1,380 changes: 0 additions & 1,380 deletions example/abi/StaticMessageIdMultisigIsmFactory.ts

This file was deleted.

1,842 changes: 0 additions & 1,842 deletions example/abi/TestRecipient.ts

This file was deleted.

4,261 changes: 0 additions & 4,261 deletions example/abi/TransparentUpgradeableProxy.ts

This file was deleted.

18 changes: 9 additions & 9 deletions example/src/recipient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Hex } from "viem";

import { TestRecipient } from "../abi/TestRecipient";
import { StaticMessageIdMultisigIsmFactory } from "../abi/StaticMessageIdMultisigIsmFactory";
import {
TestRecipient__factory,
StaticMessageIdMultisigIsmFactory__factory,
} from "@hyperlane-xyz/core";

import { CONTAINER, Dependencies } from "./ioc";
import { expectNextContractAddr, logTx } from "./utils";
Expand All @@ -24,8 +24,8 @@ async function deployTestRecipient() {
// deploy test recipient
{
const tx = await exec.deployContract({
abi: TestRecipient.abi,
bytecode: TestRecipient.bytecode.object as Hex,
abi: TestRecipient__factory.abi,
bytecode: TestRecipient__factory.bytecode,
args: [],
});
logTx("Deploy test recipient", tx);
Expand All @@ -34,7 +34,7 @@ async function deployTestRecipient() {

// deploy multisig ism
const multisigIsmAddr = await query.readContract({
abi: StaticMessageIdMultisigIsmFactory.abi,
abi: StaticMessageIdMultisigIsmFactory__factory.abi,
address: HYP_MULTSIG_ISM_FACTORY,
functionName: "getAddress",
args: [[account.address], 1],
Expand All @@ -43,7 +43,7 @@ async function deployTestRecipient() {

{
const tx = await exec.writeContract({
abi: StaticMessageIdMultisigIsmFactory.abi,
abi: StaticMessageIdMultisigIsmFactory__factory.abi,
address: HYP_MULTSIG_ISM_FACTORY,
functionName: "deploy",
args: [[account.address], 1],
Expand All @@ -57,7 +57,7 @@ async function deployTestRecipient() {
console.log(`Setting ism of test recipient to "${multisigIsmAddr.green}"...`);
{
const tx = await exec.writeContract({
abi: TestRecipient.abi,
abi: TestRecipient__factory.abi,
address: testRecipientAddr,
functionName: "setInterchainSecurityModule",
args: [multisigIsmAddr],
Expand Down
14 changes: 7 additions & 7 deletions example/src/warp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from "commander";
import { Hex, isAddress, parseEther } from "viem";
import { isAddress } from "viem";

import { HypERC20 } from "../abi/HypERC20";
import { HypERC20__factory } from "@hyperlane-xyz/core";

import { HYP_MAILBOX } from "./constants";
import { CONTAINER, Dependencies } from "./ioc";
Expand Down Expand Up @@ -43,8 +43,8 @@ async function deployWarpRoute() {

{
const tx = await exec.deployContract({
abi: HypERC20.abi,
bytecode: HypERC20.bytecode.object as Hex,
abi: HypERC20__factory.abi,
bytecode: HypERC20__factory.bytecode,
args: [6, HYP_MAILBOX],
});
logTx("Deploying HypERC20Osmo", tx);
Expand All @@ -53,7 +53,7 @@ async function deployWarpRoute() {

{
const tx = await exec.writeContract({
abi: HypERC20.abi,
abi: HypERC20__factory.abi,
address: hypErc20OsmoAddr,
functionName: "initialize",
args: [0n, "Hyperlane Bridged Osmosis", "OSMO"],
Expand All @@ -77,7 +77,7 @@ async function linkWarpRoute(warp: string, domain: string, route: string) {
if (!isAddress(warp)) throw new Error("Invalid warp address");

const tx = await exec.writeContract({
abi: HypERC20.abi,
abi: HypERC20__factory.abi,
address: warp,
functionName: "enrollRemoteRouter",
args: [parseInt(domain), `0x${extractByte32AddrFromBech32(route)}`],
Expand All @@ -94,7 +94,7 @@ async function transferWarpRoute(warp: string, domain: string, to: string) {
if (!isAddress(warp)) throw new Error("Invalid warp address");

const tx = await exec.writeContract({
abi: HypERC20.abi,
abi: HypERC20__factory.abi,
address: warp,
functionName: "transferRemote",
args: [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@cosmjs/proto-signing": "^0.32.2",
"@cosmjs/stargate": "^0.32.2",
"@cosmjs/tendermint-rpc": "^0.32.2",
"@hyperlane-xyz/core": "^3.7.0",
"axios": "^1.6.7",
"colors": "^1.4.0",
"commander": "^11.1.0",
Expand Down
Loading

0 comments on commit 58e04ca

Please sign in to comment.