Adding the first auction capabilities to KnownOrigin marketplace

in #blockchain6 years ago

With the release of our new KnownOrigin NFT contract, we now have the ability to extend the platform beyond a simple Buy Now style purchase flow and we can add new layers on top of KO, with new features and functionality.

Over the last several weeks we have been building our first auction style contract which will are imminently about to plug in and enable for KnownOrigin.io artworks. Before rolling this out I think it’s worth talking through and explaining how it will work. First let’s take a look at the low level contract code.

The contract code
Screenshot 2018-10-26 20.44.25.png

The above details a simple interface which exposes four key methods which I want to cover some of the logic behind them.

• placeBid() — this allows for users to place bids for a specific edition on sale in the KnownOrigin.io marketplace.
• increaseBid() — this allows for a user to increase their bid if they are already the top bidder.
• withdrawBid() — this allows for a user to withdraw their bid in the situation of a mistake being made.
• acceptBid() — this allows the the edition controller a.k.a the artist to action the bid and complete the auction.

There are several checks which happen when each method is called to enforce various rules and security concerns are each point.

As you can also see from the above code snippet we are emitting events at each stage of an auction and when the state of the contract changes. This should allow for tools to be built detailing the ongoings of any auction inflight or that has finished. 3rd party tools can easily be built on top of the contract as well, playing in the open is fundamental to our vision for KnownOrigin.io.

The auction contract has been given permission to mint new assets from our KODA contract which represents the base layer for the KnownOrigin.io ecosystem.

• Bids are just as much offers as they are bids — the contract escrows your ether until the bid is accepted by the artist, there is no time limit for the offer being placed.

• A bidder can only place a bid of at least the current minimum bid amount, set to 0.01 ETH for initial release.
You can only outbid the previous bidder if you provide the same bid plus the min amount.
An edition must be enabled for the auction to be valid.

• Only the configured artist for each edition can result a auction.
Once the edition is sold out, no more editions are possible.

• When a bid is accepted, funds are split to the original artist defined in KODA.

• KnownOrigin.io can pause an edition auction if something malicious is found.

• KnownOrigin.io can pause all editions if something malicious is found.

Although this looks simple it represents many hours of work and thousands of lines of code written in the form of solidity code, new interfaces and many many tests to cover each scenario to give us enough confidence to deploy it in the wild.

Screenshot 2018-10-26 20.50.59.png

Make a bid Widget/Ui

Screenshot 2018-10-26 20.51.20.png

Next we need an area for artists to have an overview and the ability to accept open bids. We have added a simple panel to each artist page, showing editions which can be purchased via an auction.

Accept bid Widget/Ui

Screenshot 2018-10-26 20.54.12.png

What’s next
Once we deploy the auction contract to mainnet we will be looking for feedback from users and artists on how it operates and how usable it is.

The above represents our first stab at this and we would like to experiment with alternative styles of auction such as time (block) based, dutch actions, sealed auctions for example.

We have tried hard to be present a clean and simple interface to users and deliberately limited the amount of blockchain jargon and complexity we expose to users of the platform. Hiding some of the nuisances of what’s going on but still presenting them with key information like linking to transactions on etherscan when possible.

We believe UX challenges are one of the key challenges which need to be solved to onboard and reach new users.

Some missing pieces which we will be improving once its out and in the wild:-

• Activity streams — showing previous & historic bids and purchases. Although we have a very basic working version of this in private but we dont believe its needed for day one, we will be rolling this out in the following weeks after the auction launches.

• Notifications — there is a need for some form of notification to users, specific those who have been outbid or when bids are accepted, also better feedback to artists on open bids.

• General UI feedback changes — things always need more love.

Please reach out on our telegram channel or twitter @knownorigin_io account and let us know what you think.

Author
James Morgan Co-Founder KnownOrigin.io
Full Stack Software Engineer, Blockchain enthusiast. Lover of music, humanist, mostly found hacking web3 - @blockchain_manc @BlockRocketTech @knownorigin_io

First Published on Medium https://medium.com/knownorigin/adding-the-first-auction-capabilities-to-knownorigin-marketplace-bfebbe45e408

Coin Marketplace

STEEM 0.26
TRX 0.13
JST 0.031
BTC 61553.99
ETH 2881.27
USDT 1.00
SBD 3.54