---
# System prepended metadata

title: ContractShare
tags: [SAIGATE]

---

###### tags: `SAIGATE`
# ContractShare

## atomicmatch_
購入操作の際にユーザーが呼び出すコントラクト。
Orderという構造が定義されており、これらを購入者と出品者が作成する。
その値を関数の引数として渡す。

### 該当部分　ソースコード

    /**
     * @dev Call atomicMatch - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function atomicMatch_(
        address[14] addrs,
        uint[18] uints,
        uint8[8] feeMethodsSidesKindsHowToCalls,
        bytes calldataBuy,
        bytes calldataSell,
        bytes replacementPatternBuy,
        bytes replacementPatternSell,
        bytes staticExtradataBuy,
        bytes staticExtradataSell,
        uint8[2] vs,
        bytes32[5] rssMetadata)
        public
        payable
    {

        return atomicMatch(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], FeeMethod(feeMethodsSidesKindsHowToCalls[0]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[1]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[2]), addrs[4], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[3]), calldataBuy, replacementPatternBuy, addrs[5], staticExtradataBuy, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]),
          Sig(vs[0], rssMetadata[0], rssMetadata[1]),
          Order(addrs[7], addrs[8], addrs[9], uints[9], uints[10], uints[11], uints[12], addrs[10], FeeMethod(feeMethodsSidesKindsHowToCalls[4]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[5]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[6]), addrs[11], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[7]), calldataSell, replacementPatternSell, addrs[12], staticExtradataSell, ERC20(addrs[13]), uints[13], uints[14], uints[15], uints[16], uints[17]),
          Sig(vs[1], rssMetadata[2], rssMetadata[3]),
          rssMetadata[4]
        );
    }

    }
### Order 構造体
    
        /* An order on the exchange. */
    struct Order {
        /* Exchange address, intended as a versioning mechanism. */
        address exchange;
        /* Order maker address. */
        address maker;
        /* Order taker address, if specified. */
        address taker;
        /* Maker relayer fee of the order, unused for taker order. */
        uint makerRelayerFee;
        /* Taker relayer fee of the order, or maximum taker fee for a taker order. */
        uint takerRelayerFee;
        /* Maker protocol fee of the order, unused for taker order. */
        uint makerProtocolFee;
        /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
        uint takerProtocolFee;
        /* Order fee recipient or zero address for taker order. */
        address feeRecipient;
        /* Fee method (protocol token or split fee). */
        FeeMethod feeMethod;
        /* Side (buy/sell). */
        SaleKindInterface.Side side;
        /* Kind of sale. */
        SaleKindInterface.SaleKind saleKind;
        /* Target. */
        address target;
        /* HowToCall. */
        AuthenticatedProxy.HowToCall howToCall;
        /* Calldata. */
        bytes calldata;
        /* Calldata replacement pattern, or an empty byte array for no replacement. */
        bytes replacementPattern;
        /* Static call target, zero-address for no static call. */
        address staticTarget;
        /* Static call extra data. */
        bytes staticExtradata;
        /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
        address paymentToken;
        /* Base price of the order (in paymentTokens). */
        uint basePrice;
        /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
        uint extra;
        /* Listing timestamp. */
        uint listingTime;
        /* Expiration timestamp - 0 for no expiry. */
        uint expirationTime;
        /* Order salt, used to prevent duplicate hashes. */
        uint salt;
    }

### Sellorderサンプル（売り手が作成するOrder）

    .   basePrice: "1000000000000000"　//販売価格（ETH）
    .   calldata: "0x23b872dd000000000000000000000000e6b48d76bc4805abf61f38a55f1d7c362c8bfda800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
    .   exchange: "0x5206e78b21ce315ce284fb24cf05e0585a93b1d9"
    .    expirationTime: "0"
    .   extra: "0"
    .   feeMethod: 1
    .   feeRecipient: "0x5b3256965e7c3cf26e11fcaf296dfc8807c01073"
    .   hash: "0xb4fc308f42aa95eb42e5f54fd133c73554517908938708bfa10b5b190849e900"
    .   howToCall: 0
    .   listingTime: "1625391765"
    .   maker: "0xe6b48d76bc4805abf61f38a55f1d7c362c8bfda8"
    .   makerProtocolFee: "0"
    .   makerReferrerFee: "0"
    .   makerRelayerFee: "250"
    .   metadata: {asset: {id: "1", address: "0x6a55df8080c8cef5ae2d941356792fa925fdefea"}, schema: "ERC721"}
    .   paymentToken: "0x0000000000000000000000000000000000000000"
    .   quantity: "1"
    .   r: "0x3533205369ab9c22035830bd94ee2fc62474bb6fa343d458a8adfb45fc27ee21"
    .   replacementPattern: "0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000"
    .   s: "0x5e4923851c46b5d720ca4098ce7ed62d977db6458f66c4c91a8f65fe4db7e2d0"
    .   saleKind: 0
    .   salt: "39105810472022714477231934228712424453123455914673974930876616049220543647209"
    .   side: 1
    .   staticExtradata: "0x"
    .   staticTarget: "0x0000000000000000000000000000000000000000"
    .   taker: "0x0000000000000000000000000000000000000000"
    .   takerProtocolFee: "0"
    .   takerRelayerFee: "0"
    .   target: "0x6a55df8080c8cef5ae2d941356792fa925fdefea"
    .   v: 27





