File tree 3 files changed +27
-3
lines changed
3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "gateway" : " 0x1Ab49D53d0BfF0202ec4b330349B427155BBA7ac " ,
3
- "erc20" : " 0xa751b62893867D0608a2ADa5D17D0c43e3433040 "
2
+ "gateway" : " 0x3cDF223ED88e5489C8409538f95Bb7F93316D462 " ,
3
+ "erc20" : " 0x225FD9C5677E7B066cD723DFD07438687B805d52 "
4
4
}
Original file line number Diff line number Diff line change 78
78
"outputs" : [],
79
79
"stateMutability" : " nonpayable" ,
80
80
"type" : " function"
81
+ },
82
+ {
83
+ "inputs" : [],
84
+ "name" : " withdrawSupplies" ,
85
+ "outputs" : [],
86
+ "stateMutability" : " nonpayable" ,
87
+ "type" : " function"
81
88
}
82
- ]
89
+ ]
Original file line number Diff line number Diff line change @@ -26,6 +26,23 @@ contract PaymentGatewayContract {
26
26
deployBlock = block .number ;
27
27
}
28
28
29
+ function sendValue (address payable recipient , uint256 amount ) private {
30
+ require (address (this ).balance >= amount, "Insufficient balance " );
31
+ (bool success , ) = recipient.call {value: amount}("" );
32
+ require (success, "Unable to send value " );
33
+ }
34
+
35
+ function withdrawSupplies () public {
36
+ uint256 balance = erc20.balanceOf (address (this ));
37
+ if (balance >= 0 ) {
38
+ erc20.transfer (owner, balance);
39
+ }
40
+ balance = address (this ).balance;
41
+ if (balance >= 0 ) {
42
+ sendValue (payable (owner), balance);
43
+ }
44
+ }
45
+
29
46
function sendUSDT (uint256 _amount , bytes32 _data ) public {
30
47
uint256 allowance = erc20.allowance (msg .sender , address (this ));
31
48
You can’t perform that action at this time.
0 commit comments