Skip to content

Instantly share code, notes, and snippets.

pragma solidity ^0.5.16;
contract curve {
// xp : amount of tokens, array
// A : amplification coefficient
function get_D(uint256[] memory xp, uint256 A) public pure returns(uint256) {
uint256 N_COINS = xp.length;
uint256 S = 0;
for(uint256 i = 0; i < N_COINS; i++)
S += xp[i];
if(S == 0) return 0;
@artistic709
artistic709 / gnosis_wallet_dxn.md
Created April 26, 2019 10:34
Using Gnosis Multisig Wallet on DEXON
@artistic709
artistic709 / JD.md
Last active June 28, 2019 06:30
Pelith Job Description

Pelith Job Description (已徵得)

公司簡介

Pelith 沛理科技股份有限公司

Pelith 是一個充滿活力的年輕團隊,成員平均年齡 24 歲,專攻以太坊智慧合約以及區塊鏈相關應用開發。2018 年已經成功開發三個成熟的區塊鏈產品,撰寫與稽核超過十個運作中智慧合約,並與 ACCUPASS 活動通合作新平台 EvenToken,發行了專用的實體卡片。

工作職缺

contract Coin {
address public minter;
mapping (address => uint) public balances;
event Sent(address from, address to, uint amount);
function Coin() {
minter = msg.sender;
}
var Web3 = require('web3');
var web3 = new Web3(); //web3 provider
var privateKeys=[] //load private keys from DB
for(var i in privateKeys){
web3.eth.accounts.privateKeyToAccount(i);
}
var accounts = web3.eth.accounts;
@artistic709
artistic709 / reward.py
Created July 17, 2017 22:04
Stimulates a miner switching between RBPPS pool and PPS pool.
import random
selfshare = 0.0
totalshare = 0.0
x=0.9
y=0.09
z=0.01
selfreward=0.0
poolreward=0.0