Start Auction
In Solidity, startAuction usually relies on onlyOwner, mints an NFT into contract custody, then records auction metadata.
Solidity
Section titled “Solidity”function startAuction(...) external onlyOwner { require(maxPrice_ >= minPrice_, "invalid prices"); require(duration_ > 0, "zero duration"); _mint(address(this), nftId_); _auctions[nftId_] = Auction(...); emit AuctionCreated(nftId_);}Move replaces the modifier with an explicit helper:
inline fun only_owner(owner: &signer) { assert!( signer::address_of(owner) == @dutch_auction_address, error::permission_denied(ENOT_OWNER) );}The main start_auction flow then:
- checks ownership and arguments
- creates the token object
- creates the auction object
- stores auction resources under that object
- emits
AuctionCreated
The important migration idea is that authorization, asset creation, and state-container creation are three explicit steps instead of one inherited contract action.