### 関数引数サンプル
    

| #   | Name                           | Type        | Data                                                                                                                                                                                                       |
| --- | ------------------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0   | addrs                          | address[14] | 0x5206e78b21Ce315ce284FB24cf05e0585A93B1d9                                                                                                                                                                 |
|     |                                |             | 0x213EA17dedD80488b8E3a4a6F317835F44EeE5cc                                                                                                                                                                 |
|     |                                |             | 0xE6b48d76Bc4805ABF61F38A55F1D7C362c8BfdA8                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
|     |                                |             | 0x6a55DF8080c8cef5AE2D941356792fa925fDeFea                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
|     |                                |             | 0x5206e78b21Ce315ce284FB24cf05e0585A93B1d9                                                                                                                                                                 |
|     |                                |             | 0xE6b48d76Bc4805ABF61F38A55F1D7C362c8BfdA8                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
|     |                                |             | 0x5b3256965e7C3cF26E11FCAf296DfC8807C01073                                                                                                                                                                 |
|     |                                |             | 0x6a55DF8080c8cef5AE2D941356792fa925fDeFea                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
|     |                                |             | 0x0000000000000000000000000000000000000000                                                                                                                                                                 |
| 1   | uints                          | uint256[18] | 250                                                                                                                                                                                                        |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 1000000000000000                                                                                                                                                                                           |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 1625392183                                                                                                                                                                                                 |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 53040662544980506073439903767694118150761240001752535246044738625543501304858                                                                                                                              |
|     |                                |             | 256                                                                                                                                                                                                        |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 100000000000000                                                                                                                                                                                            |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 1625391765                                                                                                                                                                                                 |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 39105810472022714477231934228712424453123455914673974930876616049220543647209                                                                                                                              |
| 2   | feeMethodsSidesKindsHowToCalls | uint8[8]    | 1                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 1                                                                                                                                                                                                          |
|     |                                |             | 1                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
|     |                                |             | 0                                                                                                                                                                                                          |
| 3   | calldataBuy                    | bytes       | 0x23b872dd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000213ea17dedd80488b8e3a4a6f317835f44eee5cc0000000000000000000000000000000000000000000000000000000000000001 |
| 4   | calldataSell                   | bytes       | 0x23b872dd000000000000000000000000e6b48d76bc4805abf61f38a55f1d7c362c8bfda800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 |
| 5   | replacementPatternBuy          | bytes       | 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
| 6   | replacementPatternSell         | bytes       | 0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000 |
| 7   | staticExtradataBuy             | bytes       |                                                                                                                                                                                                            |
| 8   | staticExtradataSell            | bytes       |                                                                                                                                                                                                            |
| 9   | vs                             | uint8[2]    | 27                                                                                                                                                                                                         |
|     |                                |             | 27                                                                                                                                                                                                         |
| 10  | rssMetadata                    | bytes32[5]  | 0x3533205369ab9c22035830bd94ee2fc62474bb6fa343d458a8adfb45fc27ee21                                                                                                                                         |
|     |                                |             | 0x5e4923851c46b5d720ca4098ce7ed62d977db6458f66c4c91a8f65fe4db7e2d0                                                                                                                                         |
|     |                                |             | 0x3533205369ab9c22035830bd94ee2fc62474bb6fa343d458a8adfb45fc27ee21                                                                                                                                         |
|     |                                |             |0x5e4923851c46b5d720ca4098ce7ed62d977db6458f66c4c91a8f65fe4db7e2d0|
|     |                                |             |0x0000000000000000000000000000000000000000000000000000000000000000|


