Guest User

Untitled

a guest
Mar 21st, 2023
1,664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.88 KB | None | 0 0
  1. Установка
  2.  
  3. sudo apt update
  4. apt install python3-pip
  5. python3 -m pip install eth-brownie
  6.  
  7.  
  8. Настравиваем брауни
  9.  
  10. brownie networks add arb arbitrum host='https://arb1.arbitrum.io/rpc' chainid=42161 explorer='https://arbiscan.io'
  11. (тут меняем хост на вашу ноду)
  12.  
  13. Зупаскаем консоль для скрипта
  14. brownie console --network arbitrum
  15. ----
  16.  
  17. (ниже до скрипта забиваем как в терминал)
  18. Заполняем приваты
  19.  
  20. from time import sleep
  21.  
  22. private_keys=['0x00','0x001',...]
  23. ----
  24. Командой подтягиваем аккаунты
  25.  
  26. for i in private_keys:
  27.     accounts.add(i)
  28.  
  29. acc_num=list(range(len(accounts)))
  30.  
  31. ----
  32. ВВодим АБИ нашего контракта
  33.  
  34. abi=[{"inputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"_token","type":"address"},{"internalType":"address payable","name":"_sweepReceiver","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_claimPeriodStart","type":"uint256"},{"internalType":"uint256","name":"_claimPeriodEnd","type":"uint256"},{"internalType":"address","name":"delegateTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"CanClaim","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"HasClaimed","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"previousOwner","type":"address"},{"indexed":"true","internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"newSweepReceiver","type":"address"}],"name":"SweepReceiverSet","type":"event"},{"anonymous":"false","inputs":[{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"claimAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPeriodEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimPeriodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_claimableAmount","type":"uint256[]"}],"name":"setRecipients","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_sweepReceiver","type":"address"}],"name":"setSweepReciever","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
  35.  
  36. ----
  37. Подтягиваем контракт
  38.  
  39. arbitrum=Contract.from_abi('Arbirtum','0x67a24CE4321aB3aF51c2D0a4801c3E111D88C9d9',abi=abi)
  40. ---
  41.  
  42. Запускаем скрипт: #принцип он пробует склеймить первый ваш кошелек и как только у него получится пойдет по остальным
  43.  
  44. running = True
  45. while running:
  46.     try:
  47.         arbitrum.claim({'from': accounts[0], 'gas_price':"50 gwei",'gas_limit':1000000,'required_confs':0})
  48.         for i in acc_num[1:]:
  49.             try:
  50.                 arbitrum.claim({'from': accounts[i], 'gas_price':"50 gwei",'gas_limit':1000000,'required_confs':0})
  51.                 running = False
  52.             except Exception as ex:
  53.                 print(ex)
  54.                 pass
  55.     except Exception as ex:
  56.         print(ex)
  57.         sleep(1)  
  58.        
  59.        
  60. ----
  61. Можно менять :
  62. - 'gas_price':"50 gwei"
  63. - 'gas_limit' по дефолту 1м
  64. - sleep(1)  можно убрать или поменять например на 0.2
  65.  
  66.  
  67. ---------//--------
  68. Весь код сразу :
  69.  
  70. from time import sleep
  71. private_keys=['0x00','0x001',...]
  72. for i in private_keys:
  73.     accounts.add(i)
  74. acc_num=list(range(len(accounts)))
  75. abi=[{"inputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"_token","type":"address"},{"internalType":"address payable","name":"_sweepReceiver","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_claimPeriodStart","type":"uint256"},{"internalType":"uint256","name":"_claimPeriodEnd","type":"uint256"},{"internalType":"address","name":"delegateTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"CanClaim","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"HasClaimed","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"previousOwner","type":"address"},{"indexed":"true","internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"newSweepReceiver","type":"address"}],"name":"SweepReceiverSet","type":"event"},{"anonymous":"false","inputs":[{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":"false","inputs":[{"indexed":"true","internalType":"address","name":"recipient","type":"address"},{"indexed":"false","internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"claimAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPeriodEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimPeriodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_claimableAmount","type":"uint256[]"}],"name":"setRecipients","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_sweepReceiver","type":"address"}],"name":"setSweepReciever","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20VotesUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
  76. arbitrum=Contract.from_abi('Arbirtum','0x67a24CE4321aB3aF51c2D0a4801c3E111D88C9d9',abi=abi)
  77. running = True
  78. running = True
  79. while running:
  80.     try:
  81.         arbitrum.claim({'from': accounts[0], 'gas_price':"50 gwei",'gas_limit':1000000,'required_confs':0})
  82.         for i in acc_num[1:]:
  83.             try:
  84.                 arbitrum.claim({'from': accounts[i], 'gas_price':"50 gwei",'gas_limit':1000000,'required_confs':0})
  85.                 running = False
  86.             except Exception as ex:
  87.                 print(ex)
  88.                 pass
  89.     except Exception as ex:
  90.         print(ex)
  91.         sleep(1)    
  92.  
Add Comment
Please, Sign In to add comment