---
# System prepended metadata

title: Plasm Operator Trading

---

# Plasm Operator Trading


## Overview

This Plasm module trades the smart contract's operator. There are 2 actors in this pallet:
* Sender (current contract operator)
* Buyer

![](https://i.imgur.com/dlgPzBW.png)

When the Buyer sends an offer, the OperatorFinder is called to find out the Sender (current operator) and the offered funds are locked until further action or time expiration. After the Sender accepts of the offer, the contract's operator is changed from Sender to Buyer by calling TransferOperator, and the offered funds are transfered to the Sender. The Buyer can remove, and both Buyer and Sender can reject the offer.
[`more...`](https://docs.plasmnet.io/learn/operator-trading)

## Storage
* `offers` - A mapping from the Buyers account id to the Offer
    * `T::AccountId => Option<OfferOf<T>>`

## Calls
* `fn offer` - Buyer places an offer to trade a contract's authority
* `fn accept` - Sender accepts the offer to trade
* `fn reject` - both Buyer and Sender can reject the offer
* `fn remove` - The Buyer can remove the offer

## Enums
* `OfferState` - {Waiting, Reject, Accept}

## Constants
* `TRADING_ID: LockIdentifier = *b"trading_"`

## Events
* Offer(AccountId, AccountId),
* Reject(AccountId, AccountId),
* Accept(AccountId, AccountId),
* Remove(AccountId)

## Related Modules

- [Plasm-Support](../plasm-support/README.md): The Plasm helper module.
    - {OperatorFinder, TransferOperator};


* * *

Plasm is licensed under the GPLv3.0 by Stake Technologies Inc.