Skip to content

Instantly share code, notes, and snippets.

View uzyn's full-sized avatar
🦄

U-Zyn Chua uzyn

🦄
View GitHub Profile
@uzyn
uzyn / freeze-staking-montecarlo.js
Last active July 19, 2021 21:05
Freeze staking Monte Carlo simulation
// Monte carlo simulation of long term staking
// Nodes distribution, regular, 5y, 10y
const CYCLES = 100000; // Increase this to run more simulations
const NODES = [1000, 1000, 1000]; // regular, 5y, 10y
const TARGET = 0.0012; // 0.12% of guesses win
// const COINAGE_EVERY = [24, 9, 5]; // 6 hours, 2h15m, 1h15m
const COINAGE_EVERY = [24, 24, 24]; // consistent
const SUBNODES = [2, 3, 4];
0xA8aB1A2ABB29E4bb9c4aefd42AE26471932Df3c7
0x412719c518935f1ec662a2b4c48c8baef2143451
0xFB43E5a34d4080F2199589EbBd5850B65fCa07F0
0x0f34a3f6065f47273f137b9c4d387116ac707c29
@uzyn
uzyn / Library.js
Last active January 9, 2017 04:51
Which is the preferred or trendy method for JS at this moment?
/**
* Method A: OOP
*/
class Library {
constructor() {
this.books = this.loadBooks();
}
add(newBook) {
const Web3 = require('web3');
const web3 = new Web3(
new Web3.providers.HttpProvider(
'http://localhost:8545'
)
);
web3;
web3.eth;
web3.eth.accounts;
@uzyn
uzyn / SGDT.sol
Last active April 16, 2018 17:13
pragma solidity ^0.4.2;
contract SGDT {
/* Public variables of the token */
string public name = 'Singapore Dollar Token';
string public symbol = 'SGDT';
uint8 public decimals = 2;
uint public totalSupply = 0;
address public authority;
Verifying that +uzynchua is my blockchain ID. https://onename.com/uzynchua

Keybase proof

I hereby claim:

  • I am uzyn on github.
  • I am uzyn (https://keybase.io/uzyn) on keybase.
  • I have a public key whose fingerprint is BFAA 1DC8 144A 5814 2733 F523 3FA0 C40D 1797 8A59

To claim this, I am signing this object: