Python Web3
Python Web3
------------------------
ALARM
def monitor():
while True:
if fomo3d.functions.rID_().call() == 1 and
lastwinner.functions.rID_().call() == 2:
print("The round is still the same");
time.sleep(1)
print("sorry")
else :
if fomo3d.functions.rID_().call() == 2 :
print("New f3d round has started!!!");
print("Current time: ");
print(strftime("%H:%M:%S", localtime()));
webbrowser.open('https://etherscan.io/txs?
a=0xA62142888ABa8370742bE823c1782D17A0389Da1');
webbrowser.open('https://exitscam.me/play');
winsound.PlaySound('alar.wav', winsound.SND_FILENAME |
winsound.SND_ASYNC);
break
if lastwinner.functions.rID_().call() == 3 :
print("New lastwinner round has started!!!");
print("Current time: ");
print(strftime("%H:%M:%S", localtime()));
webbrowser.open('https://etherscan.io/txs?
a=0xDd9fd6b6F8f7ea932997992bbE67EabB3e316f3C');
webbrowser.open('http://lastwinner.co/play');
winsound.PlaySound('alar.wav', winsound.SND_FILENAME |
winsound.SND_ASYNC);
break
----------------------
1) download latest version of python. make sure to click "add python to PATH" when
installing
2) goto windows command prompt ( you can right click on windows icon in bottom left
then click Run, then type in cmd.exe )
3) type pip install web3
4) set up an account at infura.io . when you are done goto
https://infura.io/dashboard and create new project. it will give you an api key and
link
import webbrowser
import time
from time import localtime, strftime
import winsound
import contract_abi
from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('https://mainnet.infura.io/v3/whateveryourapilinkis'))
w3.eth.enable_unaudited_features()
lastwinner = w3.eth.contract(address =
"0xDd9fd6b6F8f7ea932997992bbE67EabB3e316f3C", abi = contract_abi.abi)
fomo3d = w3.eth.contract(address = "0xA62142888ABa8370742bE823c1782D17A0389Da1",
abi = contract_abi.abi)
fomoshort = w3.eth.contract(address = "0x4e8ecF79AdE5e2C49B9e30D795517A81e0Bf00B8",
abi = contract_abi.abi)
def monitor():
while True:
if fomo3d.functions.rID_().call() == 2 and
lastwinner.functions.rID_().call() == 2:
print("The round is still the same");
time.sleep(1)
print("sorry")
else :
if fomo3d.functions.rID_().call() == 3 :
print("New f3d round has started!!!");
print("Current time: ");
print(strftime("%H:%M:%S", localtime()));
webbrowser.open('https://etherscan.io/txs?
a=0xA62142888ABa8370742bE823c1782D17A0389Da1');
webbrowser.open('https://exitscam.me/play');
winsound.PlaySound('alar.wav', winsound.SND_FILENAME |
winsound.SND_ASYNC);
break
if lastwinner.functions.rID_().call() == 3 :
print("New lastwinner round has started!!!");
print("Current time: ");
print(strftime("%H:%M:%S", localtime()));
webbrowser.open('https://etherscan.io/txs?
a=0xDd9fd6b6F8f7ea932997992bbE67EabB3e316f3C');
webbrowser.open('http://lastwinner.co/play');
winsound.PlaySound('alar.wav', winsound.SND_FILENAME |
winsound.SND_ASYNC);
break
---
JS
//last winner
var contractAddress = "0xdd9fd6b6f8f7ea932997992bbe67eabb3e316f3c";
var contractInstance = web3.eth.contract(contractAbi).at(contractAddress);
function startScan() {
contractInstance.getCurrentRoundInfo(function(error, getCurrentRoundInfo) {
if (error) {
var errorMsg = 'error';
console.log(errorMsg);
return;
}
var currentRound = parseInt(getCurrentRoundInfo[1]);
if (currentRound === 2) {
console.log('nothing to see here');
} else {
console.log('NEW ROUND!!!');
alert("Last Winner New Round Started!!!");
stopScan();
}
});
}
function stopScan() {
clearInterval(accountInterval);
}
---------
TEST