create config.js for test
ADD
test/config.js
+// Testnet V3 config
+module.exports = {
+ plasma: {
+ parent: {
+ erc20: '0x3f152B63Ec5CA5831061B2DccFb29a874C317502',
+ erc721: '0x4f765cd1d33b2e9ae6dcba1f5852de93b285eb78',
+ },
+ child: {
+ erc721: '0x0f3Fb1354337965BAd0775a75c692D167fbb39F9',
+ erc20: '0x2d7882beDcbfDDce29Ba99965dd3cdF7fcB10A1e',
+ },
+ registryAddress: '0x56B082d0a590A7ce5d170402D6f7f88B58F71988',
+ rootChainAddress: '0x82a72315E16cE224f28E1F1fB97856d3bF83f010', // The address for the main Plasma contract in Ropsten testnet
+ withdrawManagerAddress: '0x3cf9aD3395028a42EAfc949e2EC4588396b8A7D4', // An address for the WithdrawManager contract on Ropsten testnet
+ depositManagerAddress: '0x3Bc6701cA1C32BBaC8D1ffA2294EE3444Ad93989', // An address for a DepositManager contract in Ropsten testnet
+ },
+ rpc: {
+ parent: '<goerli RPC>',
+ child: 'https://rpc-mumbai.matic.today', // This is the MATIC testnet RPC
+ },
+ pos: {
+ parent: {
+ erc20: '0x655f2166b0709cd575202630952d71e2bb0d61af',
+ erc721: '0x5a08d01e07714146747950CE07BB0f741445D1b8',
+ erc1155: '0x2e3Ef7931F2d0e4a7da3dea950FF3F19269d9063',
+ chainManagerAddress: '0xBbD7cBFA79faee899Eaf900F13C9065bF03B1A74', // Address of RootChainManager proxy for POS Portal
+ },
+ child: {
+ erc721: '0xEC8CB8bBb069470bC358ffB0e3710c64830da383',
+ erc20: '0x2d7882beDcbfDDce29Ba99965dd3cdF7fcB10A1e',
+ weth: '0x714550C2C1Ea08688607D86ed8EeF4f5E4F22323',
+ erc1155: '0xA07e45A987F19E25176c877d98388878622623FA',
+ },
+ },
+ user1: {
+ privateKey: '<paste your private key here>', // A sample private key prefix with `0x`
+ address: '<paste address belonging to private key here>', // Your address
+ },
+ user2: {
+ address: '<paste address here>', // Your address
+ },
+}

MODIFY
test/debug.js
test/debug.js
const { use, Web3Plugin, PlasmaClient } = require("@maticnetwork/maticjs");
const HDWalletProvider = require("@truffle/hdwallet-provider");
+const { user1, plasma, rpc } = require("./config");
use(Web3Plugin);
-const env = process.env;
-const from = env.user1_address
+const from = user1.address;
const execute = async () => {
- const privateKey = process.env.user1_privateKey;
- const erc20TokenMumbaiAddress = env.PLASMA_MUMBAI_ERC20;
- const goerliTokenERC20 = env.PLASMA_GOERLI_ERC20
+ const privateKey = user1.privateKey;
+ const erc20TokenMumbaiAddress = plasma.child.erc20;
+ const goerliTokenERC20 = plasma.parent.erc20;
const matic = new PlasmaClient({
network: 'testnet',
version: 'mumbai',
parent: {
- provider: new HDWalletProvider(privateKey, env.PARENT_PROVIDER),
+ provider: new HDWalletProvider(privateKey, rpc.parent),
defaultConfig: {
from
}
},
child: {
- provider: new HDWalletProvider(privateKey, env.MATIC_PROVIDER),
+ provider: new HDWalletProvider(privateKey, rpc.child),
defaultConfig: {
from
}

create config.js for test