Skip to content

Instantly share code, notes, and snippets.


KadenZipfel/Refund.sol Secret

Created Dec 3, 2019
What would you like to do?
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