2019-06-07 14:19:12 +03:00
|
|
|
require('../env')
|
2019-12-05 19:50:55 +03:00
|
|
|
const { getTokensState } = require('../src/utils/tokenState')
|
2021-05-08 18:50:46 +03:00
|
|
|
const { FOREIGN_ERC_TO_NATIVE_ABI } = require('../../commons')
|
2020-10-28 14:20:50 +03:00
|
|
|
const { web3Foreign } = require('../src/services/web3')
|
2019-05-06 14:12:53 +03:00
|
|
|
|
2019-12-23 18:59:03 +03:00
|
|
|
const emptyLogger = {
|
|
|
|
debug: () => {},
|
|
|
|
info: () => {}
|
|
|
|
}
|
|
|
|
|
2019-05-06 14:12:53 +03:00
|
|
|
async function initialChecks() {
|
2020-10-28 14:20:50 +03:00
|
|
|
const { ORACLE_BRIDGE_MODE, COMMON_FOREIGN_BRIDGE_ADDRESS } = process.env
|
2019-12-04 23:18:14 +03:00
|
|
|
let result = {}
|
2019-05-06 14:12:53 +03:00
|
|
|
|
2021-05-08 18:50:46 +03:00
|
|
|
if (ORACLE_BRIDGE_MODE === 'ERC_TO_NATIVE') {
|
2020-10-28 14:20:50 +03:00
|
|
|
const bridge = new web3Foreign.eth.Contract(FOREIGN_ERC_TO_NATIVE_ABI, COMMON_FOREIGN_BRIDGE_ADDRESS)
|
2019-12-23 18:59:03 +03:00
|
|
|
result = await getTokensState(bridge, emptyLogger)
|
2019-09-14 09:04:07 +03:00
|
|
|
}
|
2019-07-26 15:26:14 +03:00
|
|
|
|
2019-05-06 14:12:53 +03:00
|
|
|
console.log(JSON.stringify(result))
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2020-10-28 14:20:50 +03:00
|
|
|
const result = initialChecks()
|
2019-05-06 14:12:53 +03:00
|
|
|
|
2020-10-28 14:20:50 +03:00
|
|
|
module.exports = result
|