#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
# Set environment variables
os.environ['WEB3_INFURA_PROJECT_ID'] = '36b50e216910413cb992038edae3141d'
os.environ['WEB3_INFURA_API_SECRET'] = '087f0132e77840e1b47797a22d03ace9'

# python3 -m pip install web3
# https://github.com/ethereum/web3.py
from web3.auto.infura import w3
from Crypto.Hash import keccak # pycryptodome 


def exploit():
    assert w3.isConnected()
    latest_block = w3.eth.getBlock("latest")
    latest_block_hash = latest_block["hash"]

    keccak256 = keccak.new(digest_bits=256)
    keccak256.update(latest_block_hash)


if __name__ == "__main__":
    exploit()

