From dc7778a24f36ef9cc7e47df82318bda034d278f1 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 9 Aug 2022 13:23:03 -0400 Subject: [PATCH] Use call instead of transfer in case receiver fallback exceeds 2300 gas --- contracts/Rln.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/Rln.sol b/contracts/Rln.sol index bd97416..1d9daf8 100644 --- a/contracts/Rln.sol +++ b/contracts/Rln.sol @@ -85,7 +85,8 @@ contract RLN { members[_pubkeyIndex] = 0; // refund deposit - receiver.transfer(MEMBERSHIP_DEPOSIT); + (bool sent, _) = receiver.call{value: MEMBERSHIP_DEPOSIT}(""); + require(sent, "transfer failed"); emit MemberWithdrawn(pubkey, _pubkeyIndex); }