Using WPSmartContracts in other Blockchains
In a previous article we did a brief analysis of Ethereum state of the art and the need of escaling solutions.
Now we are going to show you how you can use WPSmarContracts to deploy and interact your contracts in different blockchains, from the comfort of your Metamask.
This article assumes that you are already familiar with WPSmartContracts plugin, if not please refer to the WPSmartContracts.com website.
This WordPress plugin allows you to create Smart Contracts like ICOs, ERC-20 tokens, and soon it will allow you to create NFT Marketplaces, DEX, and more.
This can be easily done with:
- A WordPress site.
- The WPSmartContracts plugin installed
- And Metamask installed on your browser.
That’s all you need.
We have included in WPSmartContracts support for three Blockchains & Layer 2 solutions that are 100% compatible with Ethereum Virtual Machine (EVM), meaning that you can deploy Smart Contracts to this chains, just setting up your Metamask account.
You can user your same Metamask account, and the same private keys, you don’t need any additional account.
The supported chains are:
- Binance Smart Chain (BSC): an EVM compatible blockchain by Binance.
- xDai Chain: a Layer 2 solution based on xDAI coin, which has fees in a stable coin pegged to the USD.
- Polygon Network (Matic): an adapted version of Plasma with PoS based side chains.
All chains supports include the Testnet and the Mainnet, in this way you can play with the network free, before spending real money in your project.
To deploy a Contract in any of this networks the process is very similar:
- Setting up your Metamask account to use the desired chain
- Get some native coins of the selected chain:
- BNB for BSC:
» https://coinmarketcap.com/currencies/binance-coin/ - xDai for xDai Chain
» https://coinmarketcap.com/currencies/xdaistable/ - Matic for polygon
» https://coinmarketcap.com/currencies/polygon/
3. Switch to the networks
4. Deploy your contracts as you always do. » Learn more
Setting up your Metamask account
If you haven’t done that yet, install the Metamask extension in your browser.
» https://metamask.io/
Then install the WPSmartContracts WordPress plugin in your WordPress site.
» https://wordpress.org/plugins/wp-smart-contracts/
Now go to your wp-admin and click on the type of contract you want to deploy. In this example we are going to show how to deploy a ICO using the xDai chain, but the process is the same for all contracts and all chains.
Get some coins to start
- To get BNB for BSC, basically you need to get them on Binance Exchange, but there is also a BSC Testnet you can use to play. Click here to learn more.
- Click here to learn how to get xDai
- Click here to learn how to get Matic
Deploy your Smart Contracts
The plugin can setup and install your Metamask account for you, for this do the following:
- Go to ICO — Add New
- Set the parameters of your new Token and ICO
- Switch to the desired Blockchain (xDai Chain in this example)
- Click deploy
Of course this tutorial assumes that you already have funds in xDai in your account.
Interact with your contract
Once deployed to the desired network you and your users can interact with it and switch to the desired network very easily.
In this example you will see how an user can:
- Go to your ICO and switch to the desired network:
From there the process to interact and use the contracts are the same as usual.