OpenSea의 편성을 읽고 있습니다.

메시지


구조기


V1
https://etherscan.io/address/0x7be8076f4ea4a4ad08075c2508e481d6c946d12b
V2 (여기 봐)
https://etherscan.io/address/0x7f268357a8c2552623316e2562d90e642bb538e5

사이트 축소판 그림


https://recruit.gmo.jp/engineer/jisedai/blog/opensea-research/
https://blog.suishow.net/2021/08/25/opensea-market-contract설명 /
https://note.com/dkcrypto1/n/nd0aca44a50c5

기억 폐기물


https://zenn.dev/mkurita/scraps/2851e7338e75d7

이미지


상속 관계



프로세스(먼저 공유)


(생략됨)

세부 사항 처리


우선 OpenSea의 주요 기능으로
  • 제작(Create)
  • 출품(Sell)
  • 구매(Buy)
  • 견적(Make Offer)
  • 취소(Cancel)
  • 네.
    하나하나 설명하다.(뭔가 잘못되면 알려주세요.)

    만들기(Mint)



    작품의 이미지를 전시하고 NFFT를 등록하는 기능입니다.

    전시(Sell)



    제작된 NFC는 시장에 전시된다.

    registerProxy()


    먼저 Proxy Registory 구조기의 register proxy를 호출합니다.
    여기에 자신의 주소 전용 proxy를 proxies에 로그인하십시오.
    ※ 초행만
    https://etherscan.io/address/0xa5409ec958C83C3f309868babACA7c86DCB077c1
    function registerProxy()
    public
    returns (OwnableDelegateProxy proxy)
    {
       // すでに作成されているかチェック
       require(proxies[msg.sender] == address(0));
       // OwnableDelegateProxyのproxyを作成
       proxy = new OwnableDelegateProxy(msg.sender, delegateProxyImplementation, abi.encodeWithSignature("initialize(address,address)", msg.sender, address(this)));
       // proxiesへ登録
       proxies[msg.sender] = proxy;
       return proxy;
    }
    

    setApprovalForAll()


    이 방법을 사용하면registerProxy () 제작된proxy에 NFFT의 전송 권한을 부여합니다.
    이렇게 되면 proxy는 NFC를 자유롭게 전송할 수 있다.
    ※ ERC 721 또는 ERC 1155의 구성 처리

    구매(Buy)



    atomicMatch()


    이곳은 아마도 가장 중심적인 처리라고 할 수 있을 것이다.
    셀이나 바이의 콜데이터 기반으로 입금해 NFFT 이전을 진행한다.
    각양각색의 요점이 있다.(하나하나의 상세한 내용을 따로 기록해야 하나요?)
    CheckOut 때 작성된 데이터를 살펴보자.

    Data
    > address:
    0x7f268357A8c2552623316e2562D90e642bB538E5 // OpenSeaのコントラクト
    0x8fD4819eD56408a33eF6b0FE3d267579497FE011 // 購入者のアドレス
    0x3E8f28BBDC3abBd7450518DD1E09430F1b8b009F // 出品者のアドレス
    0x0000000000000000000000000000000000000000
    0x495f947276749Ce646f68AC8c248420045cb7b5e // OpenSea Shared Storefrontというtracker
    0x0000000000000000000000000000000000000000
    0x0000000000000000000000000000000000000000
    0x7f268357A8c2552623316e2562D90e642bB538E5 // OpenSeaのコントラクト
    0x3E8f28BBDC3abBd7450518DD1E09430F1b8b009F // 出品者のアドレス
    0x0000000000000000000000000000000000000000
    0x5b3256965e7C3cF26E11FCAf296DfC8807C01073 // 販売手数料の受け取りアドレス
    0x495f947276749Ce646f68AC8c248420045cb7b5e // OpenSea Shared Storefrontというtracker
    0x0000000000000000000000000000000000000000
    0x0000000000000000000000000000000000000000
    0x7f268357A8c2552623316e2562D90e642bB538E5 // OpenSeaのコントラクト
    0x3E8f28BBDC3abBd7450518DD1E09430F1b8b009F // 出品者のアドレス
    0x0000000000000000000000000000000000000000
    0x5b3256965e7C3cF26E11FCAf296DfC8807C01073 // 販売手数料の受け取りアドレス
    0x495f947276749Ce646f68AC8c248420045cb7b5e // OpenSea Shared Storefrontというtracker
    0x0000000000000000000000000000000000000000
    0x0000000000000000000000000000000000000000
    
    > uints:
    250 // 売買成立時にOpenSeaに支払う手数料(makerが払う)
    0   // 売買成立時にOpenSeaに支払う手数料(takerが払う)
    0
    0
    1000000000000000
    0
    1650789427
    0
    39084863006214373240324378108073879226763846619051693146992710516441163329964
    250
    0
    0
    0
    1000000000000000
    0
    1645271808
    1660906608
    40016311087236705643380035686772935131414220092142398132607028984093621814475
    
    > feeMethodsSidesKindsHowToCalls:
    1
    0
    0
    0
    1
    1
    0
    0
    
    > calldataBuy:
    0xf242432a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008fd4819ed56408a33ef6b0fe3d267579497fe0113e8f28bbdc3abbd7450518dd1e09430f1b8b009f000000000000060000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000
    
    > calldataSell:
    0xf242432a0000000000000000000000003e8f28bbdc3abbd7450518dd1e09430f1b8b009f00000000000000000000000000000000000000000000000000000000000000003e8f28bbdc3abbd7450518dd1e09430f1b8b009f000000000000060000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000
    
    > replacementPatternBuy:
    0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    
    > replacementPatternSell:
    0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    
    > staticExtradataBuy:
    0x
    
    >staticExtradataSell:
    0x
    
    > vs:
    28
    28
    
    > rssMetadata:
    0x4e45cfae11d66bd60d4bba5956dd96901d3f347a9d924c8805902decfc860efc
    0x586f75e97f8952ae65547cad025a1ba57249f098a0f3b84446e79ba1d96e4ed4
    0x4e45cfae11d66bd60d4bba5956dd96901d3f347a9d924c8805902decfc860efc
    0x586f75e97f8952ae65547cad025a1ba57249f098a0f3b84446e79ba1d96e4ed4
    0x0000000000000000000000000000000000000000000000000000000000000000
    
    다양한 데이터의 나열을 한눈에 보면 구조기 안에서 어떻게 사용되는지 잘 모르기 때문이다.
    먼저 데이터를 어디에 건네야 하는지를 말하자면, 각각의 데이터를 아토믹 매치에 맡기도록 지정하는 것이다.
    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


    Order struct
    /* An order on the exchange. */
    struct Order {
        /* Exchange address, intended as a versioning mechanism. */
        address exchange; // メインのOpenSeaのコントラクトアドレス
        /* 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;
    }
    
    이 Order를 사용하여 처리합니다.

    각각 처리하다


    지휘자의 집행자에 따라 분기하여 처리하다
    /* Ensure buy order validity and calculate hash if necessary. */
    bytes32 buyHash;
    /* もしatomicMatchの実行者が購入者だったら */
    if (buy.maker == msg.sender) {
        // BUYのパラメータが正しいかチェック
        require(validateOrderParameters(buy));
    // もしatomicMatchの実行者が他の人だったら
    } else {
        // ハッシュを計算
        buyHash = _requireValidOrderWithNonce(buy, buySig);
    }
    
    /* Ensure sell order validity and calculate hash if necessary. */
    bytes32 sellHash;
    /* もしコントラクトの実行者が出品者だったら */
    if (sell.maker == msg.sender) {
        require(validateOrderParameters(sell));
    } else {
        sellHash = _requireValidOrderWithNonce(sell, sellSig);
    }
    
    주문 일치 확인
    /* Must be matchable. */
    // buyとsellのオーダーが一致しているかチェック
    require(ordersCanMatch(buy, sell));
    
    여기registerProxy()에서 제작한 프로시저를 얻었습니다.
    proxie가 없으면 설정을 중지합니다.
    /* Retrieve delegateProxy contract. */
    OwnableDelegateProxy delegateProxy = registry.proxies(sell.maker);
    
    /* Proxy must exist. */
    require(delegateProxy != address(0));
    
    이전 처리 자체를 AuthenticatedProxy에 위탁하기 때문에 취득한 프로시저에 따라 authic ateProxy를 취득한다.
    /* Access the passthrough AuthenticatedProxy. */
    AuthenticatedProxy proxy = AuthenticatedProxy(delegateProxy);
    
    여기에는 산열을 바탕으로 그 주문서의 완성 여부를 표시하는 표지가 서 있다
    /* Mark previously signed or approved orders as finalized. */
    if (msg.sender != buy.maker) {
        // そのオーダーがキャンセルもしくは完了したかフラグを立てる
        cancelledOrFinalized[buyHash] = true;
    }
    if (msg.sender != sell.maker) {
        cancelledOrFinalized[sellHash] = true;
    }
    
    NFC의 금액을 지불한다.executeFundsTransfer에서 송금이 실패한 경우 구조를 정지한다.
    /* Execute funds transfer and pay fees. */
    uint price = executeFundsTransfer(buy, sell);
    
    실제 NFC 이전.
    !
    이 proxy에 대해 setApproveForAll()를 했기 때문에, proxy 설정은 NFFT의 이전 권한을 가지고 있습니다.그래서 제작자가 다시 서명하거나 전달할 필요가 없다.
    /* Execute specified call through proxy. */
    require(proxy.proxy(sell.target, sell.howToCall, sell.calldata));
    
    제작 중

    좋은 웹페이지 즐겨찾기