Advertisement
Guest User

Index

a guest
Mar 4th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. <head>
  2. <script src='https://www.google.com/recaptcha/api.js'></script>
  3. </head>
  4. <body>
  5. <?php
  6. //----[Settings]
  7. $version = "1.3.2";
  8.  
  9. $coinname = "";
  10.  
  11. $rpcusername = "";
  12. $rpcpassword = "";
  13. $rpcIP = "54.38.78.57";
  14. $rpcport = "";
  15.  
  16. $sqlIP = "54.38.78.57";
  17. $sqluser = "root";
  18. $sqlpassword = "";
  19. $sqlDB = "faucet";
  20.  
  21. $minbalance = 0.005; //Never make this lower then the $randomHigh, it could result in errors on payout.
  22.  
  23. $randomlow = 5;
  24. $randomhigh = 50;
  25. $randomdivide = 10000; //To create numbers lower then 1.0
  26.  
  27. $walletaccount = "faucet"; //Keep empty to just use the main wallet
  28.  
  29. $capatchaSecret = ""; //Your Recapatcha V2 secret
  30. $capatchaSiteKey = ""; //Your Recapatcha V2 site key
  31.  
  32. $dev = false; //Set to TRUE to enable error reporting (Useful for development!)
  33. //-----
  34.  
  35. //----[Debug]
  36. if($dev==true){
  37. error_reporting(E_ALL); //show errors
  38. ini_set('display_startup_errors',1); //show errors
  39. ini_set('display_errors',1); //show errors
  40. error_reporting(-1); //show errors
  41. }
  42. //----
  43.  
  44. //----[Dependencies]
  45. require_once 'jsonRPCClient.php';
  46. //----
  47.  
  48. $faucet = new jsonRPCClient("http://$rpcusername:$rpcpassword@$rpcIP:$rpcport/");
  49. print_r($faucet->getbalance("$walletaccount"));
  50. echo "</b> - Donate to the faucet: ".$faucet->getaccountaddress("$walletaccount")."<br />";
  51.  
  52. if(!empty($_POST['address'])) {
  53. $username = $_POST['address'];
  54. $ip = $_SERVER['REMOTE_ADDR'];
  55.  
  56. if($faucet->getbalance("$walletaccount") < $minbalance){
  57. echo "Not enough funds.";
  58. }else{
  59. $check = $faucet->validateaddress($username); //Make sure the text entered is a valid address
  60. if($check["isvalid"] == 1){
  61. $RecapatchaJson = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$capatchaSecret&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']));
  62. if ($RecapatchaJson->success == true){
  63. $link = mysqli_connect($sqlIP, $sqluser, $sqlpassword)or die("cannot connect to server - Sorry");
  64. mysqli_select_db($link, $sqlDB)or die("cannot select DB");
  65. $time = time();
  66. $time_check = $time-43200; //Users can re-get coins every 8 hours (43200 seconds)
  67. $sql4 = "DELETE FROM users WHERE time<$time_check";
  68. $result4 = mysqli_query($link, $sql4);
  69. $sql = "SELECT * FROM users WHERE address='$username' OR ip='$ip'";
  70. $result = mysqli_query($link, $sql);
  71. $count = mysqli_num_rows($result);
  72. if($count == "0"){
  73. $amount = mt_rand($randomlow,$randomhigh) / $randomdivide;
  74. $sql1 = sprintf("INSERT INTO users(address, time, ip, amount) VALUES ('$username', '$time', '$ip', '$amount')");
  75. $result1 = mysqli_query($link, $sql1);
  76. $faucet->sendfrom("$walletaccount", $username, $amount);
  77. echo "You've got $amount $coinname to your account at $username";
  78. }else{
  79. echo "Too many requests, you can only get new $coinname every 8 hours! (So sorry!)";
  80. }
  81. }else{
  82. echo "Capatcha Failure";
  83. }
  84. }else{
  85. echo "The address you've entered is invalid";
  86. }
  87. }
  88. }
  89. $faucetlowcalc = $randomlow / $randomdivide;
  90. $faucethighcalc = $randomhigh / $randomdivide;
  91. echo "<br/>You can currently get between $faucethighcalc and $faucetlowcalc from this faucet every 8 hours. Good luck!<br/>";
  92. echo '<br />Your '.$coinname.' address: <form Name = "getcoin" Method = "POST" ACTION = ""><INPUT TYPE = "text" VALUE = "" NAME = "address" /><INPUT TYPE = "submit" Name = "submit" VALUE = "Roll!" /><br/><br/><div class="g-recaptcha" data-sitekey="'.$capatchaSiteKey.'"></div>';
  93. ?>
  94. </form>
  95. </table><p><font size="2">Simple faucet base coded by Smiba - version <?php echo $version; //Do not remove the base coded by ?></font></p>
  96. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement