You can run a trustless auction for your NFTs on Bitcoin.
Write an Auction smart contract
It turns out that writing the Auction smart contract is very simple. Here is a basic contract to provide decentralized auction on Bitcoin Virtual Machine.
To compile your contracts, use the built-in hardhat compile task.
cd smart-contract-examples
npm install
npx hardhat compile
Deploy the contracts
Review config file hardhat.config.ts. The network configs should look like this.
networks: {
mynw: {
url: "http://localhost:10002",
accounts: {
mnemonic: "<your mnemonic with funds>"
},
timeout: 100_000,
},
blockscoutVerify: {
blockscoutURL: "http://localhost:4000", // your explorer URL
...
}
}
Run the deploy scripts using hardhat-deploy.
npx hardhat deploy --tags DutchAuction
Make sure the accounts in hardhat.config.ts have some $BVM.
Interact with the contracts
Once the contracts are deployed, you can interact with them. We've prepared a few hardhat tasks to make it easy for you to interact with the contracts.