Warning
Deprecation note:
This project proved the viability of the idea of making Polkadot smart contracts compatible with tooling and wallets form the Ethereum world. It also provided working prototype. At that point, and following community discussion on the Polkadot Forum, Parity’s internal team took over the initiative and started to work on the revive, having a wider scope and support from OpenZeppelin. Thus this project has completed its task and now archived.
This project is an experimental add-on to Polkadot SDK's pallet-contracts to make it Ethereum RPC -compatible.
Tip
In a nutshell:
Install customized cargo-contract tool:
Why?
Our 🦆-chain has pallet-contracts on board and at the same time works with Ethereum 20-bytes Account format. The latter fact is required so that our node can understand MetaMask-signed transactions. But for the existing ink! contracts tooling this is an unusual setting, as they're expected to work with 32-bytes long Accounts.
For this reason, to work with our ink! contracts on this chain, we use a fork of cargo-contract tool which speaks with our node the same language! Run this command to install it:
cargo install --git https://github.com/agryaznov/cargo-contract --branch v4-ethink --forceRun tests:
cargo testInject a well-known keypair of Baltathar into ethink! node's keystore:
(This step is needed only of you want to sign transactions on the node side)
cargo run -- key insert --dev --key-type "ethi" -d tmp --scheme ecdsaStart the ethink! development node:
cargo run -- --devOpen your MetaMask and add a new network:
- Network name: Duck 🦆
- New RPC URL: http://localhost:9944
- Chain ID: 42
- Currency symbol: 🥚
Import a couple of pre-funded well-known development accounts into your MetaMask in order to be able to sign and send transactions.
Caution
It is highly recommended to use a separate MetaMask instance for this (e.g. in a dedicated browser profile), not to mix the development accounts (whose private keys are compromised by design) with your real money-holding accounts.
That's it! You should right away be able to communicate with the Duck 🦆 chain using your MetaMask. Let's see it in action, as described in the Demo section below.
ethink! comes with e2e integration tests, grouped into test suites:
Use this command to run the integration tests (at the project root):
cargo test --test "*"Build documentation for the project crates:
cargo doc --document-private-items --openThe book is written with mdBook tool.
To install it, run:
cargo install mdbookThen build and open the book:
cd docs/ethink-book
mdbook serve --openHappy reading!
A comprehensive step-by-step Demo is described in the book chapter. You will be able to deploy an ink! contract to ethink-node and use the demo dApp via MetaMask. Go ahead and give it a try!
- The table with all Ethereum RPC methods needed along with their description and implementation status.
- Collection of curl composed request templates to Ethereum RPC exposed by ethink! node.
