Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signers not working in Ignitioin/modules/abc.js files #5462

Closed
yazibshah opened this issue Jun 30, 2024 · 1 comment
Closed

Signers not working in Ignitioin/modules/abc.js files #5462

yazibshah opened this issue Jun 30, 2024 · 1 comment
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@yazibshah
Copy link

Describe the feature

const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");
const {ethers}=require("hardhat")

const multiSigWallet= buildModule("MultiSigWallet", async(m) => {
// let owner1;
// let owner2;
// let owner3;
let owners;
// [owner1, owner2, owner3]=await ethers.getSigners()
owners=["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"]
const multiSig = m.contract("MultiSig",[owners,2]);
console.log(multiSig.contractName)
return { multiSig };
});

module.exports = multiSigWallet;

i have tried many with different ways but signers not working in sight buildModuler aslo callback func don't accept async javascript.

please how can use signers in this callback
and why I can't use async javascrpt.

Search terms

i have tried many with different ways but signers not working in sight buildModuler aslo callback func don't accept async javascript. please how can use signers in this callback and why I can't use async javascrpt.

@kanej
Copy link
Member

kanej commented Jul 8, 2024

Hey @yazibshah, you are using Ignition here, you can find our Ignition docs here: https://hardhat.org/ignition/docs/getting-started#overview

An Ignition module is invoked at the command line with the ignition deploy task, so something like:

npx hardhat ignition deploy ./modules/abc.js

This will deploy your multisig against your local node. You can access the accounts defined in your Hardhat config with getAccount: https://hardhat.org/ignition/docs/guides/creating-modules#deploying-and-calling-contracts-from-different-accounts

Assuming the first arg of the contract constructor is an array of owner addresses, maybe something like:

const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");

const multiSigWallet= buildModule("MultiSigWallet", async(m) => {
  let owner1 = m.getAccount(0);
  let owner2 = m.getAccount(1);
  let owner3 = m.getAccount(2);

  const multiSig = m.contract("MultiSig",[ [owner1, owner2, owner3], 2]);
 
  return { multiSig };
});

module.exports = multiSigWallet;

@kanej kanej added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Jul 11, 2024
@kanej kanej closed this as completed Jul 22, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Jul 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Archived in project
Development

No branches or pull requests

3 participants