-
-
Save kadenzipfel/2e26bb8d903172024f99611bc0b689bb 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
address[] private refundAddresses; | |
mapping (address => uint) public refunds; | |
// bad | |
function refundAll() public { | |
for(uint x; x < refundAddresses.length; x++) { // arbitrary length iteration based on how many addresses participated | |
require(refundAddresses[x].send(refunds[refundAddresses[x]])) // doubly bad, now a single failure on send will hold up all funds | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment