Rawrshak Documentation
  • Rawrshak
  • Rawrshak Platform
    • What is the Rawrshak Platform?
    • Platform Overview
    • Rawrshak Ecosystem
    • Networks
    • Litepapers
    • Community Channels
    • Partnerships & Integrations
  • Tutorials
    • Gamer
      • Setup
        • Metamask Wallet
        • Adding Optimism Kovan Network
        • Funding Testnet Wallet
      • Demo
    • Developer
      • Setup
        • Arweave Wallet
          • ArDrive Account
        • Pinata
        • Unity
      • Demo
      • Unity
        • Loading the Rawrshak Tools
        • Loading the Rawrshak SDK
        • 3D Static Object In-game Framework
        • Packaging an Asset
          • Static 3D Object Asset
          • Audio Asset
        • Custom Subgraph Query
        • Prefabs
          • Wallet
          • Subgraph
          • Ethereum Blockchain Query
          • Rawrshak Asset
      • Rawrshak Dapp
        • Deploy a Content Contract
        • Upload Data to Arweave
        • Deploying a Meta Asset
          • Image Meta Asset
          • Audio Meta Asset
          • Static 3D Object Meta Asset
        • Updating a Meta Asset's Metadata
        • Minting a Meta Asset
        • Selling a Meta Asset
      • 🚧Custom Subgraphs
    • Unity Asset Viewer
  • Gamers
    • Gamer Decentralized Applications
    • Gaming Marketplace
    • Meta Assets
    • Supported Wallets
  • Developers
    • Smart Contracts
      • Content Contracts
        • Content
        • Content Manager
        • Content Storage
        • Content Factory
      • Exchange Contracts
        • Exchange
        • Orderbook
        • Execution Manager
        • Royalty Manager
        • Erc20Escrow
        • NftEscrow
      • Libraries
        • LibAsset
        • LibOrder
      • Utilities
        • Address Resolver
    • Meta Asset Framework
      • Asset Metadata
      • Asset Types
        • Text Assets
        • Image Assets
        • Audio Assets
        • Static 3D Objects
    • Game Engines
      • Unity Game Engine
        • Unity SDK
        • Unity Tools
      • Unreal Game Engine
      • Godot Game Engine
    • Developer Decentralized Applications
    • Rawrshak Subgraphs
      • Entities
        • Content Subgraph
        • Exchange Subgraph
  • Governance
    • RAWR Token
      • Tokenomics
      • Contract Addresses
    • Rawrshak DAO
Powered by GitBook
On this page
  1. Developers
  2. Smart Contracts
  3. Exchange Contracts

Execution Manager

FUNCTIONS

tokenEscrow()

nftsEscrow()

verifyToken(_token)

placeBuyOrder(_orderId, _token, _sender, _tokenAmount)

placeSellOrder(_orderId, _sender, _asset, _assetAmount)

executeBuyOrder(_user, _orderIds, _paymentPerOrder, _amounts, _asset)

executeSellOrder(_user, _orderIds, _paymentPerOrder, _amounts, _token)

cancelOrders(_orderIds)

claimOrders(_user, _orderIds)

addSupportedToken(_token)

tokenEscrow() -> address

Retrieves a token's contract address.

visibility: external

state mutability: view

nftsEscrow() -> address

Retrieves a non-fungible token's contract address.

visibility: external

state mutability: view

verifyToken(address _token) -> bool

Verifies whether the payment token entered is supported by Rawrshak.

visibility: external

state mutability: view

placeBuyOrder(uint256 _orderId, address _token, address _sender, uint256 _tokenAmount)

Transfers _tokenAmount of _token from _sender to the Erc20Escrow contract and updates the escrowedByOrder mapping.

visibility: external

state mutability:

placeSellOrder(uint256 _orderId, address _sender, LibOrder.AssetData _asset, uint256 _assetAmount)

Transfers _assetAmount of _asset to the NftEscrow contract and updates the escrowedAssets and escrowedAmounts mappings.

visibility: external

state mutability:

executeBuyOrder(address _user, uint256[] _orderIds, uint256[] _paymentPerOrder, uint256[] _amounts, LibOrder.AssetData _asset)

Transfers assets to escrow to be claimed by buyers and withdraws token payment from escrow to _user, updating necessary records.

Requirement:

  • The length of _orderIds must equal the length of _paymentPerOrder and _amounts.

visibility: external

state mutability:

executeSellOrder(address user, uint256[] _orderIds, uint256[] _paymentPerOrder, uint256[] _amounts, address _token)

Transfers token payment to escrow to be claimed by sellers and withdraws purchased assets to _user, updating necessary records.

Requirement:

  • The length of _orderIds must equal the length of _paymentPerOrder and _amounts.

visibility: external

state mutability:

cancelOrders(uint256[] _orderIds)

For buy orders, this function withdraws unused token payments and claims purchased assets (if any, from partial fills). For sell orders, this function withdraws unsold assets and claims token payments (if any, from partial fills).

visibility: external

state mutability:

claimOrders(address _user, uint256[] _orderIds)

Withdraws escrowed assets from filled or partially filled orders. Updates order state to "CLAIMED" if the order is completely filled.

visibility: external

state mutability:

addSupportedToken(address _token)

Adds _token to the list of supported ERC20 tokens on Rawrshak.

Emits an AddedTokenSupport event.

visibility: external

state mutability:

PreviousOrderbookNextRoyalty Manager

Last updated 3 years ago

Passes through .

Erc20Escrow.sol