A contract allow user to mint NFT and hold an auction, the winner is the one with the single lowest bid.
near login
You should use some accounts to try the auction.
export ID=youracccount
near deploy --wasmFile res/contract.wasm --accountId $ID
near call $ID new '{"_owner_id":"'$ID'"}' --accountId $ID
near call $ID mint_nft '{"_owner_id":[account1],"_token_data":{"title":"title","description":"description"}}' --accountId [account1] --deposit 1
near call $ID get_token_by_owner '{"_owner_id":[account1]}' --accountId [account1]
near call $ID create_auction '{"_token_id":1,"_auction_during_seconds":60}' --accountId [account1] --deposit 5
near call $ID get_auction_by_owner '{"_auction_id":1}' --accountId [account1]
near call $ID start_auction '{"_auction_id":1}' --accountId [account1]
near call $ID commit_auction '{"_auction_id":1}' --accountId [account2] --deposit 1
near call $ID commit_auction '{"_auction_id":1}' --accountId [account2] --deposit 1.5
The owner of the smart contract will continuously run the check function to check the status of the auctions:
near call $ID check_auctions --accountId $ID