Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auctions pallet design #60

Open
ilionic opened this issue Jan 18, 2022 · 0 comments
Open

Auctions pallet design #60

ilionic opened this issue Jan 18, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@ilionic
Copy link
Contributor

ilionic commented Jan 18, 2022

Calls

The external dispatchable calls. i.e. The methods user can invoke by sending a
transaction

Auctions pallet. Should extend NFT Core
Should implement offchain worker to monitor auctions end time to conclude auction

  • create_auction(origin: OriginFor, auction_info: AuctionInfoOf)
    • AuctionInfoOf consists of AccountId, BalanceOf, BlockNumber, CollectionId, NftId
  • bid_value(origin: OriginFor, id: T::AuctionId, value: BalanceOf)
  • delete_auction(origin: OriginFor, id: T::AuctionId)

Storages

Defines how to access on-chain storage

Auctions

Stores on-going and future auctions. Closed auction are removed.

pub type Auctions<T: Config> = StorageMap<_,
    Twox64Concat, T::AuctionId, AuctionInfoOf<T>, OptionQuery>;

AuctionEndTime

Index auctions by end time.

pub type AuctionEndTime<T: Config> = StorageDoubleMap<_, 
    Twox64Concat, T::BlockNumber, Twox64Concat, T::AuctionId, (), OptionQuery>;

AuctionOwnerById

Auction owner by ID

type AuctionOwnerById<T: Config> = StorageMap<_, 
    Twox64Concat, T::AuctionId, T::AccountId, ValueQuery>;

Types

Events

Defines the events that could be emitted by this pallet to indicate what happened

pub enum Event<T: Config> {
    /// Auction created
    AuctionCreated(T::AccountId, T::AuctionId),
    /// A bid is placed
    Bid(T::AuctionId, T::AccountId, BalanceOf<T>),
    /// Auction ended
    AuctionConcluded(T::AuctionId),
    /// Auction removed
    AuctionRemoved(T::AuctionId),
}
@ilionic ilionic added this to the rmrk-auctions milestone Jan 18, 2022
@ilionic ilionic added the documentation Improvements or additions to documentation label Jan 18, 2022
@ilionic ilionic moved this to In Progress in rmrk-substrate Jan 18, 2022
@ilionic ilionic moved this from In Progress to Todo in rmrk-substrate May 3, 2022
@ilionic ilionic added the enhancement New feature or request label May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
No open projects
Status: Todo
Development

No branches or pull requests

1 participant