Skip to content

Instantly share code, notes, and snippets.

View partylikeits1983's full-sized avatar
🧮

Alexander John Lee partylikeits1983

🧮
View GitHub Profile

Basic usable compiler:

Level 1: Math & Pure functions:

For simplicity it would be sufficient to have a pure Rust to MASM compiler.

There's probably already a way to run the compiler, but this is just an example of how it would work.

midenc some_rust_file.rs masm_output.masm
@partylikeits1983
partylikeits1983 / semaphore-v4-ceremony_attestation.log
Created June 17, 2024 14:16
Attestation for Semaphore V4 Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm partylikeits1983-77119221 and I have contributed to the Semaphore V4 Ceremony.
The following are my contribution signatures:
Circuit # 1 (semaphorev4-1)
Contributor # 150
Contribution Hash: 756fc24b 2b924f79 dbf8ee7d 607359da
9dd1d569 de715387 a9b4952f 7f29c495
dd6681a8 6e8cef1b 7a6a65d8 4ec65cef
607e47df 9b00b213 a04e077d d28496d6
// SPDX-License-Identifier: MIT
/*
_____ _ ______ _ _
/ ____| | | ____(_) | |
| | | |__ ___ ___ ___| |__ _ ___| |__
| | | '_ \ / _ \/ __/ __| __| | / __| '_ \
| |____| | | | __/\__ \__ \ | | \__ \ | | |
\_____|_| |_|\___||___/___/_| |_|___/_| |_|
// Generating a new deterministic wallet based upon the
// gameAddress and the hash of the user signature of the gameAddress
export const generateWallet = async (
chainId: number,
gaslessGameAddress: string,
gameAddress: string,
): Promise<ethers.Signer> => {
const provider = new ethers.providers.Web3Provider(window.ethereum);
let signer = provider.getSigner();
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract DelegatedSignature {
// gameAddress => uint16 moves
mapping(address => uint16[]) public userData; // on chain data
@partylikeits1983
partylikeits1983 / DelegatedSignature
Created December 3, 2023 09:49
DelegatedSignature.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract DelegatedSignature {
// gameAddress => uint16 moves
mapping(address => uint16[]) public userData; // on chain data
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Token is ERC20 {
uint constant _initial_supply = 100 * 1e18 * 1e6; // 100 million
@partylikeits1983
partylikeits1983 / pi.py
Created April 20, 2022 21:05
calculatingPi
def GLSpi(x):
odd = []
pi_div_4 = []
for i in range(x):
if i % 2 == 1:
odd.append(i)
for i in range(len(odd)):
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract DefintionHackathonPrizeMoney {
//@dev address Owner => address token => uint balance of token
mapping(address => mapping (address => uint)) public prizeMoney;
pragma solidity >=0.7.0 <0.9.0;
contract natural_log {
function log2(uint x) public pure returns (uint){
uint y;
assembly {
let arg := x
x := sub(x,1)