Ethereum Contract in Your Local Environment
Ethereum Compatibility Layer.
Here is a quick demo on how to use EVM.
EVM (Ethereum Virtual Machine) is the most popular VM for smart contracts. EVM has a rich ecosystem for developers, testers, and users. Plasm Network fully supports EVM-based smart contracts as L1 contracts.

Deploy your EVM smart contract

In this article, you will deploy a smart contract on the Plasm local development environment.

Install a Plasm Node

To use a local development environment, a Plasm node is necessary. Please install the latest Plasm node from here: https://github.com/staketechnologies/Plasm/tree/dusty (build instruction). Checkout the repo if this doesn't work:
1
cargo +nightly install --locked --force --git https://github.com/staketechnologies/Plasm
Copied!
The next step is to launch a node in the development environment.
1
plasm-node --dev -l evm=debug
2
Oct 14 15:07:56.998 WARN Running in --dev mode, RPC CORS has been disabled.
3
Oct 14 15:07:56.998 INFO Plasm Node
4
Oct 14 15:07:56.998 INFO ✌️ version 1.6.0-1dc78cce-x86_64-linux-gnu
5
Oct 14 15:07:56.998 INFO ❤️ by Stake Technologies <[email protected]>, 2019-2020
6
Oct 14 15:07:56.998 INFO 📋 Chain specification: Development
7
Oct 14 15:07:56.998 INFO 🏷 Node name: skillful-war-1171
8
Oct 14 15:07:56.998 INFO 👤 Role: AUTHORITY
Copied!
Now, the node is available on Metamask. Ta-da! Sounds good, doesn't it?
Plasm development node. Metamask connection settings.
The next step is to import the developer account seed:
0x60ed0dd24087f00faea4e2b556c74ebfa2f0e705f8169733b01530ce4c619883
Import developer account seed.
Imported account balance.
Keep in mind that PLM is not ERC20!

Deploy contracts by using Remix

When the account is ready and corrected, it is time to deploy some sample contracts from Remix.
Use Remix demo contract.
Change deployment environment to Metamask injected web3 instance.
Push "deploy" and approve transaction on Metamask.
If everything goes well in the Plasm node, you will see the following lines:
1
Oct 15 13:09:30.009 DEBUG apply_extrinsic: Execution Succeed(Returned) [source: 0x7ef99b0e5beb8ae42dbf126b40b87410a440a32a, value: 0, gas_limit: 320315, used_gas: 320315, actual_fee: 3523465000000000] {ext}
2
Oct 15 13:09:30.009 DEBUG apply_extrinsic: Inserting code (938 bytes) at 0x66bb595bc60c8af0a306aa86edf96a88d3a59e9a {ext} Oct 15 13:09:30.009 DEBUG apply_extrinsic: Updating storage for 0x66bb595bc60c8af0a306aa86edf96a88d3a59e9a [index: 0x0000000000
3
000000000000000000000000000000000000000000000000000000, value: 0x0000000000000000000000007ef99b0e5beb8ae42dbf126b40b87410a440a3
4
2a] {ext}
5
Oct 15 13:09:30.009 DEBUG apply_extrinsic: Updating storage for 0x66bb595bc60c8af0a306aa86edf96a88d3a59e9a [index: 0x0000000000
6
000000000000000000000000000000000000000000000000000002, value: 0x00000000000000000000000000000000000000000000000000000000000000
7
0a] {ext}
8
Oct 15 13:09:30.009 DEBUG apply_extrinsic: Updating storage for 0x66bb595bc60c8af0a306aa86edf96a88d3a59e9a [index: 0xc8f9a9dfd7
9
9ec8caa983b729134bf933685749347f774048aeeda9f0685a095f, value: 0x00000000000000000000000000000000000000000000000000000000000000
10
01] {ext}
Copied!
0x66bb595bc60c8af0a306aa86edf96a88d3a59e9a is the contract instance address!
​
Last modified 5mo ago