The function setActivity
always revert due to the address ? How can I get the contract address because it sounds that the address is always all zeros when I get the value fron the (address sate variable) ?
Here is the Smart Contract :
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Learning {
address public owner;
bool public isActive = true;
uint256 public number;
modifier checkActivity() {
require(isActive, "Not Active any more.");
_;
}
modifier onlyOwner() {
require(msg.sender == owner, "not owner");
_;
}
function setValue(uint x) checkActivity public {
number = x;
}
function setActivity(bool _isActive) onlyOwner public {
isActive = _isActive;
}
}