Skip to content

Instantly share code, notes, and snippets.

View sixTheDave's full-sized avatar

sixTheDave

View GitHub Profile
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.17;
contract PMC_2022_Hall_of_Fame {
mapping(uint256 => string) teams; // Teams, uint256 is their final position, eg. 1 = first, top winner
mapping(uint256 => string) players; // Players, uint256 is the positing they finished in, eg. players from the position 1st team.
string judge_favorites;
string community_choice;
from forge import *
hsh = '0xe50051a0af89748fe098cef3b163b6dc586a664e726791bb2a582ad364f42683'
sig = '0x2bdbc1826efc039719a28a9f4dbab9f4a2692d83de478300261a0e49019b63ee67c202ecc4ebdf82693da47824ac4fcf21f793400d85696034c4de9537c6ce491b'
pub = recover_public_key(hsh, sig)
addr = pub.to_checksum_address()
print('recovered (checksum) address:', addr)
a, b = 0, 1
from eth_account.account import to_standard_signature_bytes
from eth_keys import keys
from eth_utils import (big_endian_to_int, to_bytes)
from hexbytes import HexBytes
from eth_keys.backends.native.jacobian import (inv, fast_multiply, fast_add)
from eth_keys.constants import (SECPK1_G as G, SECPK1_N as N)
def recover_public_key(message_hash, signature):
message_hash_bytes = HexBytes(message_hash)
if len(message_hash_bytes) != 32: