Git Product home page Git Product logo

polymesh's Introduction

Discord Twitter Follow

Polymesh

Polymesh Blockchain

Polymesh is a blockchain for regulated securities and open finance.

Whitepaper

https://info.polymesh.network/hubfs/Files/Polymesh-Whitepaper.pdf

Audit

See the audit folder for details of audits undertaken on the Polymesh code base.

Independent audits were completed by:
https://www.srlabs.de/
https://www.atredis.com/

Networks

We run two public networks, the mainnet and the testnet.

Generally these two networks will be at the same version of Polymesh, although they may differ briefly during an upgrade cycle.

We provide linux binaries for each release.

The latest release for Polymesh can be found at:
https://github.com/PolymeshAssociation/Polymesh/releases

Generally you should be able to run the latest release for both networks, although the on-chain version of the network might differ during upgrade cycles.

Below are simple instructions for running a non-operating node (i.e. a node that does not produce blocks or vote on the correctness of other blocks).

For more details on monitoring infrastructure for nodes and running an operator node, see the https://github.com/PolymeshAssociation/polymesh-tools repository.

Polymesh Testnet

The Testnet does not offer incentives to users to participate and test with it. It has a simple onboarding process (no-KYC required) and a bridge allowing test KOVAN based POLY to be bridged to testnet POLYX.

The testnet also includes the testUtils pallet that allows easier onboarding for testing, and in addition each new account will receive 100,000 POLYX for testing purposes.

To run a node which connects to the Testnet, you can start your node with:

./target/release/polymesh --chain testnet

Polymesh Mainnet

The public mainnet is the official Polymesh blockchain. Onboarding requires users to go through a simple KYC process (called Customer Due Diligence or CDD) in order to access the network.

ERC20 POLY can be bridged from Ethereum to the Polymesh Mainnet.

To run a node which connects to the Mainnet, you can start your node with:

./target/release/polymesh --chain mainnet

Operators (aka Validators)

A guide to running an operator node can be found at:

https://github.com/PolymeshAssociation/polymesh-tools/tree/main/docs/operator

Documentation

Further details on Polymesh concepts and networks can be found at:

https://developers.polymesh.network/

Code documentation can be found at:

https://docs.polymesh.live/

Build

To prepare your development environment with the required compiler and tools refer to https://docs.substrate.io/main-docs/install/ for instructions applicable to your operating system.

Build Wasm and native code:

cargo build --release

Run unit tests:

./scripts/test.sh

Branches

  • The mainnet branch tracks code deployed to the Polymesh Public Mainnet.
  • The testnet branch tracks code deployed to the Polymesh Public Testnet.
  • The staging branch tracks mainnet except during a release cycle where it is upgraded ahead of mainnet.
  • The tooling branch tracks the next candidate release for mainnet.
  • The develop branch is the working branch with the latest code changes.

Development

Single node development chain

You can start a development chain with:

./target/release/polymesh --dev

Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/polymesh --dev.

To access the Polymesh Chain using the Web Interface do the following:

  1. Click on the Polymesh logo in the top-left corner of the UI. You can then select "Local Node" under the Development section.

    Note: if the polymesh node above is on a different machine than your browser (e.g., a server on your local network), you'll need to use a "custom endpoint", e.g., ws://192.168.0.100:9944/. The Web Interface uses https, but your polymesh instance does not, so you'll need ws:// as opposed to wss://. You'll also need to use http://httpapp.polymesh.live/ instead of Web Interface. Otherwise, you'll have problems with mixed-content blocking (https vs. http). Finally, add --rpc-external --ws-external --rpc-cors all to the polymesh invocation above.

  2. If you have custom types definitions that differ from the Polymesh Testnet, you can update these in Settings tab under the Developer section.

  3. Reload the page.

Multi-node local testnet

If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with testnet units.

cd scripts/cli
npm install
./run.sh

This uses pm2 to run a local three node network for demonstrate simple consensus.

To stop the chain you can use:

./stop.sh

and to display log files you can use:

./log.sh

Unit Tests

Unit tests are packaged with the Rust code. To run these, you can execute:

cargo test --package polymesh-runtime-tests  --features default_identity
cargo test --package pallet-staking
cargo test --package pallet-balances
cargo test --package polymesh-primitives
cargo test --package pallet-pips-rpc
cargo test --package pallet-transaction-payment

Initialise

You can seed the network with some identities, claims, signing keys and assets by running the functional test.

cd scripts/cli
node run test

See README for details.

Benchmarks

Polymesh runtime benchmarks can be run with a command that specifies the pallet and the name of the extrinsic to be benchmarked, for example:

cargo run --release --features runtime-benchmarks -- \
    benchmark pallet -p="*" -e="*"

Note that the CLI binary should be built in release mode and that the feature flag runtime-benchmarks should be set to enable the CLI option benchmark.

Debug

Environment

Install GDB for your distribution.

Build

Binary should be built in debug mode, using cargo build without --release parameter:

cargo build

Test cases are built in debug mode by default.

Using GDB

Using rust-gdb you will get pretty printed values for more types than directly with gdb.

The following example, starts gdb, sets a breakpoint, and starts our compiled polymesh:

$> rust-gdb ./target/debug/polymesh
GNU gdb (Ubuntu 8.2.91.20190405-0ubuntu3) 8.2.91.20190405-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./target/debug/polymesh...

(gdb) b balances/src/lib.rs : 390
Breakpoint 1 at 0x2b792d0: balances/src/lib.rs:390. (2 locations)

(gdb) run --dev
Starting program: ./target/debug/polymesh --dev
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2020-02-26 12:48:37 Running in --dev mode, RPC CORS has been disabled.
2020-02-26 12:48:37 Polymesh Node
...

License

LICENSE

Substrate Framework

Polymesh is built using the Substrate Framework.

Polymesh

Polymesh Website

polymesh's People

Contributors

adamdossa avatar aditya520 avatar centril avatar cjp10 avatar cwsatpolymath avatar dependabot[bot] avatar drozdziak1 avatar f-obrien avatar fahdw avatar fmiguelgarcia avatar henriquenogara avatar jesseabram avatar jmoore96 avatar kigawas avatar maxsam4 avatar monitz87 avatar neopallium avatar pabloruiz55 avatar parnianalimi avatar polymath-eric avatar raycar5 avatar satyamakgec avatar satyamsb avatar vkandy avatar vkomenda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polymesh's Issues

polymesh alcyone node crashes

