> For the complete documentation index, see [llms.txt](https://docs.bahamut.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bahamut.io/building-on-bahamut/deploy-smart-contracts/using-hardhat/compiling-the-contract.md).

# Compiling the contract

First of all you need to install hardhat-toolbox locally\`

`npm install --save-dev @nomicfoundation/hardhat-toolbox`

And then run to compile\`

`npx hardhat compile`

**Deploying the contract**

Run this command for contract deployment\`

`npx hardhat run scripts/deploy.js --network testnet`

If you want to deploy your smart contract to Bahamut Mainnet, at the Deploying stage, you need to use mainnet instead of testnet after --network.

After running the deployment script you will have a contract address and you can interact with the contract using that address.
