Giter Site home page Giter Site logo

boa-space-seaport-js's Issues

주문 완료 기능에 대한 Web3 코드 작성

다음의 기능에 대한 Web3 코드를 작성합니다. 이 이슈는 boa-space-contracts의 #19 이슈에서 이관되었고, 모든 코드는 boa-space-seaport-js 라이브러리에 기반하여 작성합니다.

사용될 Consideration 컨트랙트 함수

  • fulfillBasicOrder(sig=0xfb0f3ee1)
  • fulfillOrder(0xb3a34c4c)
  • fulfillAdvancedOrder(0xe7acab24)
  • matchOrders(0xa8174404)
  • matchAdvancedOrders(0x55944a42)
  • fulfillAvailableOrders(0xed98a574)
  • fulfillAvailableAdvancedOrders(0x87201b41)
  • cancel(0xfd9f1e10)
  • validate(0x88147732)
  • incrementCounter(0x5b34b966)

주요 고려사항

  • SharedStorefrontLazyMintAdapter 컨트랙트
  • AssetContractShared 컨트랙트
  • 리스팅 예제 작성
  • 오퍼 예제 작성
  • WBOA9 ERC20 token: 기존에 BoaSwap에서 사용되던 WBOA
  • PayableProxy 컨트랙트: boa-space-contracts 관련 이슈
  • 오더의 구성요소인 salt: salt는 seaport-js에 generateRandomSaltWithDomain 함수로 처리됨.

고려되지 않는 사항

  • Zone의 개념
  • 디폴트 Conduit

Check the errors when importing `boa-space-contracts` module

깃헙 CI workflow를 진행하면서 다음에 대한 사항을 체크하도록 한다.

We use the seaport module from boa-space-contracts instead of the ProjectOpenSea/seaport. But some errors occur when running the test. This is not critical in the current state but we should check why the errors occur.

The errors are as follows.

1) As a user I want to buy now or accept an offer
       A single ERC721 is to be transferred
         [Buy now] I want to buy a single ERC721
           with ETH
             ERC721 <=> ETH (already validated order):
     AssertionError: Expected transaction to be reverted with InvalidSigner, but other exception was thrown: Error: VM Exception while processing transaction: reverted with custom error 'InvalidSignature()'
  
  2) As a user I want to buy now or accept an offer
       A single ERC721 is to be transferred
         [Buy now] I want to buy a single ERC721
           with ERC20
             ERC721 <=> ERC20 (already validated order):
     AssertionError: Expected transaction to be reverted with InvalidSigner, but other exception was thrown: Error: VM Exception while processing transaction: reverted with custom error 'InvalidSignature()'
  
  3) As a user I want to buy now or accept an offer
       A single ERC1155 is to be transferred
         [Buy now] I want to buy a single ERC1155
           with ETH
             ERC1155 <=> ETH (already validated order):
     AssertionError: Expected transaction to be reverted with InvalidSigner, but other exception was thrown: Error: VM Exception while processing transaction: reverted with custom error 'InvalidSignature()'
  
  4) As a user I want to buy now or accept an offer
       A single ERC1155 is to be transferred
         [Buy now] I want to buy a single ERC1155
           with ERC20
             ERC1155 <=> ERC20 (already validated order):
     AssertionError: Expected transaction to be reverted with InvalidSigner, but other exception was thrown: Error: VM Exception while processing transaction: reverted with

Constants 값들에 대한 정리 및 적용

constants.ts 파일에 다음의 중요 상수가 정의되어 있으며, 이것들에 대한 세팅에 대한 정책을 다음과 같이 수립한다.

  • SEAPORT_CONTRACT_NAME (완료)

    • BosSpace는 Seaport 프로토콜을 사용함으로, "Seaport"를 그대로 사용한다.
  • SEAPORT_CONTRACT_VERSION (완료)

    • BosSpace는 Seaport 프로토콜 1.1을 사용함으로, "1.1"을 그대로 사용한다.
  • OPENSEA_CONDUIT_KEY

    • BosSpace는 기본 Conduit을 사용하지 않고, Seaport상에서 바로 거래가 이루어짐으로 아래와 같이 Zero Hash를 세팅한다.
    • "0x0000000000000000000000000000000000000000000000000000000000000000"
  • OPENSEA_CONDUIT_ADDRESS:

    • BosSpace는 기본 Conduit을 사용하지 않고, Seaport상에서 바로 거래가 이루어짐으로 아래와 같이 Zero Address를 세팅한다.
    • "0x0000000000000000000000000000000000000000"
  • CROSS_CHAIN_SEAPORT_ADDRESS

    • 메인넷에 배포되는 Seaport 컨트랙트의 주소를 세팅한다.
  • DOMAIN_REGISTRY_ADDRESS

    • BosSpace는 DomainRegistry 컨트랙트를 사용하지 않으므로 다음과 같이 Zero Address를 세팅한다.
    • "0x0000000000000000000000000000000000000000"

다음은 테스트넷과 메인넷에서 boa-space-seaport-jsSeaport 객체를 생성해서 사용할때의 코드의 예제이다.

const seaport = new Seaport(ethers.provider, {
  overrides: {
    contractAddress: "0x4F445109d11419c3612e43D2e71a3593921621E0", // 테스트넷에 배포된 Seaport 컨트랙트 주소
  },
});
const seaport = new Seaport(ethers.provider); // 디폴트로 CROSS_CHAIN_SEAPORT_ADDRESS 값을 사용하게 됨.

깃헙 CI 워크플로우 추가시 문제 처리

./github/workflow/main.yaml에서
run: yarn install이나 npm: npm install에서 모두 이슈가 발생함으로 추가 조사 진행 필요. 여기 PR 참조

  1. run: yarn install의 경우 다음의 에러 발생
    Run yarn install
    /__w/_temp/0bb985ed-2427-4b2d-b8f8-4ccddaddc19e.sh: 1: yarn: not found
    Error: Process completed with exit code 127.
    로컬에서는 안 생기는 문제이고, 다시 조사할 필요 있음.

  2. run: npm install의 경우 다음의 에러 발생
    npm WARN tarball tarball data for ltgt@https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz (sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==) seems to be corrupted. Trying again.
    이 경우, 서버의 에러인것으로 보이고 기다려봐야할 것으로 보임.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.