when I start the polymesh alcyone node it crashes and I get the following errors

Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.593 main INFO polymesh::command Reserved nodes: []
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner Polymesh Node
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ✌️ version 2.0.0
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ❤️ by Anonymous, 2017-2020
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 📋 Chain specification: Polymesh Alcyone Testnet
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 🏷 Node name: pathrock
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 👤 Role: AUTHORITY
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner 💾 Database: RocksDb at /root/.local/share/polymesh/chains/alcyone/db
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.594 main INFO sc_cli::runner ⛓ Native runtime: polymesh-2000 (polymath-polymesh-0.tx1.au1)
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.649 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWJkY8di7yUCLhrNVwPoxm26fbEEoaZBW6SbNdX3QxipKo (legacy representation: QmSkJyXwgs5NBzqVndL55xsQSZsBNzan3QNmFpcDteqFmJ)
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.659 main INFO sc_service::builder 📦 Highest known block at #1008
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.660 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.664 main WARN sc_service Unable to bind RPC server to 0.0.0.0:9933. Trying random port.
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.673 main WARN sc_service Unable to bind RPC server to 127.0.0.1:9944. Trying random port.
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.676 main INFO babe 👶 Starting BABE Authorship worker
Oct 02 18:57:06 vmd48751.contaboserver.net polymesh[8369]: 2020-10-02 18:57:06.678 tokio-runtime-worker ERROR sub-libp2p 📪 Libp2p listener () closed: Address already in use (os error 98)
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: ====================
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: Version: 2.0.0
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 0: sp_panic_handler::set::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 1: std::panicking::rust_panic_with_hook
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/panicking.rs:530
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 2: std::panicking::begin_panic
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 3: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllModules,COnRuntimeUpgrade>::execute_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 4: <polymesh_runtime_testnet::runtime::Runtime as sp_api::runtime_decl_for_Core::Core<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<<pallet_indices::Module<polymesh_runtime_testnet::runtime::Runtime> as sp_runtime::traits::StaticLookup>::Source,polymesh_runtime_testnet::runtime::Call,sp_runtime::MultiSignature,(frame_system::extensions::check_spec_version::CheckSpecVersion<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<polymesh_runtime_testnet::runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<polymesh_runtime_testnet::runtime::Runtime>,pallet_transaction_payment::ChargeTransactionPayment<polymesh_runtime_testnet::runtime::Runtime>,pallet_permissions::StoreCallMetadata<polymesh_runtime_testnet::runtime::Runtime>)>>>>::execute_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 5: sp_api::runtime_decl_for_Core::execute_block_native_call_generator::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 6: std::thread::local::LocalKey::with
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 7: sc_executor::native_executor::WasmExecutor::with_instance::{{closure}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 8: sc_executor::wasm_runtime::RuntimeCache::with_instance
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 9: <sc_executor::native_executor::NativeExecutor as sp_core::traits::CodeExecutor>::call
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 10: sp_state_machine::StateMachine<B,H,N,Exec>::execute_aux
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 11: sp_state_machine::StateMachine<B,H,N,Exec>::execute_using_consensus_failure_handler
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 12: <sc_service::client::call_executor::LocalCallExecutor<B,E> as sc_client_api::call_executor::CallExecutor>::contextual_call
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 13: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt>::call_api_at
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 14: sp_api::runtime_decl_for_Core::execute_block_call_api_at
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 15: sp_api::Core::execute_block_with_context
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 16: <&sc_service::client::client::Client<B,E,Block,RA> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 17: <sc_finality_grandpa::import::GrandpaBlockImport<BE,Block,Client,SC> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 18: <sc_consensus_babe::BabeBlockImport<Block,Client,Inner> as sp_consensus::block_import::BlockImport>::import_block
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 19: sp_consensus::import_queue::import_single_block_metered
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 20: <futures_util::future::poll_fn::PollFn as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 21: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 22: <futures_util::future::future::Then<Fut1,Fut2,F> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 23: <futures_util::future::poll_fn::PollFn as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 24: <sc_service::task_manager::prometheus_future::PrometheusFuture as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 25: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 26: <core::future::from_generator::GenFuture as core::future::future::Future>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 27: std::thread::local::LocalKey::with
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 28: futures_executor::local_pool::block_on
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 29: tokio::loom::std::unsafe_cell::UnsafeCell::with_mut
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 30: std::panicking::try
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 31: tokio::runtime::task::harness::Harness<T,S>::poll
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 32: tokio::runtime::blocking::pool::Inner::run
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 33: tokio::runtime::context::enter
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 34: std::sys_common::backtrace::__rust_begin_short_backtrace
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 35: core::ops::function::FnOnce::call_once{{vtable.shim}}
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 36: <alloc::boxed::Box as core::ops::function::FnOnce>::call_once
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/liballoc/boxed.rs:1081
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: <alloc::boxed::Box as core::ops::function::FnOnce>::call_once
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/liballoc/boxed.rs:1081
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: std::sys::unix::thread::Thread::new::thread_start
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: at /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/sys/unix/thread.rs:87
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 37: start_thread
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: 38: __clone
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: Thread 'tokio-runtime-worker' panicked at 'InvalidTransaction custom error', /rustc/d6953df14657f5932270ad2b33bccafe6f39fad4/src/libstd/macros.rs:13
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: This is a bug. Please report it at:
Oct 02 18:57:07 vmd48751.contaboserver.net polymesh[8369]: https://github.com/PolymathNetwork/polymesh/issues/new

have you got a fix for this?

MESH-114 ⁃ Improve CappedSTO

There's a barebones Capped STO which needs:

  • Validate that investor is whitelisted
  • If purchase exceeds cap, don't revert. Instead buy up to the limit and refund excess
  • Unrelated a bit but: add verify_transfer checks to mint and burn
  • Add pausing
  • Add event emission on purchase
  • Discuss if we should store the investments in an array of Investment for access
  • Allow ERC20 tokens to be accepted as payment once that part is done

cargo --release : error : could not compile `frame-support`.

I pulled master branch command

cargo build --release

Got following error.

   Compiling sp-consensus-babe v0.8.0-alpha.3 (https://github.com/paritytech/substrate?rev=a439a7aa5a9a3df2a42d9b25ea04288d3a0866e8#a439a7aa)
  error[E0424]: expected value, found module `self`
     --> /Users/achiko/.cargo/git/checkouts/substrate-7e08433d4c370a21/a439a7a/frame/support/src/traits.rs:763:11
      |
  761 | / bitmask! {
  762 | |     /// Reasons for moving funds out of an account.
  763 | |     #[derive(Encode, Decode)]
      | |              ^^^^^^ `self` value is a keyword only available in methods with a `self` parameter
  764 | |     pub mask WithdrawReasons: i8 where
  ...   |
  779 | |     }
  780 | | }
      | |_- this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
      |
      = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

  error: aborting due to previous error

  For more information about this error, try `rustc --explain E0424`.
  **error: could not compile `frame-support`.**

  To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Contracts pallet notes

Dumping some discussion notes for new contracts pallet here.

  • State incentivation: paritytech/substrate#9807
    • deposit = storage_used_before - storage_used_after
    • Add a deposit_limit field which limits how much balance is allowed to be deposited as part of the call.
  • Add storage deposit, paritytech/substrate#10082 [UNMERGED]
  • State rent was removed in paritytech/substrate#9669 (september).
    • The biggest change is that the concept of a tombstone is gone.
    • The TombstoneDeposit is renamed to ContractDeposit and is a deposit a deployer needs to deposit into the new contract on top of the ExistentialDeposit (no change to the previous behavior).
  • paritytech/substrate#9276

MESH-160 ⁃ Create script that puts the blockchain in certain state

For manual testing new features I find myself always repeating the same steps:

  • Dave using Identity module to set Alice as issuer (of asset and erc20), Bob and Charles as investors
  • Creating an asset with 100k total supply
  • Creating an erc20 token with 100k total supply
  • Whitelisting Alice, Bob, Charles
  • Transferring 20% of tokens to Bob, transferring 30% of tokens to Charles

[Question] When will there be a coin burning?

I watch POLYX USDT and see that the number of Circulating supply coins is growing every day, thereby the price of the cryptocurrency is falling. I would like to know when new coins will stop being issued or existing ones will be burned so that the price of cryptocurrency will rise and not fall?

MESH-150 ⁃ Transfer accounting approach to dividends

On dividends, I am moving towards a view that doing a "transfer accounting" method rather than using snapshots might be cleaner and more applicable. "transfer accounting" can manage lots of small dividends and moves the cost more towards an ongoing model rather than a large gas cost to pay out the dividend. By "transfer accounting" I mean approaches like:
https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
https://github.com/Roger-Wu/erc1726-dividend-paying-token/tree/master/contracts
Thoughts? I think we should retain snapshot functionality for things like governance, but possibly support both methods for dividends / capital distribution.
NB - not aiming to de-railing the current dividend approach which can use snapshots, but just putting this out there for future tasks.

MESH-88 ⁃ Basic Dividends implementation

As an Issuer,

I want to distribute dividends to my investors,

So that I can provide them with the incentives for their investment.

AC

Issuer should be able to:

  • Create a dividend distribution associated with an existing or new checkpoint
  • Send either poly (native currency) or any existing ERC20 token as dividend currency to be paid to tokenholders
  • Calculate how much money each tokenholder should receive based on total supply and balance of that tokenholder
  • Push calculated dividends to tokenholders

MESH-149 ⁃ Implement compliance token functionality on Substrate (phase 1)

Implementation details here: https://paper.dropbox.com/doc/Adding-Compliance-Token-to-Polymath-Finance--AdvE_O_4YlgN8cSiK0DpocxWAg-oLStxVR2gn2pCaP4XmfbD

List of tasks:

  • Create a new asset module (ConfidentialAsset) which will only allow transfers to occur by presenting a the signed piece of data
  • The Issuer should be able to set one endorser for the ConfidentialAsset which is the public key that signs the data
  • Create a tool that allows a single party to sign a piece of data to permit the transfer of tokens on an specified asset, from an account, to another account and the amount of tokens. The signer can only be the public key specified as endorser for that token.
  • Add the logic for the ConfidentialAsset to require the piece of signed data when transfer() is executed

MESH-124 ⁃ Better error messages

One thing we could improve here is to not Err() on the first restriction that is failed but propagate errors as they are found so we show a concatenated string of errors that were encountered during execution. Say 3 restrictions are in place of which 2 would fail, would be nice to show both errors in a single call.

Not able to transfer polyx on dev node

I am new to polymesh. I have downloaded the binary and started a dev node. I am able to connect to the dev node using polymesh explorer. But polyx transfer does not work.

Following is the error message:

system.ExtrinsicFailed
balances.ReceiverCddMissing

Attaching screenshots

accounts_sendfunds
authorize_transaction
error_polymesh_transfer

How do i fix this issue? Please help.

MESH-109 ⁃ Clear all warnings

Right now Polymesh produces several screenfulls of warnings when building, which is distracting when fishing for an error message. Most of the warnings are easy to fix and can be resolved with cargo-fix in one go.

release builds

It would be better if you provide release builds for different versions to run nodes. It's hard to follow every new version and build from scratch.
I juts need to interact with Polymesh Network.
Thank you.

MESH-118 ⁃ Improve GTM

  • Add Whitelist batch function -> Also test limits
  • Add KYC expiry date and perform check on verify transfer
  • Separate buy and sell lockup date in add_to_whitelist parameter to allow different numbers to be entered

Unknown error: Client(UnknownBlock("State already discarded for BlockId::Hash

After connecting from Polymesh SDK getting following error in terminal :
....
2020-10-03 21:11:00 Unknown error: Client(UnknownBlock("State already discarded for BlockId::Hash(0x12fddc9e2128b3fe571e4e5427addcb87fcaf08493867a68dd6ae44b406b39c7)"))

Screen attached:

image

Client Code :

 const polyClient = await Polymesh.connect({
    nodeUrl: "ws://<my node ip>:9944",
    accountSeed: seed,
  });

  console.log(
    "Block Number   : - ",
    new BigNumber(await polyClient.getLatestBlock()).toNumber()
  );

API returned response correctly but getting this message :

RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: -32603: Unknown error occurred: Client(UnknownBlock("State already discarded for BlockId::Hash(0x12fddc9e2128b3fe571e4e5427addcb87fc

Screen :

image

MESH-142 ⁃ Replace `HasOwner`, `AssetTrait` etc. with direct access to module methods/data structures

As I've recently found it's possible to directly access other modules' public storage and methods. Pasting my instructions from Slack:

  1. Make the storage item public - e.g. pub InvestorList get(investor_list): map T::AccountId => Investor<T::AccountId>;
  2. Import it e.g. the InvestorList above from identity use crate::identity::InvestorList;
  3. Use it like this: <InvestorList<T>>::get(some_key), for testing replace T with Test

MESH-123 ⁃ Generalise TMs

Ideally TMs would implement a trait TransferManager with a function verifyTransfer. The token would have a list of TM managers to loop through and call verifyTransfer for each TM.

MESH-112 ⁃ CI

  1. Create a docker image
  2. Setup CI to create full builds

Later:
3) Run tests on CI
4) Use CircleCI's parallelism to speed up tests.

MESH-122 ⁃ Split verify transfer into verify and execute

Unlike Ethereum, state changes done during a transaction in substrate are NOT reverted if we throw an error at a later stage during a transaction.

This means we can't do state changes in verify transfer function and expect them to be reverted if some other TM reverts the tx at a later stage.

One way to avoid the problem is to have separate verify and execute transfer functions.
In each transfer, all TM will first be called with verify transfer function and if the result is that the transfer should go through, all TM must then be called with execute transfer function so that they can make the required state changes with a guarantee that they don't need to revert these changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.