This repo is the LSP7 version of the HypERC20
and HypERC20Collateral
of @hyperlane-xyz/core
package. They are
used to bridge tokens between the Ethereum and LUKSO chains using the
Hashi Bridge.
For more details on the architecture and bridging flow, see the docs/
folder.
-
ETH -> LUKSO: https://explorer.hyperlane.xyz/message/0x53a383e32fdb68748c8af5c86be3669e58eadc377db2a9f420826cb9474dd55c
-
LUKSO -> ETH: https://explorer.hyperlane.xyz/message/0xf9c86a22e7b5584fc87a9d4ffc39f967a8745cd28b98ed2eaeb220c43996c4ca
This project is based on the Foundry template by PaulRBerg.
bun install # install Solhint, Prettier, and other Node.js deps
If this is your first time with Foundry, check out the installation instructions.
Foundry typically uses git submodules to manage dependencies, but this template uses Node.js packages because submodules don't scale.
This is how to install dependencies:
- Install the dependency using your preferred package manager, e.g.
bun install dependency-name
- Use this syntax to install from GitHub:
bun install github:username/repo-name
- Use this syntax to install from GitHub:
- Add a remapping for the dependency in remappings.txt, e.g.
dependency-name=node_modules/dependency-name
Note that OpenZeppelin Contracts is pre-installed, so you can follow that as an example.
This template comes with a set of sensible default configurations for you to use. These defaults can be found in the following files:
├── .editorconfig
├── .gitignore
├── .prettierignore
├── .prettierrc.yml
├── .solhint.json
├── foundry.toml
└── remappings.txt
This is a list of the most frequently needed commands.
# Build the contracts:
forge build
# Delete the build artifacts and cache directories:
forge clean
# Get a test coverage report:
forge coverage
# Format the contracts:
forge fmt
# Get a gas report:
forge test --gas-report
# Lint the contracts:
bun run lint
# Run the tests:
forge test
# Generate test coverage and output result to the terminal:
bun run test:coverage
# Generate test coverage with lcov report (you'll have to open the `./coverage/index.html` file in your browser,
# to do so simply copy paste the path):
bun run test:coverage:report
This repository uses pre-configured GitHub Actions. The contracts are linted and tested on every push and pull requests. You can edit the CI script in .github/workflows/ci.yml.
This template builds upon the frameworks and libraries mentioned above, so please consult their respective documentation for details about their specific features.
For example, if you're interested in exploring Foundry in more detail, you should look at the Foundry Book. In particular, you may be interested in reading the Writing Tests tutorial.