Forge/Foundry project template to get started developing contracts from @lukso/lsp-smart-contracts.
- ⚒️ Ready to use Foundry environnement with the
@lukso/lsp-smart-contractsdependencies to get started quickly building contracts using the LUKSO LSP Smart Contracts.
-
Click the "Use this template" button from this repo's home page to create a repository based on this template.
-
Pre-requisites:
- Install the
bunpackage manager. - Install foundry.
- Install the
-
Install the dependencies
forge install
bun installYou can now get started building!
You can install new packages and dependencies using bun or Foundry.
bun add @remix-project/remixdTo generate the artifacts (contract ABIs and bytecode), simply run:
bun run buildThe contract ABIs will placed under the artifacts/ folder.
bun run testbun run formatThe formatting rules can be adjusted in the foundry.toml file, under the [fmt] section.
The folder script/ provide a script to deploy contracts.
-
Create a
.envfile, copy-paste inside the content of.env.exampleand add your private key you will use to deploy. -
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 -vvvvYou can run the following commands to see easily the available options with forge, anvil and cast.
forge --help
anvil --help
cast --helpThis 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/