tokenbridge/monitor/utils/ercUtils.js
Przemyslaw Rzad 5efc9a6688
Update bridge monitor (#38)
* Removed duplicate licence, updated links do Contributing and Licence in sub-readme.

* Renamed bridge-monitor to monitor.

* Removed package-lock.json.

* Added monitor workspace with linting.

* Consistent eslint version.

* Added readme for merging.
2019-05-14 09:17:03 +02:00

19 lines
395 B
JavaScript

const { ERC_TYPES } = require('./bridgeMode')
const getTokenType = async (contract, bridgeAddress) => {
try {
const bridgeContract = await contract.methods.bridgeContract().call()
if (bridgeContract === bridgeAddress) {
return ERC_TYPES.ERC677
} else {
return ERC_TYPES.ERC20
}
} catch (e) {
return ERC_TYPES.ERC20
}
}
module.exports = {
getTokenType
}