Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Magicking's full-sized avatar

Sylvain Laurent Magicking

View GitHub Profile
#!/usr/bin/env python
import random
import csv
from github import Github
# Authentication is defined via github.Auth
from github import Auth
# using an access token
@Magicking
Magicking / pngdecoder.sol
Created August 17, 2023 13:05
PNG decoding headers in Solidity
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "inflate-sol/InflateLib.sol";
import "solidity-bytes-utils/BytesLib.sol";
import "./BMPEncoder.sol";
library CRC32 {
// SPDX-License: BEER
pragma solidity ^0.8.0;
contract MyBigNFTStorage {
mapping(uint256 => string) public _SVGChunks;
uint256 ChunkCount;
// Limited to 25kb
function loadSVGChunk(uint256 id, string memory chunk) public {
// SPDX-License-Identifier: WTFPL
// Author: s@6120.eu
pragma solidity >=0.7.0 <0.9.0;
/**
* @title TxIndexRoll
* @dev Roll your place amongst the TxIndex top of your block
*/
contract TxIndexRoll {
@Magicking
Magicking / 0
Last active October 3, 2021 23:49
{
"title":"Asset Metadata",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"Mire"
},
"description":{
"type":"string",
PS C:\Users\Smith\Documents\codes\batchDeposit> pip3 install -U mythx-cli
Collecting mythx-cli
Using cached mythx_cli-0.6.22-py2.py3-none-any.whl (48 kB)
Collecting py-solc-x==1.0.0
Using cached py_solc_x-1.0.0-py3-none-any.whl (15 kB)
Requirement already satisfied, skipping upgrade: Jinja2==2.11.2 in c:\python39\lib\site-packages (from mythx-cli) (2.11.2)
Requirement already satisfied, skipping upgrade: PyYAML==5.3.1 in c:\python39\lib\site-packages (from mythx-cli) (5.3.1)
Collecting pythx==1.6.1
Using cached pythx-1.6.1-py2.py3-none-any.whl (39 kB)
Collecting htmlmin==0.1.12
@Magicking
Magicking / batchDeposit.sol
Last active December 12, 2020 11:17
Multi deposit contract
pragma solidity <=0.8.0;
pragma experimental ABIEncoderV2;
// Author: Sylvain Laurent
// Use Scribble https://docs.scribble.codes/tool/cli-usage#emitting-a-flat-instrumented-file to generate guards / arm the contract
// This interface is designed to be compatible with the Vyper version.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
interface IDepositContract {
/// @notice A processed deposit event.
PS C:\Users\Smith\Downloads\eth2.0-deposit-cli-master\eth2.0-deposit-cli-master> pip install -r .\requirements.txt
Collecting py-ecc==4.0.0
Downloading py_ecc-4.0.0-py3-none-any.whl (41 kB)
|████████████████████████████████| 41 kB 204 kB/s
Collecting pycryptodome==3.9.7
Downloading pycryptodome-3.9.7-cp38-cp38-win_amd64.whl (14.1 MB)
|████████████████████████████████| 14.1 MB 6.4 MB/s
Collecting click==7.0
Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
|████████████████████████████████| 81 kB 5.1 MB/s
%> virtualenv venv
%> source venv/bin/activate
%> pip install -r requirements.txt
%> pip install nuitka
%> python3 -m nuitka --follow-imports eth2deposit/deposit.py
%> file deposit.bin
deposit.bin: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d735055a6559231919cfd51fdbf4404eeb43149e, for GNU/Linux 3.2.0, stripped
.-~<02:59:42>~-.[~/source/gocode/src/github.com/ethereum/eth2.0-deposit-cli].magicking@emergence 2.24 176%
%> ls -l deposit.bin
-rwxr-xr-x 1 magicking magicking 11M Jul 28 02:58 deposit.bin
network: "/home/magicking/teku/config/chain.yaml"
### initial-state: "./genesis.ssz"
eth1-deposit-contract-address: "0x42cc0FcEB02015F145105Cf6f19F90e9BEa76558"
eth1-enabled: true
eth1-endpoint: "https://goerli.prylabs.net"
logging: "DEBUG"
log-color-enabled: true
log-include-events-enabled: true