cerc-io / watcher-ts

GNU Affero General Public License v3.0
12 stars 3 forks source link

Create watcher for Azimuth contracts #351

Open nikugogoi opened 1 year ago

nikugogoi commented 1 year ago
nikugogoi commented 1 year ago

Issues with creating watcher in eth_call mode:

nikugogoi commented 1 year ago

Issue with generating watchers in storage mode:

dafaqdhruv commented 1 year ago

Tried using solc v0.5.13 to generate watcher

nikugogoi commented 1 year ago

In deploy script Azimuth contract is getting deployed first Azimuth contract is deployed at block 6784880 The first tx in Azimuth contract is at block 6784943

nikugogoi commented 1 year ago

GQL Queries (eth_call) for Azimuth watcher

nikugogoi commented 1 year ago

GQL Queries (eth_call) for Censures watcher

Query:

query {
  getCensuredByCount(
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    contractAddress: "0x325f68d32BdEe6Ed86E7235ff2480e2A433D6189"
    _who: 6054
  ) {
    value
  }
  getCensuringCount(
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    contractAddress: "0x325f68d32BdEe6Ed86E7235ff2480e2A433D6189"
    _whose: 7584
  ) {
    value
  }
}

Response:

{
  "data": {
    "getCensuredByCount": {
      "value": "0"
    },
    "getCensuringCount": {
      "value": "1"
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for Claims watcher

Query:

query {
  findClaim (blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9", contractAddress: "0xe7e7f69b34D7d9Bd8d61Fb22C33b22708947971A", _whose: 1967913144, _protocol: "text", _claim: "Shrek is NOT Drek!")   { 
    value
    proof {
      data
    }
  }
}

Response:

{
  "data": {
    "findClaim": {
      "value": 1,
      "proof": null
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for LinearStarRelease watcher

Query:

query {
  verifyBalance(
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    contractAddress: "0x86cd9cd0992F04231751E3761De45cEceA5d1801"
    _participant: "0xbD396c580d868FBbE4a115DD667E756079880801"
  ) {
    value
  }
  withdrawLimit(
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    contractAddress: "0x86cd9cd0992F04231751E3761De45cEceA5d1801"
    _participant: "0xbD396c580d868FBbE4a115DD667E756079880801"
  ) {
    value
  }
}

Response:

{
  "data": {
    "verifyBalance": {
      "value": true
    },
    "withdrawLimit": {
      "value": 10
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for ConditionalStarRelease watcher

Query:

query {
  withdrawLimit(
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
    _participant: "0x7F0584938E649061e80e45cF88E6d8dDDb22f2aB"
    _batch: 2
  ) {
    value
  }

  verifyBalance(
    contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    _participant: "0x7F0584938E649061e80e45cF88E6d8dDDb22f2aB"
  ) {
    value
  }

  getBatch(
    contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    _participant: "0x8DAc7ae78E64D167FcCE71e7904943c2e71523ed"
    _batch: 2
  ) {
    value
  }

  getWithdrawnFromBatch(
    contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    _participant: "0x8DAc7ae78E64D167FcCE71e7904943c2e71523ed"
    _batch: 2
  ) {
    value
  }

  hasForfeitedBatch(
    contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
    blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
    _participant: "0x8DAc7ae78E64D167FcCE71e7904943c2e71523ed"
    _batch: 2
  ) {
    value
  }
}

Response:

{
  "data": {
    "withdrawLimit": {
      "value": 0
    },
    "verifyBalance": {
      "value": true
    },
    "getBatch": {
      "value": 21
    },
    "getWithdrawnFromBatch": {
      "value": 21
    },
    "hasForfeitedBatch": {
      "value": false
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for Polls watcher

Query:

query {
  getUpgradeProposals(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
  ) {
    value
    proof {
      data
    }
  }
  getUpgradeProposalCount(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
  ) {
    value
    proof {
      data
    }
  }
  getDocumentProposals(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
  ) {
    value
    proof {
      data
    }
  }
  getDocumentProposalCount(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
  ) {
    value
    proof {
      data
    }
  }
  getDocumentMajorities(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
  ) {
    value
    proof {
      data
    }
  }
  hasVotedOnDocumentPoll (
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271",     
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
    _galaxy: 1
    _proposal: "0x00000000000000000000000000000000000000000000000000000000000000e0"
  ){
    value
  }
  hasVotedOnUpgradePoll(
    blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271",     
    contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
    _galaxy: 1
    _proposal: "0x460e497744f41e80bcb0d143ee3aca56f25f5e52"
  ){
    value
  }
}

Response:

{
  "data": {
    "getUpgradeProposals": {
      "value": ["0x9ef27de616154FF8B38893C59522b69c7Ba8A81c", "0xa5b6109AD2D35191b3BC32C00e4526bE56Fe321F", "0x33EeCbf908478C10614626A9D304bfe18B78DD73"],
      "proof": null
    },
    "getUpgradeProposalCount": {
      "value": "3",
      "proof": null
    },
    "getDocumentProposals": {
      "value": ["0x1234567890000000000000000000000000000000000000000000002019010900", "0xcb1f81e42b5e75f000f94fc71a3ea70cab4bfc6f236b91e717f1b9516e5596b5", "0x0000000000000000000000000000000000000000000000000000000000000060", "0x00000000000000000000000000000000000000000000000000000000000000a0", "0x00000000000000000000000000000000000000000000000000000000000000e0", "0x7e825a1e9ee9d3b11e07b43aaa6d086e43f22c97b4b95a76299e3ead4cabb2a2"],
      "proof": null
    },
    "getDocumentProposalCount": {
      "value": "6",
      "proof": null
    },
    "getDocumentMajorities": {
      "value": ["0xcb1f81e42b5e75f000f94fc71a3ea70cab4bfc6f236b91e717f1b9516e5596b5", "0x0000000000000000000000000000000000000000000000000000000000000060", "0x00000000000000000000000000000000000000000000000000000000000000a0", "0x00000000000000000000000000000000000000000000000000000000000000e0", "0x7e825a1e9ee9d3b11e07b43aaa6d086e43f22c97b4b95a76299e3ead4cabb2a2"],
      "proof": null
    },
    "hasVotedOnDocumentPoll": {
      "value": false
    },
    "hasVotedOnUpgradePoll": {
      "value": false
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for Ecliptic watcher

Query:

query {
  balanceOf(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _owner: "0x4b5E239C1bbb98d44ea23BC9f8eC7584F54096E8"
  ) {
    value
  }
  ownerOf(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _tokenId: 1
  ) {
    value
  }
  exists(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _tokenId: 1
  ) {
    value
  }
  getApproved(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _tokenId: 1
  ) {
    value
  }
  isApprovedForAll(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _owner: "0x4b5E239C1bbb98d44ea23BC9f8eC7584F54096E8"
    _operator: "0x4b5E239C1bbb98d44ea23BC9f8eC7584F54096E8"
  ) {
    value
  }
  name(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
  ) {
    value
  }
  symbol(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
  ) {
    value
  }
  tokenURI(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _tokenId: 1
  ) {
    value
  }
  getSpawnLimit(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _point: 1
    _time: 1
  ) {
    value
  }
  canEscapeTo(
    blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
    contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
    _point: 1
    _sponsor: 1
  ) {
    value
  }
}

Response:

{
  "data": {
    "balanceOf": {
      "value": "1"
    },
    "ownerOf": {
      "value": "0x4b5E239C1bbb98d44ea23BC9f8eC7584F54096E8"
    },
    "exists": {
      "value": true
    },
    "getApproved": {
      "value": "0x0000000000000000000000000000000000000000"
    },
    "isApprovedForAll": {
      "value": false
    },
    "name": {
      "value": "Azimuth Points"
    },
    "symbol": {
      "value": "AZP"
    },
    "tokenURI": {
      "value": "https://azimuth.network/erc721/0000000001.json"
    },
    "getSpawnLimit": {
      "value": 255
    },
    "canEscapeTo": {
      "value": false
    }
  }
}
nikugogoi commented 1 year ago

GQL Queries (eth_call) for DelegatedSending watcher

nikugogoi commented 1 year ago

GQL Queries of array return types (eth_call) for Azimuth watcher which were previously unhandled

nikugogoi commented 1 year ago

GQL Queries of array return types (eth_call) for Censures watcher which were previously unhandled

nikugogoi commented 1 year ago

GQL Queries of array return types (eth_call) for ConditionalStarRelease watcher which were previously unhandled

nikugogoi commented 1 year ago

GQL Queries of array return types (eth_call) for LinearStarRelease watcher which were previously unhandled

nikugogoi commented 1 year ago

GQL Query of multiple return type (eth_call) for Azimuth watcher which was previously unhandled

nikugogoi commented 1 year ago

GQL Query of multiple return type (eth_call) for ConditionalStarRelease watcher which was previously unhandled