Forked from Falilah/gist:9cdff755ab1ee17f9be81ef62166effc
Created
August 13, 2022 22:52
-
-
Save Ultra-Tech-code/f900a6d58079062ab0cff1210b9b1f20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config({ path: ".env" }); | |
import { BytesLike } from "ethers"; | |
import { ethers } from "hardhat"; | |
// import * as dotenv from "dotenv"; | |
// import IMultiSig from "../typechain-types/Imultisig.sol" | |
async function main() { | |
let provider = { | |
PrivateKey: process.env.PRIVATE_KEY as BytesLike, | |
URL: process.env.URL, | |
}; | |
const provider2 = ethers.getDefaultProvider("ropsten", provider.URL); | |
let wallet = new ethers.Wallet(provider.PrivateKey, provider2); | |
const _value = ethers.utils.parseEther("1"); | |
const CONTRACTADDRESS = "0x6e828b59fc799b6ef92e42d2f39e438a7477f469"; | |
const MULTISIG = await ethers.getContractAt("IMultiSig", CONTRACTADDRESS); | |
// await wallet.sendTransaction({ to: CONTRACTADDRESS, value: _value }); | |
// console.log(); | |
// console.log("contractBalanc", await MULTISIG.contractBalance()); | |
await MULTISIG.withdrawEther(_value); | |
} | |
// We recommend this pattern to be able to use async/await everywhere | |
// and properly handle errors. | |
main().catch((error) => { | |
console.error(error); | |
process.exitCode = 1; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from "dotenv";
dotenv.config();
const config: HardhatUserConfig = {
solidity: "0.8.9",
networks: {
hardhat: {
forking: {
url: "https://ropsten.infura.io/v3/rpc",
},
},
ropsten: {
url: process.env.ROPSTEN_URL,
//@ts-ignore
accounts: [process.env.PRIVATE_KEY],
},
},
};
export default config;