Last active
October 5, 2022 13:06
-
-
Save arwer13/ddcca2c6ba524deef62ec905150a3f9d 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
contract Foo { | |
uint256 constant MAX_WITHDRAWAL_ATTEMPTS = 3; | |
mapping(address => uint256) private numWithdrawalAttempts; | |
function doWithdrawalRequest() public { | |
require(numWithdrawalAttempts[msg.sender] <= MAX_WITHDRAWAL_ATTEMPTS); | |
// ... | |
numWithdrawalAttempts[msg.sender] = numWithdrawalAttempts[msg.sender] + 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment