Skip to content

Commit

Permalink
chore: revisit exported assets.getAddresses(network)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Nov 25, 2024
1 parent ede6865 commit dfd9df0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -73,7 +73,7 @@ Javascript utils methods:
- `getRealmNetworkFromArgs()`
- `getRealmNetworkFromString()`
- `getWitnetArtifactsFromArgs()`
- `getWitnetRequestMethodString(method)`
- `getWitOracleRequestMethodString(method)`
- `isDryRun(network)`
- `isNullAddress(addr)`
- `padLeft(str, char, size)`
Expand Down
20 changes: 5 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit dfd9df0

Please sign in to comment.