Skip to content

Commit

Permalink
npx hardhat cctx
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 27, 2023
1 parent 425da52 commit 68553f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ ADDRESS=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address')

echo "Deployed contract address: $ADDRESS"

npx hardhat interact --contract $ADDRESS --network goerli_testnet --amount 0.000000000000000001 --target-z-r-c20 $ADDRESS --recipient $ADDRESS --min-amount-out 0
TX=$(npx hardhat interact --contract $ADDRESS --network goerli_testnet --amount 0.000000000000000001 --target-z-r-c20 $ADDRESS --recipient $ADDRESS --min-amount-out 0 --json | jq -r '.hash')

npx hardhat cctx $TX

git reset --hard HEAD
npx hardhat messaging CrossChainMessage
Expand Down
2 changes: 1 addition & 1 deletion templates/omnichain/tasks/deploy.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {

task("deploy", "Deploy the contract", main).addFlag(
"json",
"Output contract details in JSON"
"Output in JSON"
);
12 changes: 8 additions & 4 deletions templates/omnichain/tasks/interact.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { prepareData, trackCCTX } from "@zetachain/toolkit/helpers";

const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
const [signer] = await hre.ethers.getSigners();
console.log(`🔑 Using account: ${signer.address}\n`);

const data = prepareData(
args.contract,
Expand All @@ -18,11 +17,16 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {

const tx = await signer.sendTransaction({ data, to, value });

console.log(`
🚀 Successfully broadcasted a token transfer transaction on ${hre.network.name} network.
if (args.json) {
console.log(JSON.stringify(tx, null, 2));
} else {
console.log(`🔑 Using account: ${signer.address}\n`);

console.log(`🚀 Successfully broadcasted a token transfer transaction on ${hre.network.name} network.
📝 Transaction hash: ${tx.hash}
`);
await trackCCTX(tx.hash);
await trackCCTX(tx.hash);
}
};

task("interact", "Interact with the contract", main)
Expand Down

0 comments on commit 68553f9

Please sign in to comment.