Deploy on DuskEVM
Developers can deploy smart contracts on DuskEVM using Solidity and familiar tools like Hardhat or Foundry. This is a guide covering the essential information required to deploy smart contracts on DuskEVM.
Below, you can see the relevant information for each DuskEVM network:
Network | Chain ID | RPC URL | Explorer URL |
---|---|---|---|
Mainnet | <PLACEHOLDER> | <PLACEHOLDER> | <"PLACEHOLDER"> |
Testnet | <PLACEHOLDER> | <PLACEHOLDER> | <PLACEHOLDER> |
1) Install a development framework
Choose a development framework, such as:
2) Fund your account with DUSK
Ensure your wallet is connected to the DuskEVM network and has been funded with some DUSK.
3) Configure your environment
Before deploying, make sure you use the correct configuration for DuskEVM deployment, including the correct chain ID and RPC endpoints.
If using Foundry, add DuskEVM’s information to your foundry.toml
:
rpc_url = "[PLACEHOLDER]"chain_id = "[PLACEHOLDER]"
If using Hardhat, you can add DuskEVM in your hardhat.config.js
:
module.exports = { networks: { duskEVM: { url: "<PLACEHOLDER>", chainId: "<PLACEHOLDER>", } }};
4) Deployment
If using Foundry, navigate to your project’s directory and launch:
forge create src/{YourContract}.sol:{ContractName} --rpc-url "PLACEHOLDER" --private-key {YourPrivateKey}
If using Hardhat, add a deploy script in the scripts folder (e.g., add scripts/deploy.js
), and then run it (e.g., with npx hardhat run scripts/deploy.js --network duskEVM
).
Further Resources
For full deployment workflows and advanced usage, refer to the official documentation of your preferred tool: