Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to deploy Land contracts #153

Closed
spoonknife22 opened this issue Jan 24, 2021 · 15 comments
Closed

Trying to deploy Land contracts #153

spoonknife22 opened this issue Jan 24, 2021 · 15 comments

Comments

@spoonknife22
Copy link

Hello, I am trying to deploy the Land contracts and having some trouble. Could someone tell me the order they are deployed and what goes in function initialize(bytes) in the LANDRegistry contract? Any help would be greatly appreciated.

@nachomazzara
Copy link
Collaborator

You can simply deploy the land registry fully compiled. For initialize, you can use 0x

@Specbee-onchain
Copy link

Specbee-onchain commented Apr 28, 2021

yeah, but somehow land is not displayed then in the marketplace

@nachomazzara
Copy link
Collaborator

You also need to mint some lands

@Specbee-onchain
Copy link

Specbee-onchain commented Apr 29, 2021

LAND minting happens only via "assignMultipleParcels"? I have done that, I have my LAND NFTs in my wallet. I was able to sell them via my marketplace contract directly using etherscan. Somehow indexer subgraph in the marketplace does not fetch all my entities if I try using marketplace UI.

@nachomazzara
Copy link
Collaborator

nachomazzara commented Apr 29, 2021

I think that this issue is related to this topic, Right?

Can you share the subgraph.yaml file here after building data? I mean, with hardcoded variables

@Specbee-onchain
Copy link

Specbee-onchain commented Apr 30, 2021

description: Bearland's Marketplace
repository: https://github.com/bear-finance/marketplace
schema:
  file: ./schema.graphql
dataSources:
  # ---------------------------------------------------------
  # PARCELS -------------------------------------------------
  # ---------------------------------------------------------
  - kind: ethereum/contract
    name: LANDRegistry
    network: ropsten
    source:
      address: '0xead5be7a17881adc74419565dbd67508979ad2f4'
      abi: LANDRegistry
      startBlock: 8131821
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/parcel.ts
      entities:
        - ERC721
        - Parcel
        - Data
      abis:
        - name: LANDRegistry
          file: ./abis/LANDRegistry.json
      callHandlers:
        - function: initialize(bytes)
          handler: handleInitialize
      eventHandlers:
        - event: Update(indexed uint256,indexed address,indexed address,string)
          handler: handleUpdate

  # ---------------------------------------------------------
  # ESTATES -------------------------------------------------
  # ---------------------------------------------------------
  - kind: ethereum/contract
    name: EstateRegistry
    network: ropsten
    source:
      address: '0xd8dbe60aeb7cd1f04df2fd89e35e418346508672'
      abi: EstateRegistry
      startBlock: 8131821
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/estate.ts
      entities:
        - Estate
        - Parcel
        - Data
      abis:
        - name: EstateRegistry
          file: ./abis/EstateRegistry.json
        - name: LANDRegistry
          file: ./abis/LANDRegistry.json
      eventHandlers:
        - event: CreateEstate(indexed address,indexed uint256,string)
          handler: handleCreateEstate
        - event: AddLand(indexed uint256,indexed uint256)
          handler: handleAddLand
        - event: RemoveLand(indexed uint256,indexed uint256,indexed address)
          handler: handleRemoveLand
        - event: Update(indexed uint256,indexed address,indexed address,string)
          handler: handleUpdate

  # ---------------------------------------------------------
  # MANA ----------------------------------------------------
  # ---------------------------------------------------------
  # - kind: ethereum/contract
  #   name: MANAToken
  #   network: ropsten
  #   source:
  #     address: '0xc267090d65b9389c5006d49b2c46b86c71470acb'
  #     abi: MANAToken
  #     startBlock: 8131821
  #   mapping:
  #     kind: ethereum/events
  #     apiVersion: 0.0.3
  #     language: wasm/assemblyscript
  #     file: ./src/handlers/manaToken.ts
  #     entities:
  #       - Wallet
  #     abis:
  #       - name: MANAToken
  #         file: ./abis/MANAToken.json
  #     eventHandlers:
  #       - event: Mint(indexed address,uint256)
  #         handler: handleMint
  #       - event: Burn(indexed address,uint256)
  #         handler: handleBurn
  #       - event: Transfer(indexed address,indexed address,uint256)
  #         handler: handleTransfer

  # ---------------------------------------------------------
  # ORDERS --------------------------------------------------
  # ---------------------------------------------------------
  - kind: ethereum/contract
    name: Marketplace
    network: ropsten
    source:
      address: '0xd075116d6eb21afabfc58fdc8a115c5bf044a0fe'
      abi: Marketplace
      startBlock: 8131821
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/marketplace.ts
      entities:
        - Order
        - NFT
      abis:
        - name: Marketplace
          file: ./abis/Marketplace.json
      eventHandlers:
        - event: OrderCreated(bytes32,indexed uint256,indexed address,address,uint256,uint256)
          handler: handleOrderCreated
        - event: OrderSuccessful(bytes32,indexed uint256,indexed address,address,uint256,indexed address)
          handler: handleOrderSuccessful
        - event: OrderCancelled(bytes32,indexed uint256,indexed address,address)
          handler: handleOrderCancelled

  # ---------------------------------------------------------
  # ENS -------------------------------------------------
  # ---------------------------------------------------------
  - kind: ethereum/contract
    name: DCLRegistrar
    network: ropsten
    source:
      address: '0x460b01a32b18a1fb1416da2440e54b593c701238'
      abi: DCLRegistrar
      startBlock: 8131821
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/ens.ts
      entities:
        - DCLRegistrar
      abis:
        - name: DCLRegistrar
          file: ./abis/DCLRegistrar.json
      eventHandlers:
        - event: NameRegistered(indexed address,indexed address,indexed bytes32,string,uint256)
          handler: handleNameRegistered

  # ---------------------------------------------------------
  # BIDS ----------------------------------------------------
  # ---------------------------------------------------------
  - kind: ethereum/contract
    name: ERC721Bid
    network: ropsten
    source:
      address: '0xa5A59E812ec2eEB65f73f997e71EE6126f907Ed3'
      abi: ERC721Bid
      startBlock: 8131821
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/bid.ts
      entities:
        - Bid
      abis:
        - name: ERC721Bid
          file: ./abis/ERC721Bid.json
      eventHandlers:
        - event: BidCreated(bytes32,indexed address,indexed uint256,indexed address,uint256,uint256,bytes)
          handler: handleBidCreated
        - event: BidAccepted(bytes32,indexed address,indexed uint256,address,indexed address,uint256,uint256)
          handler: handleBidAccepted
        - event: BidCancelled(bytes32,indexed address,indexed uint256,indexed address)
          handler: handleBidCancelled


