Last updated
Last updated
OmniEscrow is a form of digital asset auctioning and bidding. Any ERC20 or native tokens can be auctioned and bidden. Upon acceptance of a bid the bidder instantly receives the offered assets, and the auctioner instantly receives the bidden assets; this happens in the same transaction ensuring safety and transparency. Accessible from and
Let's start by defining an OmniEscrow variable
To create a new Escrow auction (internally called an escrow contract), we only need to call newContract
. Let's take a look at its parameters first.
Now lets call it with our parameters
We successfully created a new escrow auction.
Cancelling an auction can only be done by the creator. Upon cancelling the owner gets their assets back, and the bidders will still be able to cancel their bids to get their assets back even after the auction has been cancelled.
To cancel an OmniEscrow auction simply call deleteContract
and pass the id of the contract you wish to cancel.
To place a bid on an existing and live contract, we need to call newBid
and pass it the id of the auction we want to bid on. An auction's owner cannot place a bid on their own auction. Let's take a look at the parameters of newBid
.
Now let's call it with our parameters.
After placing a bid, the auction automatically assigns it a number (bidCount
) that identifies it. We will need that number when we need to either accept or cancel a bid.
To lookup a bid's count on a certain contract we need to lookup the auction and get its current bid count right after placing our bid. So after calling newBid, we call lookupCountractBidCount
, and yes countract is a typo in the deployed source code 😞.
To accept one of the bids on our auction, the bid must not be cancelled and the auction must be ongoing (no other accepted bids and auction is not cancelled). The owner of the auction can call acceptBid
and pass it the auction ID and the accepted bid's count. Upon accepting a bid the bidder gets the offered assets and the auction owner gets the accepted bid's asset. Both events happen simultaneously in the same transaction.
Any bidder can cancel their bid as long as it hasnt been accepted by the auction owner. To cancel a bid call cancelBid
and pass it the auction's ID and the bid's count.
Now we now know how to interact with OmniEscrow contracts. 😮💨
There are many actions that can be conducted when calling an OmniEscrow contract. You can create a new auction, place a bid, accept a placed bid, cancel your created auction, and cancel your placed bid whenever you want. Start by downloading the from our github repo. You can find a list of all Omnify services' tiers and fees at .