Last active
October 5, 2022 13:06
This file contains hidden or 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