Aktionariat Documentation
  • Introduction to Aktionariat
    • ⚡Quick Start
  • 🛠️APIs
    • 📊Subgraph
      • Schema
      • Query Examples
        • Platform data
        • Token Data
        • Brokerbot Data
        • Swaps Data
    • ⚙️External API
      • ⚙️External API (Gitbook)
  • 🌐Web
    • Integrate with Ethers.js
      • Brokerbot Quoter
    • Integrate Aktionariat Widgets
  • ⛓️Smart Contracts
    • 📔Contracts Overview
    • 👷‍♂️Guides
      • Implement A Trade
        • Direct Trades
        • Multihop Trades
      • Get Brokerbot Contract for Token
      • Buy Shares
      • Sell Shares
    • Technical Reference
      • Allowlist
      • Brokerbot
      • Drag-Along
      • Infinite Allowances
      • Multi-Signature Contract
      • Recovery
      • Shareholder Registry
  • 📖Reference
    • Brokerbot Architecture
    • Github
    • Whitepaper
    • Brokerbot Analytics
  • 💬Socials
    • Twitter
    • Telegram
    • LinkedIn
    • Youtube
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Smart Contracts
  2. Guides

Sell Shares

The sell process is straight forward. You transfer the share token via transferAndCall to the Brokerbot and the Brokerbot pays you out the according amount in the base currency (XCHF).

contract SellSharesExample {
    //constants
    BrokerbotRegistry public constant BROKERBOT_REGISTRY = 0xcB3e482df38d62E73A7aE0E15a2605caDcc5aE98;
    IERC20 public constant XCHF = 0xB4272071eCAdd69d933AdcD19cA99fe80664fc08;
    // immutables
    IERC20 public immutable share;
    Brokerbot public immutable brokerbot;

    contstructor(IERC20 shareToken){
        share = shareToken;
        brokerbot = BROKERBOT_REGISTRY.getBrokerbot(XCHF,share);
    }  
    
    function SellShares(amountShares) external {
        share.transferAndCall(brokerbot, amountShares, "0x"));
    }
PreviousBuy SharesNextTechnical Reference

Last updated 1 year ago

Was this helpful?

⛓️
👷‍♂️