Wyvern exchange contract что это
Project Wyvern Ethereum Smart Contracts
Synopsis
Autonomously governed decentralized digital asset exchange.
These are the Ethereum smart contracts for the Wyvern Protocol, the Wyvern ERC20 token (WYV), and the Wyvern DAO. For general information on the Wyvern project, please see the website.
Deployed Contracts
Please note: correct deployed contract addresses will always be in config.json. If you wish to import this repository directly, please use that file. The addresses in Truffle build output are not necessarily accurate.
Mainnet
Rinkeby Testnet
Development Information
Setup
Before any development, install the required NPM dependencies:
Testing
Start Ethereum’s testrpc tool to provide a Web3 interface (leave this running):
Compile the latest smart contracts:
Run the testsuite against the simulated network:
Make sure to lint the Solidity files once you’re done:
Generating Documentation
Install the dependencies:
Autogenerate documentation from Ethereum Natspec using Doxity:
Final output will be written to docs, which will be automatically published on push to GitHub Pages at docs.projectwyvern.com.
Run automated smart contract analysis (requires Oyente and Mythril):
Flatten contract source (for e.g. Etherscan verification, requires solidity-flattener to be installed):
Contributing
Contributions welcome! Please use GitHub issues for suggestions/concerns — if you prefer to express your intentions in code, feel free to submit a pull request.
Wyvern on the OpenSea

A wyvern is a mythical two-legged dragon with a barbed tail. It is also the name of the protocol OpenSea uses to facilitate the decentralized exchange of NFTs. This article will give you an overview of all the steps buyers and sellers go through to transact on OpenSea and its technology.
At a very high level, the process looks like this:
Seller

Buyer

Components
A lot is going on here. Let’s break down each component.
WyvernProxyRegistry
The first time a seller lists on OpenSea, the WyvernProxyRegistry creates a smart contract called OwnableDelegateProxy . The seller owns this contract, and its address is stored in the proxy registry. The code for the WyvernProxyRegistry is here.
This is the «Initialize your wallet» step:

The transaction looks like this:

OwnableDelegateProxy
One OwnableDelegateProxy is created for each seller. The Wyvern exchange contract uses this new contract to take action on the seller’s behalf. A proxy contract can call methods on other contracts without storing any information about those contracts.
This process is called proxy delegation. How this works is beyond the scope of this article, but you can learn more about it here.
NFT Contract
This is the contract for the NFT collection the seller is trying to list. The first time the seller lists any item in that collection, they give their OwnableDelegateProxy contract approval to transfer tokens.
This is the «Approve this item for sale» step:

The transaction looks like this:

OpenSea Centralized Order Book
OpenSea asks the seller to sign a message containing all the details of their listing, including the sale price and expiration date. This message is called the sell order. The signature’s purpose is to validate that the seller requested the order and that nobody modified it. OpenSea stores all sell orders and signatures in a centralized database called an order book.
These sell orders are available via the OpenSea API. This allows marketplace aggregators like Genie to show valid listings on OpenSea. Even though the orders are stored off-chain, marketplaces can fulfill any valid orders on-chain. This is why it is free to list items but costs gas to cancel them. All orders are valid until they are canceled on-chain or expire.
The sell order is created and signed in the «Confirm listing» step:

The transaction looks like this:

Wyvern Exchange Contract
This contract is responsible for executing orders. You can see the code for this contract here. The buyer calls the atmoicMatch_ method with enough ETH to fulfill the order. The automicMatch_ method takes the sell order, sell order signature, buy order, and buy order signature. It checks to see if sell and buy orders match and are still valid. It will then send fees to OpenSea, send payment to the seller, and use the seller’s OwnableDelegateProxy contract to transfer NFTs from the seller to the buyer.
Once this is done, the buy and sell orders are marked as finalized in the contract.
The transaction looks like this for the buyer:

