I want to test my smart contract but don't know the way to access the public variables after the contact was deployed? For example:
contract NFT is ERC721, Ownable {
using SafeMath for uint256;
bool public isActive = False;
uint256 public startingIndexBlock;
uint256 public startingIndex;
}
I want to access the variable isActive
I have the run.js
to deploy the contract into the local environment and here is the code:
async function main() {
const [owner] = await hre.ethers.getSigners();
console.log(
"Deploying contracts with the account:",
owner.address
);
const contractFactory = await hre.ethers.getContractFactory("ApeNFT");
// Deploy contract with the correct constructor arguments
const contract = await contractFactory.deploy("Mom", "MM" ,10000, 0);
let isActive = await contract.isActive.toString();
}
Here, I will never get the value of isActive. Does anyone know how to solve this issue?