npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

witnet-solidity-bridge

v2.0.18

Published

Witnet Solidity Bridge contracts for EVM-compatible chains

Downloads

533

Readme

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 Witnet Oracle Blockchain for retrieving and aggregating offchain public data, or as an entropy source for randomness generation.

Install the package

$ pnpm install

Deploying the Witnet EVM Bridge on a new chain

Pre-assessment

Should any artifact require customized contract implementations:

  • Please add source files accordingly to contracts/core/customs.

  • Set up new artifact names, and eventual new construction parameters, if required, to settings/artifacts and settings/specs, respectively.

  • Run regression tests: $ pnpm run test

Prepare the environment

  • Add a new network configuration to settings/networks. The network name should follow the pattern <ecosystem>:<chain-name>.

  • Make sure you run an ETH/RPC provider for the specified host and port, capable of intercepting eth_sendTransaction calls (e.g. web3-ethrpc-gateway).

Run the script

$ pnpm run migrate <ecosytem>:<chain-name>

Upgrding the Witnet EVM Bridge on an existing chain

When modifying the existing source code, or the contents of settings/artifacts or settings/specs, you may need to upgrade some of the artifacts on certain networks. Just add the --artifacts parameter and a comma-separated list of the artifacts you need to upgrade. For instance:

$ pnpm run migrate <ecosystem>:<chain-name> WitnetErrorsLib,WitnetPriceFeeds

When specifying deployable library artifacts, the depending contracts will be attempted to be upgraded as well.

With respect to deployable contracts, you shall be asked to confirm manually before actually performing a contract upgrade. You can automate all potentially involved upgrades by adding the parameter --upgrade-all.

Reasons for an upgrade to fail:

  • You have no credentials.
  • You're attempting to upgrade a contract with the same implementation logic as it currently has.
  • The parameters passed to the upgrade call, as specified in settings/specs are not accepted for some reason (see actual revert message for further info).

Package exported modules

require("witnet-solidity-bridge")

Javacript methods and resources:

  • List of supported EVM ecosystems:
    • supportedEcosystems()
  • List of supported EVM chains:
    • supportedNetworks()
  • WEB addresses at a given chain:
    • getAddresses(network)
  • WEB artifacts:
    • assets.WitnetOracle
    • assets.WitnetPriceFeeds
    • assets.WitnetPriceRouteSolver
    • assets.WitnetRequest
    • assets.WitnetRequestBytecodes
    • assets.WitnetRequestFactory
    • assets.WitnetRequestTemplate
    • assets.WitnetUpgrableBase

require("witnet-solidity-bridge/utils")

Javascript utils methods:

  • fromAscii(str)
  • getRealmNetworkFromArgs()
  • getRealmNetworkFromString()
  • getWitnetArtifactsFromArgs()
  • getWitnetRequestMethodString(method)
  • isDryRun(network)
  • isNullAddress(addr)
  • padLeft(str, char, size)
  • prompt(text)
  • readJsonFromFile(filename)
  • overwriteJsonFile(filname, extra)
  • traceHeader(header)
  • traceTx(tx)
  • traceVerify(network, verifyArgs)