| author | date |
|---|---|
Péter Garamvölgyi |
2025-01-10 |
Run dev network:
# set to an L1 node RPC
eth_rpc=""
# run 7702-enabled local forked network
anvil --fork-url "$eth_rpc" --auto-impersonate --odysseyLast update: May 1, 2021
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| build | |
| $ cargo build --release --features final | |
| run a dev node | |
| $ ../target/release/openethereum --chain dev --jsonrpc-cors="*" | |
| deploy contract | |
| ```sol | |
| contract Storage { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| example-1: | |
| ---------- | |
| cache: {} | |
| > create checkpoint #0 | |
| > write k=1 v=2 | |
| cache: { 1: (original = 1, current = 2) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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: |