Skip to content

Instantly share code, notes, and snippets.

Miao ZhiCheng hellwolf

Block or report user

Report or block hellwolf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e31f603f87cb0fa30b9a212d24ffdc03
### Keybase proof
I hereby claim:
* I am hellwolf on github.
* I am hellwolf ( on keybase.
* I have a public key ASDp-pJdZFPC_pAoE-6UzzywqGo1frs3weSoDhzHVwEy0wo
To claim this, I am signing this object:
hellwolf / IRToken.sol
Created Oct 18, 2019
IRToken.sol for remix editor
View IRToken.sol
// File: contracts/RTokenStructs.sol
pragma solidity ^0.5.8;
contract RTokenStructs {
* @notice Global stats
struct GlobalStats {
View rtoken-snippet.sol
* @notice Sender supplies assets into the market and receives rTokens in exchange
* @param mintAmount The amount of the underlying asset to supply
* @return uint 0=success, otherwise a failure
function mint(uint256 mintAmount) external returns (bool);
* @notice Sender redeems rTokens in exchange for the underlying asset
* @param redeemTokens The number of rTokens to redeem into underlying
View cDAI.sol
pragma solidity >=0.4.21 <0.6.0;
// converted from cDAI.json
contract cDAI {
function name() external returns (
string memory
function approve(
address spender,
hellwolf / abi-to-sol.js
Last active Jul 28, 2019
Convert ABI to solidity file
View abi-to-sol.js
* Convert ABI json file to solidity interface contract
const fs = require('fs');
const args = process.argv.slice(2);
function convert(inputFilename) {
const abi = JSON.parse(fs.readFileSync(inputFilename, 'utf8'));
View mail.php
$SECRET = '....';
header("Content-type: application/json");
if ($_GET["secret"] != $SECRET) {
echo json_encode(array(
"success" => false,
"status_code" => 401
hellwolf /
Created Apr 7, 2019
test ecdh1 derive mechanism
openssl pkeyutl -derive -inkey new-secp384r1-private-key.pem -peerkey XXXXXXXX-pin1-public-key.pem | xxd -p | tr '\n' '|' | sed 's/|//g'
pkcs11-tool --derive --token-label PIN1 --login --id 01 -m ECDH1-DERIVE --input-file new-secp384r1-public-key.der --output-file >(xxd -p | tr '\n' '|' | sed 's/|//g')
hellwolf /
Created Apr 7, 2019
Generate secp384r1 key pairs
openssl ecparam -name secp384r1 -genkey -noout -out new-secp384r1-private-key.pem
openssl ec -in new-secp384r1-private-key.pem -pubout -outform DER -out new-secp384r1-public-key.der
hellwolf /
Last active Oct 25, 2019
Estonian residents of the same birthday
YOUR_BIRTHDAY=YYMMDD;for a in 3 4;do
for i in `seq 9999`;do
kood=${a}${YOUR_BIRTHDAY}$(printf %04d $i)
found=$(ldapsearch -x -H ldaps:// -b c=EE "(serialNumber=PNOEE-$kood)" | sed -n 's/cn::\? \(.*\)$/\1/p' | uniq)
[ -z "${found%%*=}" ] && found=`echo $found|base64 -d`;[ ! -z "$found" ] && echo $kood $found;
hellwolf /
Created Feb 19, 2019
Truffle minimize json artifacts
#!/usr/bin/env bash
# Notes:
# - Shchema:
# - bytecode vs deployedBytecode:
for i in "$1"/*.json;do
[ -z "${i%%*.min.json}" ] && continue # already minified
echo "Minimizing truffle json artifact: $i"
echo "Original size: $(wc -c "$i")"
You can’t perform that action at this time.