Skip to content

lukso-network/lukso-foundry-template

Repository files navigation

LUKSO - Foundry Template

Forge/Foundry project template to get started developing contracts from @lukso/lsp-smart-contracts.

Click the "Use this template" button from this repo's home page to create a repository based on this template.

Overview

  • ⚒️ Ready to use Foundry environnement with the @lukso/lsp-smart-contracts dependencies to get started quickly building contracts using the LUKSO LSP Smart Contracts.

Getting started

  1. Pre-requisites:

  2. clone the repository

git clone https://github.com/lukso-network/lukso-foundry-template
  1. Install the dependencies
forge install
bun install

You can now get started building!

Development

Add new packages

You can install new packages and dependencies using bun or Foundry.

bun add @remix-project/remixd

Build

To generate the artifacts (contract ABIs and bytecode), simply run:

bun run build

The contract ABIs will placed under the artifacts/ folder.

Test

bun run test

Format Solidity code

bun run format

The formatting rules can be adjusted in the foundry.toml file, under the [fmt] section.

Deploy + verify contracts

The folder script/ provide a script to deploy contracts.

  1. Create a .env file, copy-paste inside the content of .env.example and add your private key you will use to deploy.

  2. Run the following commands to deploy

# load the variables from the .env file
source .env

# Deploy and verify contract on LUKSO Testnet.
forge script --chain 4201 script/deploy.s.sol:DeployScript --rpc-url $LUKSO_TESTNET_RPC_URL --broadcast --verify --verifier blockscout --verifier-url $BLOCKSCOUT_TESTNET_API_URL -vvvv

# Deploy and verify contract on LUKSO Mainnet.
forge script --chain 42 script/deploy.s.sol:DeployScript --rpc-url $LUKSO_MAINNET_RPC_URL --broadcast --verify --verifier blockscout --verifier-url $BLOCKSCOUT_MAINNET_API_URL -vvvv

Help

You can run the following commands to see easily the available options with forge, anvil and cast.

forge --help
anvil --help
cast --help

Documentation

This template repository is based on Foundry, a blazing fast, portable and modular toolkit for EVM application development written in Rust. It includes:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

You can find more documentation at: https://book.getfoundry.sh/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published