Skip to content

Instantly share code, notes, and snippets.

View poc.sol
// Store.sol
pragma solidity >0.5.9;
contract Store {
uint256 internal value;
// 5247 energy
function reset() external {
value = 0;
@andelf
andelf / Microsoft.PowerShell_profile.ps1
Last active Jul 21, 2020
Powershell with vcvars64.bat
View Microsoft.PowerShell_profile.ps1
Import-Module 'C:\Users\mono\Repos\vcpkg\scripts\posh-vcpkg'
Set-PSReadLineOption -EditMode Emacs
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Environment variables
$Env:Path = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
# $Env:Path += ";C:\Windows\System32\WindowsPowerShell\v1.0\"
@andelf
andelf / evm_test.rs
Created Jun 28, 2020
How to use the evm crate
View evm_test.rs
extern crate evm;
extern crate hex;
extern crate primitive_types;
use evm::backend::{MemoryBackend, MemoryVicinity, MemoryAccount};
use primitive_types::{H160, U256};
use std::error::Error;
use std::collections::BTreeMap;
use evm::executor::StackExecutor;
use evm::{Config, Runtime, Context};
@andelf
andelf / main.rs
Created May 14, 2020
Embed Deno in Rust
View main.rs
use deno_core::Op;
use deno_core::ZeroCopyBuf;
use deno_core::{CoreIsolate, StartupData};
use std::str;
fn main() {
println!("v8 version: {}", deno_core::v8_version());
let mut isolate = CoreIsolate::new(StartupData::None, false);
@andelf
andelf / trc20-offline-sign.js
Last active Apr 20, 2020
Send TRX20 token, sign offline
View trc20-offline-sign.js
const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
// const fullNode = new HttpProvider("http://192.168.1.162:8090");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145";
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);
@andelf
andelf / trc20.js
Created Apr 20, 2020
Get TRC20 balance and transfer USDT tokens
View trc20.js
const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
// const fullNode = new HttpProvider("http://192.168.1.162:8090");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145";
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);
@andelf
andelf / send-trx.py
Created Mar 31, 2020
Send trx and sign offline
View send-trx.py
from time import time as unix_time
from pprint import pprint
import requests
import hashlib
import base58
import ecdsa
from eth_hash.auto import keccak as keccak_256
@andelf
andelf / trc20.py
Created Feb 28, 2020
Get TRC20 balance and Transfer TRC20 tokens
View trc20.py
import requests
import base58
import base64
from pprint import pprint
ADDRESS = "T....your address"
PRIV_KEY = 'hex private key'
CONTRACT = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" # USDT
View split-transaction-raw.py
# define P1_FIRST 0x00
# define P1_MORE 0x80
# define P1_LAST 0x90
from google.protobuf.internal.decoder import _DecodeVarint32
from base import parse_bip32_path
View .tmux.conf
#设置终端颜色为256色
set -g default-terminal "screen-256color"
# auto resize to smallest windows size
setw -g aggressive-resize on
# Terminal emulator window titles
set -g set-titles on
set -g set-titles-string "#T"
#将激活控制台的快捷键由Ctrl+b修改为Ctrl+z
You can’t perform that action at this time.