# ---------------------------------------------------------
# TEMPLATES -----------------------------------------------
# ---------------------------------------------------------
templates:
  - name: ERC721
    kind: ethereum/contract
    network: ropsten
    source:
      abi: ERC721
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.3
      language: wasm/assemblyscript
      file: ./src/handlers/nft.ts
      entities:
        - NFT
        - Parcel
        - Estate
        - Wearable
        - ENS
      abis:
        - name: ERC721
          file: ./abis/ERC721.json
        - name: LANDRegistry
          file: ./abis/LANDRegistry.json
      eventHandlers:
        - event: Transfer(indexed address,indexed address,indexed uint256,address,bytes,bytes)
          handler: handleTransfer
        - event: Transfer(indexed address,indexed address,indexed uint256,address,bytes)
          handler: handleTransfer
        - event: Transfer(indexed address,indexed address,indexed uint256)
          handler: handleTransfer
        - event: Transfer(indexed address,indexed address,uint256)
          handler: handleTransfer

@Specbee-onchain
Copy link

I also updated ropsten subgraph url to mine in /webapp/node_modules/decentraland-dapps/dist/lib/chainConfiguration.js
Screenshot 2021-04-30 at 18 33 31

so that my new MANA token balance can be displayed in the header, etc
Screenshot 2021-04-30 at 18 34 17

@nachomazzara
Copy link
Collaborator

What is the info you have at indexer/data/addresses.ts?

@Specbee-onchain
Copy link


export const Null = '0x0000000000000000000000000000000000000000'

// This will be correctly set if you deploy using `npm run deploy` or using the deploy.ts script directly
export const LANDRegistry = '0xead5be7a17881adc74419565dbd67508979ad2f4'
export const EstateRegistry = '0xd8dbe60aeb7cd1f04df2fd89e35e418346508672'
export const Marketplace = '0xd075116d6eb21afabfc58fdc8a115c5bf044a0fe'

export const DCLRegistrar = '0x460b01a32b18a1fb1416da2440e54b593c701238'

export const AtariLaunch = '0x0000000000000000000000000000000000000000'
export const BinanceUsCollection = '0x0000000000000000000000000000000000000000'
export const ChinaFlying = '0x0000000000000000000000000000000000000000'
export const CommunityContestCollection =
  '0x0000000000000000000000000000000000000000'
