-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexecute_boxv2_func.js
31 lines (23 loc) · 936 Bytes
/
execute_boxv2_func.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const hre = require("hardhat");
require('dotenv').config();
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
const BoxV2 = await hre.ethers.getContractFactory("BoxV2");
const WALLET_ADDRESS = deployer.address
console.log("WALLET ADDRESS: ", WALLET_ADDRESS);
// change this address accordingly
const CONTRACT_ADDRESS = '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6';
const boxv2 = await BoxV2.attach(CONTRACT_ADDRESS);
// Setter
//const result = await box.store(22);
//console.log("Executed Store method and result is:", result.data.toString());
// Getter
await boxv2.initializeV2();
const value = await boxv2.B(1);
console.log('BoxV2.B() value is', value.toString());
}
main().then(() => process.exit(0)).catch(error => {
console.error(error);
process.exit(1);
});