Closed nzarambaelisa closed 1 year ago
In modifier try using require statement
modifier situation() {
// locked[msg.sender] == lockAccount(msg.sender) ? true : false;
require(locked[msg.sender] == false)
_;
}
and in your modifier you should do "==" instead of "=" this should be the mistake
Can you:
hello i'm trying to include a condition in my code. i added a function in my contract that is only called by the owner of the contract that lock a certain address of choice from withdrawing funds. QUESTION? does the code make sense? first i created a variable
then i made a function that sets a particular address to true
then i created a modifier that checks for true otherwise false so that other addresses when they call withdraw, they mark as false because in the unstake function it is said to require
require(locked[msg.sender] = false);