export const CybermikeCyberSoldier = '0x0000000000000000000000000000000000000000'
export const CZMercenaryMTZ = '0x0000000000000000000000000000000000000000'
export const DappcraftMoonminerCollection =
  '0x0000000000000000000000000000000000000000'
export const DCGCollection = '0x0000000000000000000000000000000000000000'
export const DCLLaunchCollection = '0x0000000000000000000000000000000000000000'
export const DCMeta = '0x0000000000000000000000000000000000000000'
export const DCNiftyblocksmith = '0x0000000000000000000000000000000000000000'
export const DGFall2020 = '0x0000000000000000000000000000000000000000'
export const DGSummer2020Collection = '0x0000000000000000000000000000000000000000'
export const DgtbleHeadspaceCollection = '0x0000000000000000000000000000000000000000'
export const DigitalAlchemy = '0x0000000000000000000000000000000000000000'
export const EtheremonWearables = '0x0000000000000000000000000000000000000000'
export const ExclusiveMasksCollection = '0x0000000000000000000000000000000000000000'
export const Halloween2019Collection = '0x0000000000000000000000000000000000000000'
export const Halloween2020Collection = '0x0000000000000000000000000000000000000000'
export const MCHCollection = '0x0000000000000000000000000000000000000000'
export const MemeDontBuyThis = '0x0000000000000000000000000000000000000000'
export const MFSammichgamer = '0x0000000000000000000000000000000000000000'
export const MLLiondance = '0x0000000000000000000000000000000000000000'
export const MLPekingopera = '0x0000000000000000000000000000000000000000'
export const Moonshot2020Collection = '0x0000000000000000000000000000000000000000'
export const PMDreamverseEminence = '0x0000000000000000000000000000000000000000'
export const PMOuttathisworldCollection =
  '0x0000000000000000000000000000000000000000'
export const RACBasics = '0x0000000000000000000000000000000000000000'
export const ReleaseTheKraken = '0x0000000000000000000000000000000000000000'
export const RTFKTXAtari = '0x0000000000000000000000000000000000000000'
export const StaySafeCollection = '0x0000000000000000000000000000000000000000'
export const SugarclubYumi = '0x0000000000000000000000000000000000000000'
export const TechTribalMarc0matic = '0x0000000000000000000000000000000000000000'
export const ThreeLAUBasics = '0x0000000000000000000000000000000000000000'
export const WinklevossCapital =
  '0x0000000000000000000000000000000000000000'
export const WonderzoneMeteorchaserCollection =
  '0x0000000000000000000000000000000000000000'
export const WonderzoneSteampunk = '0x0000000000000000000000000000000000000000'
export const WZWonderbot = '0x0000000000000000000000000000000000000000'
export const Xmas2019Collection = '0x0000000000000000000000000000000000000000'
export const Xmas2020Collection = '0x0000000000000000000000000000000000000000'
export const XmashUp2020 = '0x0000000000000000000000000000000000000000'


@nachomazzara
Copy link
Collaborator

You must call initialize first to execute this handler and the creation of all the nfts https://github.com/BEAR-finance/marketplace/blob/master/indexer/src/handlers/parcel.ts#L58

I already did it: https://ropsten.etherscan.io/tx/0xbd1b025d85d893f7c7e57a702799421d3a1d79f23b54984f30a0092ddc7e500d

You need to assign lands now. I guess that the previous one are not going to be computed

@Specbee-onchain
Copy link

oh, so you just called initialize with 0x? And only then assignment happens. Assigning it now

@Specbee-onchain
Copy link

Assigned, now that works. It is strange how could I miss that
Screenshot 2021-05-01 at 07 58 35

@Specbee-onchain
Copy link

Specbee-onchain commented May 1, 2021

You must call initialize first to execute this handler and the creation of all the nfts https://github.com/BEAR-finance/marketplace/blob/master/indexer/src/handlers/parcel.ts#L58

I already did it: https://ropsten.etherscan.io/tx/0xbd1b025d85d893f7c7e57a702799421d3a1d79f23b54984f30a0092ddc7e500d

You need to assign lands now. I guess that the previous one are not going to be computed

And what if I replace initialize callHandler in subgraph.yml perhaps with something that will trigger the handleInitialize on contract creation?

@Specbee-onchain
Copy link

I will replace that call handler with event handler

@nachomazzara
Copy link
Collaborator

Great it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants