=== Unicrow: Cryptocurrency escrow === Contributors: Unicrow Tags: payments, escrow, stablecoins, cryptocurrencies, ethereum Requires at least: 6.0 Tested up to: 6.7 Stable tag: 1.0.0 Requires PHP: 7.0 License: GPLv2 Unicrow is a non-custodial escrow protocol for ETH, stablecoins, and other ERC20 tokens. This integrates it into a WooCommerce and optionally Dokan == Description == The plugin makes it easy to integrate _Unicrow_ into a marketplace built on _WooCommerce_ and optionally _Dokan_. It extends _WooCommerce_ and _Dokan_ settings to allow admins to configure its parameters # Overview There are a few things important to understand before we get into the (very simple) setup. ## About _Unicrow_ To better grasp the potential that _Unicrow_ brings to marketplace operators, it is good to understand the protocol basics. * _Unicrow_ runs on Ethereum's Layer 2s _Arbitrum One_ and _Base_ and supports _ETH_ and any ERC20 token, e.g. stablecoins like _USDT_ or _USDC_ * Each individual escrow has the following parameters: _seller_ (supposed to receive the funds), _marketplace_ (optional, gets a commission), _arbitrator_ (optional, decides a dispute), and what's the _challenge_ (escrow) _period_. * The _Buyer_ can release funds to the _seller_ at any time * Funds can be claimed to the _seller_ after the _challenge period_ ends * The _Marketplace_ and/or _arbitrator_ fees will be sent out when the funds are claimed or released from the escrow. * _Unicrow_ is *immutable* and *non-custodial* You can read more details at [docs.unicrow.io](https://docs.unicrow.io/docs/introduction/summary). The [Quick Start](https://docs.unicrow.io/docs/quick-start/basic-concepts) section of our documentation website includes useful information for users. Feel free to copy&paste any of the content or refer to it in your marketplace user guides. ## Supported tokens The plugin supports _ETH_, _USDC_, and _USDT_ on _Arbitrum One_ network. We will extend the support for _Base_ soon and for additional tokens based on feedback and eventually make it easier for admins to add support for any tokens. In the meantime, the admins can extend support in the source code directly (see Advanced Setup below) # Supported functionality ## WooCommerce _Unicrow_ plugin extends _Wooommerce_ (WC) in the following ways: * It is added to a list of payment methods in WC's settings and on the checkout page * It adds an optional _seller address_ attribute to product settings - this technically allows operating a multi-vendor marketplace even without _Dokan_, simply by adding different _seller address_ to different products. * It adds a link to the transaction in _Unicrow_ web3 app to admin emails and to the order notes. ## Dokan The plugin further adds or reuses the following to _Dokan_ settings: * It uses _Dokan_'s admin commission as a _marketplace fee_ parameter in _Unicrow_ transactions * It adds _seller address_ parameter to vendor settings and if set, uses it in the transactions (in that case, setting _seller address_ in product settings or _WooCommerce_ Payment settings is not necessary) * It adds to an email sent to the vendor a note with a link to the transaction in _Unicrow_ web3 app # Prerequisites ## Wordpress plugins: * _WooCommerce_ is a required and technically sufficient pre-requisite since _Unicrow_ plugin hooks into its functions for setting up and for payment processing.  While _WooCommerce_ itself doesn't support multi-vendor setup, _Unicrow_ extends product settings for _seller address_ attribute. That means if an admin doesn't want to complicate things with multiple sellers and an additional plugin such as _Dokan_, but wants to be able to process payments to different addresses for different products, the combination of WC and _Unicrow_ allows for this. * (Optional) _Dokan_ for full multi-vendor functionality. ## Other/Crypto-related prerequisites for different actors: * Marketplace operator * A secure wallet able to receive fees (if applicable) on the supported network * An online web3 wallet to provide arbitration service loaded with a little bit bit of _ETH_ to pay for gas costs  * (optional) An online web3 wallet that would regularly claim payments to _sellers as a service to them (for simplification it can be done also from the Arbitrator wallet) * Buyer * A web3 wallet with sufficient balance to pay the purchase and a little bit of _ETH_ on the supported network * Seller * An Ethereum address to receive the supported tokens on the supported network # Setting Up Follow these steps to set up _Unicrow_ with WooCommerce and, optionally, _Dokan_ 1. Open Wordpress Admin Console 1. Install and activate _WooCommerce_, _Unicrow WooCommerce plugin_, and optionally _Dokan_ 2. Open **_WooCommerce_ → Settings → Payments** and press Manage next to _Unicrow_ 3. Enter the values per your preference: * **Default Seller Address**: If you plan to receive all payments to one address, paste that address here. Leave it empty if you plan to set _seller address_ per product or (in _Dokan_) per vendor * **Marketplace Address**: If you plan to collect a commission directly from _Unicrow_ to your wallet, paste its address here. This can be a cold wallet or even an exchange address as long as it supports receiving the tokens you chose on the supported network (currently _Arbitrum One_ TODO: add link to arbitrum guide). * **Marketplace Commission**: Leave empty if you want the plugin to reuse _Dokan_ commission settings or if you don't plan to charge a commission. * **Challenge Period**: How long a buyer can challenge the payment. After this, the _seller_ can claim the payment. * **Arbitrator address**: An address of a wallet account from which you will resolve disputes. The address should be funded with a little bit of _ETH_ for gas fees and easy to access and make transactions from, e.g. a browser or even a mobile wallet. It won't hold customer funds at any point so it can be "hot". * **Arbitrator fee**: Arbitrator fee in %. If the marketplace operator is an arbitrator too, can leave this at 0. * **Accepted tokens**: Currently supporting _ETH_, _USDT_, _USDC_. We'd like your feedback which ones we should prioritize and will eventually let you manage a custom list (which you of course can still do by opening the plugin code and editing config.php :-) 4. If you use _Dokan_, you can set _seller address_ per vendor in **Users -> All Users -> Edit -> Unicrow Vendor Options** # Advanced Setup Please don't hesitate to contact us at hello@unicrow.io to suggest improvements, but in the meantime if you want to add some other ERC20 token to the list or switch the plugin to support _Base_, you can do it by editing the plugin code using a plugin like [WPIDE](https://wordpress.org/plugins/wpide/): * To add a custom ERC20 token, edit _config.php_ * In this case, we'd recommend to edit the description to reflect this too * To switch to _Base_, edit _src/class-wc-gateway-unicrow.php_ and change `'chainId' => 42161,` to `8453` == External services == The plugin reads ETH price from Coingecko's public API (api.coingecko.com). It also connects to Unicrow's REST API to create a payment request in Unicrow's app. Subsequently it redirects a user to the app to pay the re request and uses the provided callback url to send the user back to the confirmation page. The data submitted to the REST API are: * order price * order number * buyer, seller, marketplace, and arbitrator ETH addresses * marketplace and arbitrator commissions * escrow period == Frequently Asked Questions == = What cryptocurrencies and networks are supported? = ETH, USDC, and USDT on Arbitrum One. = Will you add more tokens and networks = Yes, we'll add support for Base (which is already supported by Unicrow) and more tokens based on feedback = Can I add support for a specific token myself? = Yes, edit the config.php file and add your preferred token information = Is Dokan required? = No, WooCommerce is sufficient, but Dokan adds additional multi-vendor functionality. == Changelog == = 1.0.0 = * Initial release == Upgrade Notice == = 1.0.0 = Initial release == Screenshots == 1. Unicrow checkout box with token selection 2. Checkout box when only one token is set by the admin 3. Payment request summary 4. Wallet popped up asking for payment confirmation 5. Payment confirmed in Unicrow app 6. Email confirmation with escrow information 7. Arbitrator's payment summary screen 8. Arbitration form 9. Payment ready to be claimed 10. Seller's view of the payment with a refund button