diff --git a/README.md b/README.md index 69b807a0..d941060a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # witnet-solidity-bridge -Solidity source code of the smart contracts composing the **Witnet EVM Bridge** framework. This framework enables smart contracts operating in a long range of EVM-compatible chains to interact with the [Wit/oracle Blockchain](https://witnet.io) for retrieving and aggregating offchain public data, or as an entropy source for randomness generation. +Solidity source code of the smart contracts composing the **Witnet EVM Bridge** framework. This framework enables smart contracts operating in a long range of EVM-compatible chains to interact with the [Wit/Oracle Blockchain](https://witnet.io) for retrieving and aggregating offchain public data, or as an entropy source for randomness generation. ## Install the package @@ -73,7 +73,7 @@ Javascript utils methods: - `getRealmNetworkFromArgs()` - `getRealmNetworkFromString()` - `getWitnetArtifactsFromArgs()` -- `getWitnetRequestMethodString(method)` +- `getWitOracleRequestMethodString(method)` - `isDryRun(network)` - `isNullAddress(addr)` - `padLeft(str, char, size)` diff --git a/src/index.js b/src/index.js index 74e82053..fcbf7dd4 100644 --- a/src/index.js +++ b/src/index.js @@ -3,21 +3,11 @@ const merge = require("lodash.merge") const utils = require("./utils") module.exports = { getAddresses: (network) => { - const [eco, net] = utils.getRealmNetworkFromString(network) - if (addresses[net]) { - const merged = merge( - addresses.default, - addresses[eco], - addresses[net], - ) - return { - WitOracle: merged?.WitOracle, - WitPriceFeeds: merged?.WitPriceFeeds, - WitRandomnessV21: merged?.WitRandomnessV21, - } - } else { - return {} - } + let res = addresses?.default + utils.getNetworkTagsFromString(network).forEach(net => { + res = merge(res, addresses[net]) + }) + return res }, supportedEcosystems: () => { const ecosystems = []