add .env in test
MODIFY
.gitignore
.gitignore
@@ -14,4 +14,3 @@ dist
*.tgz
config.json
-config.js

ADD
test/config.js
+const dotenv = require('dotenv');
+const path = require('path');
+const env = dotenv.config({
+ path: path.join(__dirname, '.env')
+});
+module.exports = {
+ plasma: {
+ parent: {
+ erc20: '0x3f152B63Ec5CA5831061B2DccFb29a874C317502',
+ erc721: '0xfA08B72137eF907dEB3F202a60EfBc610D2f224b',
+ },
+ child: {
+ erc20: '0x2d7882beDcbfDDce29Ba99965dd3cdF7fcB10A1e',
+ erc721: '0x33FC58F12A56280503b04AC7911D1EceEBcE179c',
+ },
+ 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: process.env.ROOT_RPC,
+ child: process.env.MATIC_RPC || 'https://rpc-mumbai.matic.today',
+ },
+ pos: {
+ parent: {
+ erc20: '0x655f2166b0709cd575202630952d71e2bb0d61af',
+ erc721: '0x5a08d01e07714146747950CE07BB0f741445D1b8',
+ erc1155: '0x2e3Ef7931F2d0e4a7da3dea950FF3F19269d9063',
+ chainManagerAddress: '0xBbD7cBFA79faee899Eaf900F13C9065bF03B1A74', // Address of RootChainManager proxy for POS Portal
+ },
+ child: {
+ erc721: '0xEC8CB8bBb069470bC358ffB0e3710c64830da383',
+ erc20: '0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1',
+ weth: '0x714550C2C1Ea08688607D86ed8EeF4f5E4F22323',
+ erc1155: '0xA07e45A987F19E25176c877d98388878622623FA',
+ },
+ },
+ user1: {
+ "privateKey": process.env.PRIVATE_KEY,
+ "address": process.env.FROM
+ },
+ user2: {
+ address: '<paste address here>', // Your address
+ },
+}

MODIFY
test/debug.js
test/debug.js
@@ -9,9 +9,9 @@ const from = user1.address;
const execute = async () => {
const privateKey = user1.privateKey;
const mumbaiERC720 = pos.child.erc721;
- const goerliERC720 = plasma.parent.erc721;
+ const goerliERC720 = pos.parent.erc721;
- const client = new PlasmaClient({
+ const client = new POSClient({
log: true,
network: 'testnet',
version: 'mumbai',
@@ -36,13 +36,7 @@ const execute = async () => {
// const mumbaiERC720Token = client.erc721('0x33fc58f12a56280503b04ac7911d1eceebce179c');
const goerliERC20Token = client.erc20(plasma.parent.erc20, true);
- const tx = await goerliERC20Token.approve(104);
- console.log("txHash", await tx.getTransactionHash());
- console.log("txReceipt", await tx.getReceipt());
- return;
-
- const mumbaiERC721Token = client.erc721(plasma.child.erc721);
- const goerliERC721Token = client.erc721(plasma.parent.erc721, true);
+ return console.log(await goerliERC20Token.getBalance(from));
// const balance = await mumbaiERC720Token.getBalance(

MODIFY
test/package-lock.json
test/package-lock.json
"resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
"integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w=="
},
+ "dotenv": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
+ "dev": true
+ },
"duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",

MODIFY
test/package.json
test/package.json
"devDependencies": {
"cross-env": "^7.0.3",
"cross-env-file": "^1.0.0",
+ "dotenv": "^10.0.0",
"karma": "^6.3.2",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",

add .env in test