Skip to content

Instantly share code, notes, and snippets.

View lifepod.age
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNjcnlwdCA0RWZGbHRLZE5sbFVpUVRX
NFM4dnNRIDE4Cm94YW5nMTdSdjVjRVJhdlRNRDdPbVdySXRBRVhhT0FUMmhUTUtO
d0oveEUKLS0tIEYrQmVZbTNpSDc5S0VodjcwOWRlOXFLMXhoU3o0anZONDY2NXdy
b0tMdVUKTh5KSjzxdFrXWef3mgDJd7iJov2bqwqepm9W4U7G+I6axMtSn4rW3FoH
cbvF+bDXy3SpySSYT21Gz97oerPpsBtH3A9sxYJ3/wDeB0G27+mbl2v6mqtpdIAR
8j7rfwCDfRxg9Ot2FBTkg2f2ReRPw6ZEZ69gJJe1620Lj3WofaQp4gw6o3maDlPN
53fm7TbR5zVVGvOkYfNH2mbAhW0PKjOLRV+bBG254RW+RxToV4esb8IPXblX0mH/
2bsXl0M4kocNiK94UI/uGSlzmZNlRMMVrz9Mg/Km4Cz6cQALkqX45WY5W8mfQjb2
A7s/n/hui1Y7cf6SUmxhZxLsON0NgCc8JwdWVpnDFqrCj/WB5xIjQhhiQQOEhGI2
@hayeah
hayeah / gist:d312704cd62ef8d5ae5e8ca243128820
Created Sep 6, 2019
edgeware lock contract expire time
View gist:d312704cd62ef8d5ae5e8ca243128820
curl https://mainnet.infura.io/v3/$INFURA_TOKEN \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0","method":"eth_getStorageAt","params": ["'$CONTRACT_ADDRESS'", "0x01", "latest"],"id":1}'
@hayeah
hayeah / fomo.sol
Created Aug 6, 2018
fomo3d contract
View fomo.sol
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* (, / /) /) /) (, / /) /)
* ┌─┐ / _ (/_ // // / _ // _ __ _(/
* ├─┤ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_
@hayeah
hayeah / 4.3.md
Created Jan 25, 2018
yellopaper rewritten with source code references
View 4.3.md

4.3 The Block

The block in Ethereum is the collection of relevant pieces of information (known as the block header), together with information corresponding to the comprised transactions, and a set of other block headers that are known to have a parent equal to the present block’s parent’s parent (such blocks are known as uncles).

https://sourcegraph.com/github.com/ethereum/go-ethereum@479aa61f11724560c63a7b56084259552892819d/-/blob/core/types/block.go#L139

type Block struct {
	header       *Header
	uncles       []*Header
@hayeah
hayeah / evmlog.json
Created Jan 6, 2018
EVM Log Example
View evmlog.json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x507e86b11541bcb1f3fe200b2f10ed8fd9413bd0",
"topics": [],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x179097",
"transactionHash": "0x0e88c5281bb38290ae2e9cd8588cd979bc92755605021e78550fbc4d130053d1",
View heybase.md

Keybase proof

I hereby claim:

  • I am hayeah on github.
  • I am hayeah (https://keybase.io/hayeah) on keybase.
  • I have a public key ASBpckIkqnmmb21RzMBwBtJT7cVFiT3Ao2II38VBl2wrTwo

To claim this, I am signing this object:

@hayeah
hayeah / c-create-contract.sol.asm
Created Oct 17, 2017
c-create-contract.sol.asm
View c-create-contract.sol.asm
======= c-create-contract.sol:FooFactory =======
EVM assembly:
/* "c-create-contract.sol":44:150 contract FooFactory {... */
mstore(0x40, 0x60)
jumpi(tag_1, iszero(callvalue))
0x0
dup1
revert
tag_1:
tag_2:
View HODL.sol
contract HODL {
uint256 amount;
uint releaseAt;
uint createdAt;
address owner;
modifier canRelease() {
// 当前时间超过了 HODL 期限即可取款
// 或者 7 天内后悔了
require(now > releaseAt || (now - createdAt < 7 days));
View gist:bd37a123c02fecffbe629bf98a8391df
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD
@hayeah
hayeah / gist:52b67ee963066ef66b727bf005930add
Last active Aug 9, 2018
EVM Homstead Instruction Set
View gist:52b67ee963066ef66b727bf005930add
0x00 STOP
0x01 ADD
0x02 MUL
0x03 SUB
0x04 DIV
0x05 SDIV
0x06 MOD
0x07 SMOD
0x08 ADDMOD
0x09 MULMOD
You can’t perform that action at this time.