Skip to content

Instantly share code, notes, and snippets.

View johnashu's full-sized avatar

John Ashurst - Maffaz.eth johnashu

View GitHub Profile
import json
import os
class Abi2Interface:
solidity_version = "0.8.19"
def get_in_or_out(self, inputs):
return ", ".join(
[
@johnashu
johnashu / unRoll.py
Created May 3, 2023 11:44
Create Yul logic to 'Unroll' arrays to save gas.
asm = "\t\tsum := add(sum, calldataload(add(weights, {})))\n"
arrayLen = 5
hexAdd = 0x20
name = 'weights'
unrolled = ""
for x in range(1, arrayLen):
added = hexAdd * x
@johnashu
johnashu / bnb_network.csv
Last active February 5, 2023 12:00
BNB Network details
Field Value to enter
Network Name Bsc Smart Chain
New RPC URL https://bsc-dataseed.binance.org/
ChainID 56
Symbol BNB
Block Explorer URL https://bscscan.com
@johnashu
johnashu / map_network.csv
Last active February 5, 2023 11:59
Network Details for the MapO Protocol
Field Value to enter
Network name MAP Mainnet
New RPC URL https://rpc.maplabs.io
Chain ID 22776
Currency symbol MAP
Block explorer URL https://maposcan.io
@johnashu
johnashu / High-Stakes Roulette Example
Created January 20, 2022 20:12 — forked from gorgos/High-Stakes Roulette Example
Example for a contract for playing high-stakes Roulette on the blockchain
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BankOwned {
address public bankAddress;
constructor() {
bankAddress = msg.sender;
}
@johnashu
johnashu / keybase.md
Created February 15, 2021 14:11
Keybase Proof

Keybase proof

I hereby claim:

  • I am johnashu on github.
  • I am maffaz (https://keybase.io/maffaz) on keybase.
  • I have a public key whose fingerprint is 2B75 C15F C43D A4E7 B692 A612 7DA3 70CC 5344 A45B

To claim this, I am signing this object:

arri = [32, 23, 542, 25, 25, 3254, 234]
arri2 = [432, 52, 53, 523, 532, 52]
arri3 = [7, 52, 53, 7, 532, 7]
def n():
print('\n\n')
n = n()
class timesby():