This is the final step in the process. If all goes well, the buyer has the NFT, and the seller has the payment.
Conclusion
There’s a lot more to the Wyvern Protocol than I’ve covered here, but I hope this article has given you a better understanding of each step. If you want to dig deeper, I’ve included some resources below.
Resources
On May 25, 2022 OpenSea announced plans to switch from Wyvern to a new protocol called Seaport.
Wyvern Exchange — ERC20 based crypto asset exchange
Wyvern Exchange — a decentralized digital asset exchange, operating on the Ethereum blockchain. Using the Wyvern Exchange, you can buy or sell everything you want, from virtual kittens to ENS names.

About the Wyvern exchange
Wyvern Protocol is managed by the Wyvern DAO, a decentralized autonomous organization. Anyone, who owns WYV tokens, is a shareholder of DAO Wyvern and can directly vote for management decisions or delegate their votes to a trusted party. Please, note that there are no free giveaways, airdrops and other promotions.
| No counterparty trust required | Wyvern Exchange runs on a fully open platform for the exchange of digital assets, represented on the Ethereum blockchain. No one can steal your funds or prevent you from transferring assets. |
| Buy or sell what you want | The Wyvern protocol is independent of representation. If you can send it with an Ethereum transaction, you can buy or sell it on the exchange. Wyvern Exchange optimizes UI/UX for common asset types. |
| Sell the way you want | Choose your selling method. The platform supports sales at a fixed price now, and in later versions of the protocol additional parameters will appear. |
During a beta testing, the platform generally doesn’t charge any fees. Later, a percentage portion of each sale will be charged to pay for server infrastructure and support the protocol development. Developers don’t provide a White Paper, as well as a Road Map. If you don’t understand something, or if you want to follow the platform’s news, subscribe to the project’s twitter.
Why pay attention to dapp?
The resource implements a settlement system for Ethereum intangible assets instead of ERC20 tokens. Using the exchange, everyone can broadcast their intentions, complete transactions, find counterparties by matching orders and transfer assets on the Ethereum blockchain.
- view existing orders;
- place your own orders;
- view your existing digital assets.
The project creators believe that smart contracts provide the fundamental tool, necessary to solve various problems.
The Wyvern platform runs on the Wyvern Protocol, a fully open platform for exchanging digital assets, represented on the Ethereum blockchain. Neither the developers nor anyone else with whom you trade can steal your funds. The developers don’t provide information about the availability of audit of the smart contract.
Powering decentralized crypto commerce
Trade any kind of digital asset — from rare virtual kittens to ENS names, land rights, or even smart contracts themselves.
Trade digital assets on an open protocol
Wyvern Protocol powers the peer-to-peer exchange of digital assets.

Exchange anything
Trade any kind of nonfungible asset — from rare virtual kittens to ENS names, land rights, or even smart contracts.

Exchange anywhere
Wyvern can be deployed on any EVM-based blockchain, allowing developers to power their asset exchange.

Fully open-source
The Wyvern Protocol codebase is open source, permissively licensed, and third-party audited.
Automate your crypto-commerce
Pick whichever method of sale you prefer: fixed price, Dutch auction, or something more exotic. Interface with the Exchange through a website, a mobile application, or a custom script.
Auction any kind of item
Trade any kind of nonfungible asset — from rare virtual kittens to ENS names, land rights, or even smart contracts.
Buy & sell in any configuration
Trade ERC20 tokens, ERC721 NFTs, or custom assets in any combination.
Trade mixed set of assets
Trade three Cryptokitties for a pack of Gods Unchained trading cards, and perhaps add in a few DAI to sweeten the deal.

Plug into a growing liquidity pool for the decentralized web
With more marketplaces leveraging the protocol and more orders created everyday, the Wyvern ecosystem is growing rapidly. Time to plug your app in.
Leverage existing orderooks
Don’t want to deploy your own exchange backend? Leverage an existing relayer.
. or deploy your own
Create your own orderbook to maintain full control over your marketplace infrastructure.
Join others & start building
Trusted by leading marketplaces

Wyvern is an incredibly generic protocol, which makes it flexible enough to support a diverse set of trading functionality — from bartering, bundle sales, to auctions.