Socket
Socket
Sign inDemoInstall

@hashflow/hashverse-contracts

Package Overview
Dependencies
0
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashflow/hashverse-contracts

Smart Contracts to power the HashVerse.


Version published
Weekly downloads
680
decreased by-19.62%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

Running Tests

Unit Tests

  1. Run yarn to install all dependencies.
  2. [Optional] Run yarn hardhat compile to ensure that contracts compile.
  3. Run yarn hardhat test.

Wormhole Integration Tests

In order to test the x-chain capabilities of the Avatar and Item contracts, we need to run integration tests that simulate Wormhole message relays.

  1. Run yarn to install all dependencies.
  2. Set up the Wormhole Local Validator, as outlined in the documentation.
  3. Run npm run evm and npm run wormhole to start the Wormhole Local Validator.
  4. Run the following commands to deploy and initialize the contracts, as well as mint an Avatar and Item:
  • yarn hardhat test:wormhole:deploy --network wormhole1 -- deploys contracts on the main network
  • yarn hardhat test:wormhole:deploy --network wormhole2 -- deploys contracts on the satellite network
  • yarn hardhat test:wormhole:initial-setup --network wormhole1 -- initializes remotes and sprays ETH
  • yarn hardhat test:wormhole:initial-setup --network wormhole2 -- initializes remotes and sprays ETH
  1. Run the following commands to mint the Avatar cross-chain:
  • yarn hardhat test:wormhole:avatar-mint-out --network wormhole1 -- emits a Wormhole message
  • yarn hardhat test:wormhole:avatar-mint-in --network wormhole2 -- mints the Avatar cross-chian
  1. Run the following command again and expect an error:
  • yarn hardhat test:wormhole:avatar-mint-in --network wormhole2
  1. Run the following command to send the Item cross-chain:
  • yarn hardhat test:wormhole:item-bridge-out --network wormhole1 -- emits a Wormhole message and burns the Item
  • yarn hardhat test:wormhole:item-bridge-in --network wormhole2 -- mints the Item on the satellite chain
  • yarn hardhat test:wormhole:item-bridge-out --network wormhole2 -- emits a Wormhole message and burns the Item
  • yarn hardhat test:wormhole:item-bridge-in --network wormhole1 -- mints the Item on the main chain
  • yarn hardhat test:wormhole:item-bridge-out --network wormhole1 -- emits a Wormhole message and burns the Item
  • yarn hardhat test:wormhole:item-bridge-in --network wormhole2 -- mints the Item on the satellite chain

FAQs

Package last updated on 15 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc