Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Added Wallet as a valid output to getAPSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieraykatz committed Sep 8, 2023
1 parent 27ff609 commit 7537491
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ const config: HardhatUserConfig = {
polygon: {
url: envConfigProd.POLYGON_RPC_URL,
accounts: envConfigProd.ACCOUNTS,
gasPrice: 120*10**9,
gas: 15*10**6,
},
hardhat: {
accounts: hardhatAccounts,
Expand Down
5 changes: 3 additions & 2 deletions tasks/helpers/submitMultiSigTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers";
import {BytesLike} from "ethers";
import {IMultiSigGeneric__factory} from "typechain-types";
import {filterEvents, logger} from "utils";
import { Wallet } from "ethers";

/**
* Submits a transaction to the designated Multisig contract and executes it if possible.
Expand All @@ -13,13 +14,13 @@ import {filterEvents, logger} from "utils";
*/
export async function submitMultiSigTx(
msAddress: string,
owner: SignerWithAddress,
owner: SignerWithAddress | Wallet,
destination: string,
data: BytesLike
): Promise<boolean> {
logger.out(`Submitting transaction to Multisig at address: ${msAddress}...`);
const multisig = IMultiSigGeneric__factory.connect(msAddress, owner);
const tx = await multisig.submitTransaction(destination, 0, data, "0x");
const tx = await multisig.submitTransaction(destination, 0, data, "0x", {gasPrice: 120*10**9});
logger.out(`Tx hash: ${tx.hash}`);
const receipt = await tx.wait();

Expand Down
6 changes: 2 additions & 4 deletions utils/signers/connectSignerFromPkey.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers";
import {Wallet} from "ethers";
import {HardhatRuntimeEnvironment} from "hardhat/types";

export async function connectSignerFromPkey(
pkey: string,
hre: HardhatRuntimeEnvironment
): Promise<SignerWithAddress> {
const signer = new Wallet(pkey, hre.ethers.provider);
return hre.ethers.getSigner(signer.address);
): Promise<Wallet> {
return new Wallet(pkey, hre.ethers.provider);
}
3 changes: 2 additions & 1 deletion utils/signers/getAPTeamOwner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers";
import {HardhatRuntimeEnvironment} from "hardhat/types";
import {connectSignerFromPkey} from "./connectSignerFromPkey";
import {getSigners} from "./getSigners";
import { Wallet } from "ethers";

export async function getAPTeamOwner(
hre: HardhatRuntimeEnvironment,
pkey?: string
): Promise<SignerWithAddress> {
): Promise<SignerWithAddress|Wallet> {
if (pkey) {
return await connectSignerFromPkey(pkey, hre);
}
Expand Down

0 comments on commit 7537491

Please sign in to comment.