Created
October 4, 2022 17:18
-
-
Save ac12644/c6ed71e7bd88afea3f23e4cdd80797b9 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
... | |
function addFarmer(address account) public onlyFarmer { | |
_addFarmer(account); | |
} | |
function renounceFarmer() public { | |
_removeFarmer(_msgSender()); | |
} | |
function _addFarmer(address account) internal { | |
farmers.add(account); | |
emit FarmerAdded(account); | |
} | |
function _removeFarmer(address account) internal { | |
farmers.remove(account); | |
emit FarmerRemoved(account); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment