This is an Auction contract where people can list items for sale. Other users get to place bids and the highest bidder gets the item.
It has 4 entry points:
- The
list itementry point: This is where the user supplies the information about the item and the starting bid price. - The
bidentry point: This is where other users can place bids on the item they want. The users are given a receipt object which can be used to claim back their bids if they're unlucky. - The
settle bidentry point: This can only be called by the item creator, it settles the bid and transfers the item to highest bidder. - The
get refundentry point: This is where other users who weren't the highest bidder can reclaim their bids, all they need to do is supply the receipt they got after bidding.
To deploy and use the smart contract, follow these steps:
-
Move Compiler Installation: Ensure you have the Move compiler installed. You can find the Move compiler and instructions on how to install it at Sui Docs.
-
Compile the Smart Contract: For this contract to compile successfully, please ensure you switch the dependencies to whichever you installed.
framework/devnetfor Devnet,framework/testnetfor Testnet
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" }then build the contract by running
sui move build
- Deployment: Deploy the compiled smart contract to your blockchain platform of choice.
sui client publish --gas-budget 100000000 --json