Use call instead of transfer in case receiver fallback exceeds 2300 gas
This commit is contained in:
parent
d8c3d4e62f
commit
dc7778a24f
|
@ -85,7 +85,8 @@ contract RLN {
|
||||||
members[_pubkeyIndex] = 0;
|
members[_pubkeyIndex] = 0;
|
||||||
|
|
||||||
// refund deposit
|
// refund deposit
|
||||||
receiver.transfer(MEMBERSHIP_DEPOSIT);
|
(bool sent, _) = receiver.call{value: MEMBERSHIP_DEPOSIT}("");
|
||||||
|
require(sent, "transfer failed");
|
||||||
|
|
||||||
emit MemberWithdrawn(pubkey, _pubkeyIndex);
|
emit MemberWithdrawn(pubkey, _pubkeyIndex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue