Make config variables and comments more generic
MODIFY
examples/node/allowance-ERC20.js
examples/node/allowance-ERC20.js
const Matic = require('maticjs').default
const config = require('./config')
-const token = config.ROPSTEN_TEST_TOKEN // test token address
+const token = config.PARENT_TEST_TOKEN // test token address
const from = config.FROM_ADDRESS // from address
// Create object of Matic

MODIFY
examples/node/config.js
examples/node/config.js
module.exports = {
- MATIC_PROVIDER: 'https://testnet2.matic.network', // This is the MATIC testnet RPC
+ MATIC_PROVIDER: 'https://testnet2.matic.network', // This is the MATIC network RPC
PARENT_PROVIDER:
- 'https://ropsten.infura.io/v3/70645f042c3a409599c60f96f6dd9fbc', // This is the Ropsten testnet RPC
- ROOTCHAIN_ADDRESS: '0x60e2b19b9a87a3f37827f2c8c8306be718a5f9b4', // The address for the main Plasma contract in Ropsten testnet
- WITHDRAWMANAGER_ADDRESS: '0x4ef2b60cdd4611fa0bc815792acc14de4c158d22', // An address for the WithdrawManager contract on Ropsten testnet
- DEPOSITMANAGER_ADDRESS: '0x4072fab2a132bf98207cbfcd2c341adb904a67e9', // An address for a DepositManager contract in Ropsten testnet
+ 'https://ropsten.infura.io/v3/70645f042c3a409599c60f96f6dd9fbc', // This is the Parent network RPC
+ ROOTCHAIN_ADDRESS: '0x60e2b19b9a87a3f37827f2c8c8306be718a5f9b4', // The address for the main Plasma contract in Parent network
+ WITHDRAWMANAGER_ADDRESS: '0x4ef2b60cdd4611fa0bc815792acc14de4c158d22', // An address for the WithdrawManager contract on Parent network
+ DEPOSITMANAGER_ADDRESS: '0x4072fab2a132bf98207cbfcd2c341adb904a67e9', // An address for a DepositManager contract in Parent network
SYNCER_URL: 'https://matic-syncer2.api.matic.network/api/v1', // Backend service which syncs the Matic sidechain state to a MySQL database which we use for faster querying. This comes in handy especially for constructing withdrawal proofs while exiting assets from Plasma.
WATCHER_URL: 'https://ropsten-watcher2.api.matic.network/api/v1', // Backend service which syncs the Matic Plasma contract events on Ethereum mainchain to a MySQL database which we use for faster querying. This comes in handy especially for listening to asset deposits on the Plasma contract.
ROOTWETH_ADDRESS: '0x421dc9053cb4b51a7ec07b60c2bbb3ec3cfe050b', // This is a wrapped ETH ERC20 contract address so that we can support ETH deposits to the sidechain
MATICWETH_ADDRESS: '0x31074c34a757a4b9FC45169C58068F43B717b2D0', // The corresponding wrapped ETH ERC20 contract address on the Matic chain
PRIVATE_KEY: '<paste your private key here>', // A sample private key prefix with `0x`
FROM_ADDRESS: '<paste address belonging to private key here>',// Your address
- ROPSTEN_TEST_TOKEN: '0x70459e550254b9d3520a56ee95b78ee4f2dbd846', // Contract for ERC20 in Ropsten
- MATIC_TEST_TOKEN: '0xc82c13004c06E4c627cF2518612A55CE7a3Db699', // Contract for ERC20 in Matic testnet
- ROPSTEN_ERC721_TOKEN: '0x07d799252cf13c01f602779b4dce24f4e5b08bbd', // Contract for ERC721 in Ropsten testnet
- MATIC_ERC721_TOKEN: '0x9f289a264b6db56d69ad53f363d06326b984e637', // Contract for ERC721 in matic testnet
+ PARENT_TEST_TOKEN: '0x70459e550254b9d3520a56ee95b78ee4f2dbd846', // Contract for ERC20 in Parent network
+ MATIC_TEST_TOKEN: '0xc82c13004c06E4c627cF2518612A55CE7a3Db699', // Contract for ERC20 in Matic network
+ PARENT_ERC721_TOKEN: '0x07d799252cf13c01f602779b4dce24f4e5b08bbd', // Contract for ERC721 in Parent network
+ MATIC_ERC721_TOKEN: '0x9f289a264b6db56d69ad53f363d06326b984e637', // Contract for ERC721 in matic network
}
\ No newline at end of file

MODIFY
examples/node/deposit-ERC20.js
examples/node/deposit-ERC20.js
const Matic = require('maticjs').default
const config = require('./config')
-const token = config.ROPSTEN_TEST_TOKEN // test token address
+const token = config.PARENT_TEST_TOKEN // test token address
const amount = '1000000000000000000' // amount in wei
const from = config.FROM_ADDRESS // from address

MODIFY
examples/node/deposit-ERC721.js
examples/node/deposit-ERC721.js
const Matic = require('maticjs').default
const config = require('./config')
-const token = config.ROPSTEN_ERC721_TOKEN // test token address
+const token = config.PARENT_ERC721_TOKEN // test token address
const tokenId = '1' // ERC721 token Id
const from = config.FROM_ADDRESS // from address

MODIFY
examples/node/get-matic-token-address.js
examples/node/get-matic-token-address.js
@@ -12,7 +12,7 @@ const matic = new Matic({
depositManagerAddress: config.DEPOSITMANAGER_ADDRESS,
})
-const tokenAddress = config.ROPSTEN_TEST_TOKEN // token address on mainchain
+const tokenAddress = config.PARENT_TEST_TOKEN // token address on mainchain
matic.wallet = config.PRIVATE_KEY // prefix with `0x`

MODIFY
examples/node/process-exit-ERC20.js
examples/node/process-exit-ERC20.js
@@ -3,7 +3,7 @@ const Matic = require('maticjs').default
const config = require('./config')
const from = config.FROM_ADDRESS // from address
-const rootTokenAddress = config.ROPSTEN_TEST_TOKEN // Root token address
+const rootTokenAddress = config.PARENT_TEST_TOKEN // Root token address
// Create object of Matic
const matic = new Matic({

MODIFY
examples/node/process-exit-ERC721.js
examples/node/process-exit-ERC721.js
@@ -2,7 +2,7 @@ const Matic = require('maticjs').default
const config = require('./config')
const from = config.FROM_ADDRESS // from address
-const rootTokenAddress = config.ROPSTEN_ERC721_TOKEN
+const rootTokenAddress = config.PARENT_ERC721_TOKEN
// Create object of Matic
const matic = new Matic({

MODIFY
examples/node/safeDepositERC721Tokens.js
examples/node/safeDepositERC721Tokens.js
const Matic = require('maticjs').default
const config = require('./config')
-const token = config.ROPSTEN_ERC721_TOKEN // test token address
+const token = config.PARENT_ERC721_TOKEN // test token address
const tokenId = '72' // ERC721 token Id
const from = config.FROM_ADDRESS // from address

MODIFY
examples/node/token-of-owner-ERC721.js
examples/node/token-of-owner-ERC721.js
@@ -12,7 +12,7 @@ const matic = new Matic({
})
matic.wallet = config.PRIVATE_KEY // prefix with `0x`
-const tokenAddress = config.ROPSTEN_ERC721_TOKEN // token address on mainchain
+const tokenAddress = config.PARENT_ERC721_TOKEN // token address on mainchain
const from = config.FROM_ADDRESS // from address
matic

Make config variables and comments more generic