Skip to content

Instantly share code, notes, and snippets.

@Thegaram
Thegaram / conflux_dev_resources.md
Created May 1, 2021 03:38
Conflux Network Developer Resources

Conflux Network Developer Resources

Last update: May 1, 2021

Intro

Conflux Network is a PoW blockchain that achieves 3000+ transactions per second (TPS) through the DAG-based (directed acyclic graph) Tree-Graph algorithm.

For developers:

  • PoW is a proven consensus mechanism for large scale blockchain networks
  • High TPS means transaction fees will be significantly lower
@Thegaram
Thegaram / index.js
Created September 18, 2020 12:15
cfx-lecture-3-examples
const Account = require('js-conflux-sdk/src/account');
const assert = require('assert');
const { Conflux, Drip, Message, util } = require('js-conflux-sdk');
async function main() {
// ---- generate random private key ----
const privkey = util.sign.randomPrivateKey();
console.log('private key:', util.format.hex(privkey));
// ---- derive public key ----
@Thegaram
Thegaram / evm-tracing-0.1
Last active August 19, 2020 17:51
evm-tracing-0.1
build
$ cargo build --release --features final
run a dev node
$ ../target/release/openethereum --chain dev --jsonrpc-cors="*"
deploy contract
```sol
contract Storage {
@Thegaram
Thegaram / state-db-checkpoint-example
Last active August 19, 2020 11:13
state-db-checkpoint-example
example-1:
----------
cache: {}
> create checkpoint #0
> write k=1 v=2
cache: { 1: (original = 1, current = 2) }
/*
Source: ConsenSys (https://github.com/ConsenSys/Tokens/blob/fdf687c69d998266a95f15216b1955a4965a0a6d/contracts/eip20/EIP20.sol)
*/
pragma solidity ^0.5.11;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
/*
Source: ConsenSys (https://github.com/ConsenSys/Tokens/blob/fdf687c69d998266a95f15216b1955a4965a0a6d/contracts/eip20/EIP20.sol)
*/
pragma solidity ^0.5.11;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
/*
Source: ConsenSys (https://github.com/ConsenSys/Tokens/blob/fdf687c69d998266a95f15216b1955a4965a0a6d/contracts/eip20/EIP20.sol)
*/
pragma solidity ^0.5.11;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with: