├── .gitignore ├── README.md ├── abis └── LensHub.json ├── networks.json ├── package.json ├── prettier.config.js ├── schema.graphql ├── src ├── constanst.ts ├── mappings │ └── index.ts └── modules │ ├── accounts.ts │ ├── creators.ts │ ├── follows.ts │ ├── index.ts │ ├── lens.ts │ ├── profiles.ts │ ├── publications.ts │ └── transfersNFT.ts ├── subgraph.yaml ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | generated 107 | build 108 | contract.sol 109 | *.contract.sol 110 | .DS_Store 111 | .vscode -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Subgraph for Lens Protocols 2 | 3 | -In process- 4 | 5 | **How to deploy** 6 | 7 | 1. Clone the repository 8 | 2. Add a Subgraph in https://thegraph.com/hosted-service/ 9 | 3. `yarn install` into the subgraph directory 10 | 4. `graph auth --product hosted-service ` 11 | 5. `yarn deploy` 12 | 13 | **Link to the hosted service subgraph :** 14 | https://thegraph.com/hosted-service/subgraph/rtomas/lens-subgraph 15 | (there are some saved queries to play with the subgraph) 16 | 17 | --- 18 | 19 | **Contract from the collection :** 20 | https://polygonscan.com/address/0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d 21 | 22 | **Official Website :** 23 | https://lens.xyz/ 24 | 25 | **Developer Docs** 26 | https://docs.lens.xyz/docs 27 | 28 | ```mermaid 29 | classDiagram 30 | class Stat { 31 | ID! id 32 | BigInt! totalProfiles 33 | BigInt! totalAccounts 34 | BigInt! totalPosts 35 | BigInt! totalComments 36 | BigInt! totalMirror 37 | BigInt! totalPublications 38 | BigInt lastCommentCreatedAt 39 | BigInt lastPostCreatedAt 40 | BigInt lastMirrorCreatedAt 41 | BigInt lastProfileCreated 42 | } 43 | class Profile { 44 | ID! id 45 | BigInt! profileId 46 | Creator! creator 47 | Account! owner 48 | Bytes followNFT 49 | String followNFTURI 50 | String handle 51 | String imageURI 52 | BigInt createdAt 53 | Bytes followModule 54 | Bytes followModuleReturnData 55 | Bytes dispatcher 56 | BigInt! lastUpdated 57 | BigInt! totalMirrors 58 | BigInt! totalPosts 59 | BigInt! totalComments 60 | BigInt! totalFollowers 61 | BigInt! totalFollowings 62 | [Account!]! followers 63 | [Profile!]! followings 64 | [Comment!] comments 65 | [Post!] posts 66 | [Mirror!] mirrors 67 | } 68 | class Account { 69 | ID! id 70 | Bytes! address 71 | Profile defaultProfile 72 | [String!]! profilesIds 73 | [Profile!] profiles 74 | [Profile!]! following 75 | BigInt! totalFollowings 76 | } 77 | class Creator { 78 | ID! id 79 | Bytes! address 80 | Boolean! isWhitelisted 81 | BigInt! lastUpdated 82 | } 83 | class Publication { 84 | <> 85 | ID! id 86 | Profile! fromProfile 87 | BigInt! pubId 88 | Bytes! referenceModule 89 | Bytes referenceModuleReturnData 90 | BigInt! timestamp 91 | } 92 | class Post { 93 | ID! id 94 | Profile! fromProfile 95 | BigInt! pubId 96 | Bytes! referenceModule 97 | Bytes referenceModuleReturnData 98 | String! contentURI 99 | Bytes! collectModule 100 | Bytes collectModuleReturnData 101 | BigInt! timestamp 102 | } 103 | class Mirror { 104 | ID! id 105 | Profile! fromProfile 106 | BigInt! pubId 107 | Bytes! referenceModule 108 | Bytes referenceModuleReturnData 109 | BigInt! profileIdPointed 110 | BigInt! pubIdPointed 111 | BigInt! timestamp 112 | } 113 | class Comment { 114 | ID! id 115 | Profile! fromProfile 116 | BigInt! pubId 117 | Bytes! referenceModule 118 | Bytes referenceModuleReturnData 119 | String! contentURI 120 | BigInt! profileIdPointed 121 | BigInt! pubIdPointed 122 | Bytes collectModule 123 | Bytes collectModuleReturnData 124 | BigInt! timestamp 125 | } 126 | class Follow { 127 | ID! id 128 | Account fromAccount 129 | String fromProfileSTR 130 | [Profile!] toProfile 131 | BigInt! timestamp 132 | } 133 | class FollowNFTTransferred { 134 | ID! id 135 | BigInt profileId 136 | BigInt followNFTID 137 | Bytes from 138 | Bytes to 139 | BigInt timestamp 140 | String data 141 | } 142 | Profile --o Creator : creator 143 | Profile --o Account : owner 144 | Profile --o Account : followers 145 | Profile --o Profile : followings 146 | Profile --o Comment : comments 147 | Profile --o Post : posts 148 | Profile --o Mirror : mirrors 149 | Account --o Profile : defaultProfile 150 | Account --o Profile : profiles 151 | Account --o Profile : following 152 | Publication --o Profile : fromProfile 153 | Post --o Profile : fromProfile 154 | Publication <|-- Post 155 | Mirror --o Profile : fromProfile 156 | Publication <|-- Mirror 157 | Comment --o Profile : fromProfile 158 | Publication <|-- Comment 159 | Follow --o Account : fromAccount 160 | Follow --o Profile : toProfile 161 | 162 | 163 | ``` 164 | 165 | mermaid class diagram autogenerated with https://github.com/rtomas/mmd-GraphSchema 166 | 167 | Keep working in the following: 168 | 169 | - Investigate Modules 170 | - Change entities to be identical to https://docs.lens.xyz/docs/primer so that consumer don't have to rewrite the graphql queries. 171 | -------------------------------------------------------------------------------- /abis/LensHub.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "followNFTImpl", "type": "address" }, 5 | { "internalType": "address", "name": "collectNFTImpl", "type": "address" } 6 | ], 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { "inputs": [], "name": "CallerNotCollectNFT", "type": "error" }, 11 | { "inputs": [], "name": "CallerNotFollowNFT", "type": "error" }, 12 | { "inputs": [], "name": "CannotInitImplementation", "type": "error" }, 13 | { "inputs": [], "name": "Initialized", "type": "error" }, 14 | { "inputs": [], "name": "NotGovernance", "type": "error" }, 15 | { "inputs": [], "name": "NotGovernanceOrEmergencyAdmin", "type": "error" }, 16 | { "inputs": [], "name": "NotOwnerOrApproved", "type": "error" }, 17 | { "inputs": [], "name": "NotProfileOwner", "type": "error" }, 18 | { "inputs": [], "name": "NotProfileOwnerOrDispatcher", "type": "error" }, 19 | { "inputs": [], "name": "Paused", "type": "error" }, 20 | { "inputs": [], "name": "ProfileCreatorNotWhitelisted", "type": "error" }, 21 | { "inputs": [], "name": "PublicationDoesNotExist", "type": "error" }, 22 | { "inputs": [], "name": "PublishingPaused", "type": "error" }, 23 | { "inputs": [], "name": "SignatureExpired", "type": "error" }, 24 | { "inputs": [], "name": "SignatureInvalid", "type": "error" }, 25 | { "inputs": [], "name": "ZeroSpender", "type": "error" }, 26 | { 27 | "anonymous": false, 28 | "inputs": [ 29 | { 30 | "indexed": true, 31 | "internalType": "address", 32 | "name": "owner", 33 | "type": "address" 34 | }, 35 | { 36 | "indexed": true, 37 | "internalType": "address", 38 | "name": "approved", 39 | "type": "address" 40 | }, 41 | { 42 | "indexed": true, 43 | "internalType": "uint256", 44 | "name": "tokenId", 45 | "type": "uint256" 46 | } 47 | ], 48 | "name": "Approval", 49 | "type": "event" 50 | }, 51 | { 52 | "anonymous": false, 53 | "inputs": [ 54 | { 55 | "indexed": true, 56 | "internalType": "address", 57 | "name": "owner", 58 | "type": "address" 59 | }, 60 | { 61 | "indexed": true, 62 | "internalType": "address", 63 | "name": "operator", 64 | "type": "address" 65 | }, 66 | { 67 | "indexed": false, 68 | "internalType": "bool", 69 | "name": "approved", 70 | "type": "bool" 71 | } 72 | ], 73 | "name": "ApprovalForAll", 74 | "type": "event" 75 | }, 76 | { 77 | "anonymous": false, 78 | "inputs": [ 79 | { 80 | "indexed": true, 81 | "internalType": "address", 82 | "name": "from", 83 | "type": "address" 84 | }, 85 | { 86 | "indexed": true, 87 | "internalType": "address", 88 | "name": "to", 89 | "type": "address" 90 | }, 91 | { 92 | "indexed": true, 93 | "internalType": "uint256", 94 | "name": "tokenId", 95 | "type": "uint256" 96 | } 97 | ], 98 | "name": "Transfer", 99 | "type": "event" 100 | }, 101 | { 102 | "inputs": [ 103 | { "internalType": "address", "name": "to", "type": "address" }, 104 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 105 | ], 106 | "name": "approve", 107 | "outputs": [], 108 | "stateMutability": "nonpayable", 109 | "type": "function" 110 | }, 111 | { 112 | "inputs": [ 113 | { "internalType": "address", "name": "owner", "type": "address" } 114 | ], 115 | "name": "balanceOf", 116 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 117 | "stateMutability": "view", 118 | "type": "function" 119 | }, 120 | { 121 | "inputs": [ 122 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 123 | ], 124 | "name": "burn", 125 | "outputs": [], 126 | "stateMutability": "nonpayable", 127 | "type": "function" 128 | }, 129 | { 130 | "inputs": [ 131 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, 132 | { 133 | "components": [ 134 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 135 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 136 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 137 | { "internalType": "uint256", "name": "deadline", "type": "uint256" } 138 | ], 139 | "internalType": "struct DataTypes.EIP712Signature", 140 | "name": "sig", 141 | "type": "tuple" 142 | } 143 | ], 144 | "name": "burnWithSig", 145 | "outputs": [], 146 | "stateMutability": "nonpayable", 147 | "type": "function" 148 | }, 149 | { 150 | "inputs": [ 151 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 152 | { "internalType": "uint256", "name": "pubId", "type": "uint256" }, 153 | { "internalType": "bytes", "name": "data", "type": "bytes" } 154 | ], 155 | "name": "collect", 156 | "outputs": [], 157 | "stateMutability": "nonpayable", 158 | "type": "function" 159 | }, 160 | { 161 | "inputs": [ 162 | { 163 | "components": [ 164 | { "internalType": "address", "name": "collector", "type": "address" }, 165 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 166 | { "internalType": "uint256", "name": "pubId", "type": "uint256" }, 167 | { "internalType": "bytes", "name": "data", "type": "bytes" }, 168 | { 169 | "components": [ 170 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 171 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 172 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 173 | { 174 | "internalType": "uint256", 175 | "name": "deadline", 176 | "type": "uint256" 177 | } 178 | ], 179 | "internalType": "struct DataTypes.EIP712Signature", 180 | "name": "sig", 181 | "type": "tuple" 182 | } 183 | ], 184 | "internalType": "struct DataTypes.CollectWithSigData", 185 | "name": "vars", 186 | "type": "tuple" 187 | } 188 | ], 189 | "name": "collectWithSig", 190 | "outputs": [], 191 | "stateMutability": "nonpayable", 192 | "type": "function" 193 | }, 194 | { 195 | "inputs": [ 196 | { 197 | "components": [ 198 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 199 | { "internalType": "string", "name": "contentURI", "type": "string" }, 200 | { 201 | "internalType": "uint256", 202 | "name": "profileIdPointed", 203 | "type": "uint256" 204 | }, 205 | { 206 | "internalType": "uint256", 207 | "name": "pubIdPointed", 208 | "type": "uint256" 209 | }, 210 | { 211 | "internalType": "address", 212 | "name": "collectModule", 213 | "type": "address" 214 | }, 215 | { 216 | "internalType": "bytes", 217 | "name": "collectModuleData", 218 | "type": "bytes" 219 | }, 220 | { 221 | "internalType": "address", 222 | "name": "referenceModule", 223 | "type": "address" 224 | }, 225 | { 226 | "internalType": "bytes", 227 | "name": "referenceModuleData", 228 | "type": "bytes" 229 | } 230 | ], 231 | "internalType": "struct DataTypes.CommentData", 232 | "name": "vars", 233 | "type": "tuple" 234 | } 235 | ], 236 | "name": "comment", 237 | "outputs": [], 238 | "stateMutability": "nonpayable", 239 | "type": "function" 240 | }, 241 | { 242 | "inputs": [ 243 | { 244 | "components": [ 245 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 246 | { "internalType": "string", "name": "contentURI", "type": "string" }, 247 | { 248 | "internalType": "uint256", 249 | "name": "profileIdPointed", 250 | "type": "uint256" 251 | }, 252 | { 253 | "internalType": "uint256", 254 | "name": "pubIdPointed", 255 | "type": "uint256" 256 | }, 257 | { 258 | "internalType": "address", 259 | "name": "collectModule", 260 | "type": "address" 261 | }, 262 | { 263 | "internalType": "bytes", 264 | "name": "collectModuleData", 265 | "type": "bytes" 266 | }, 267 | { 268 | "internalType": "address", 269 | "name": "referenceModule", 270 | "type": "address" 271 | }, 272 | { 273 | "internalType": "bytes", 274 | "name": "referenceModuleData", 275 | "type": "bytes" 276 | }, 277 | { 278 | "components": [ 279 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 280 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 281 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 282 | { 283 | "internalType": "uint256", 284 | "name": "deadline", 285 | "type": "uint256" 286 | } 287 | ], 288 | "internalType": "struct DataTypes.EIP712Signature", 289 | "name": "sig", 290 | "type": "tuple" 291 | } 292 | ], 293 | "internalType": "struct DataTypes.CommentWithSigData", 294 | "name": "vars", 295 | "type": "tuple" 296 | } 297 | ], 298 | "name": "commentWithSig", 299 | "outputs": [], 300 | "stateMutability": "nonpayable", 301 | "type": "function" 302 | }, 303 | { 304 | "inputs": [ 305 | { 306 | "components": [ 307 | { "internalType": "address", "name": "to", "type": "address" }, 308 | { "internalType": "string", "name": "handle", "type": "string" }, 309 | { "internalType": "string", "name": "imageURI", "type": "string" }, 310 | { 311 | "internalType": "address", 312 | "name": "followModule", 313 | "type": "address" 314 | }, 315 | { 316 | "internalType": "bytes", 317 | "name": "followModuleData", 318 | "type": "bytes" 319 | }, 320 | { "internalType": "string", "name": "followNFTURI", "type": "string" } 321 | ], 322 | "internalType": "struct DataTypes.CreateProfileData", 323 | "name": "vars", 324 | "type": "tuple" 325 | } 326 | ], 327 | "name": "createProfile", 328 | "outputs": [], 329 | "stateMutability": "nonpayable", 330 | "type": "function" 331 | }, 332 | { 333 | "inputs": [ 334 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 335 | { "internalType": "uint256", "name": "pubId", "type": "uint256" }, 336 | { "internalType": "uint256", "name": "collectNFTId", "type": "uint256" }, 337 | { "internalType": "address", "name": "from", "type": "address" }, 338 | { "internalType": "address", "name": "to", "type": "address" } 339 | ], 340 | "name": "emitCollectNFTTransferEvent", 341 | "outputs": [], 342 | "stateMutability": "nonpayable", 343 | "type": "function" 344 | }, 345 | { 346 | "inputs": [ 347 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 348 | { "internalType": "uint256", "name": "followNFTId", "type": "uint256" }, 349 | { "internalType": "address", "name": "from", "type": "address" }, 350 | { "internalType": "address", "name": "to", "type": "address" } 351 | ], 352 | "name": "emitFollowNFTTransferEvent", 353 | "outputs": [], 354 | "stateMutability": "nonpayable", 355 | "type": "function" 356 | }, 357 | { 358 | "inputs": [ 359 | { 360 | "internalType": "uint256[]", 361 | "name": "profileIds", 362 | "type": "uint256[]" 363 | }, 364 | { "internalType": "bytes[]", "name": "datas", "type": "bytes[]" } 365 | ], 366 | "name": "follow", 367 | "outputs": [], 368 | "stateMutability": "nonpayable", 369 | "type": "function" 370 | }, 371 | { 372 | "inputs": [ 373 | { 374 | "components": [ 375 | { "internalType": "address", "name": "follower", "type": "address" }, 376 | { 377 | "internalType": "uint256[]", 378 | "name": "profileIds", 379 | "type": "uint256[]" 380 | }, 381 | { "internalType": "bytes[]", "name": "datas", "type": "bytes[]" }, 382 | { 383 | "components": [ 384 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 385 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 386 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 387 | { 388 | "internalType": "uint256", 389 | "name": "deadline", 390 | "type": "uint256" 391 | } 392 | ], 393 | "internalType": "struct DataTypes.EIP712Signature", 394 | "name": "sig", 395 | "type": "tuple" 396 | } 397 | ], 398 | "internalType": "struct DataTypes.FollowWithSigData", 399 | "name": "vars", 400 | "type": "tuple" 401 | } 402 | ], 403 | "name": "followWithSig", 404 | "outputs": [], 405 | "stateMutability": "nonpayable", 406 | "type": "function" 407 | }, 408 | { 409 | "inputs": [ 410 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 411 | ], 412 | "name": "getApproved", 413 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 414 | "stateMutability": "view", 415 | "type": "function" 416 | }, 417 | { 418 | "inputs": [ 419 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 420 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 421 | ], 422 | "name": "getCollectModule", 423 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 424 | "stateMutability": "view", 425 | "type": "function" 426 | }, 427 | { 428 | "inputs": [ 429 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 430 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 431 | ], 432 | "name": "getCollectNFT", 433 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 434 | "stateMutability": "view", 435 | "type": "function" 436 | }, 437 | { 438 | "inputs": [ 439 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 440 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 441 | ], 442 | "name": "getContentURI", 443 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 444 | "stateMutability": "view", 445 | "type": "function" 446 | }, 447 | { 448 | "inputs": [ 449 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 450 | ], 451 | "name": "getDispatcher", 452 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 453 | "stateMutability": "view", 454 | "type": "function" 455 | }, 456 | { 457 | "inputs": [], 458 | "name": "getDomainSeparator", 459 | "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 460 | "stateMutability": "view", 461 | "type": "function" 462 | }, 463 | { 464 | "inputs": [ 465 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 466 | ], 467 | "name": "getFollowModule", 468 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 469 | "stateMutability": "view", 470 | "type": "function" 471 | }, 472 | { 473 | "inputs": [ 474 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 475 | ], 476 | "name": "getFollowNFT", 477 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 478 | "stateMutability": "view", 479 | "type": "function" 480 | }, 481 | { 482 | "inputs": [ 483 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 484 | ], 485 | "name": "getFollowNFTURI", 486 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 487 | "stateMutability": "view", 488 | "type": "function" 489 | }, 490 | { 491 | "inputs": [], 492 | "name": "getGovernance", 493 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 494 | "stateMutability": "view", 495 | "type": "function" 496 | }, 497 | { 498 | "inputs": [ 499 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 500 | ], 501 | "name": "getHandle", 502 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 503 | "stateMutability": "view", 504 | "type": "function" 505 | }, 506 | { 507 | "inputs": [ 508 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 509 | ], 510 | "name": "getProfile", 511 | "outputs": [ 512 | { 513 | "components": [ 514 | { "internalType": "uint256", "name": "pubCount", "type": "uint256" }, 515 | { 516 | "internalType": "address", 517 | "name": "followModule", 518 | "type": "address" 519 | }, 520 | { "internalType": "address", "name": "followNFT", "type": "address" }, 521 | { "internalType": "string", "name": "handle", "type": "string" }, 522 | { "internalType": "string", "name": "imageURI", "type": "string" }, 523 | { "internalType": "string", "name": "followNFTURI", "type": "string" } 524 | ], 525 | "internalType": "struct DataTypes.ProfileStruct", 526 | "name": "", 527 | "type": "tuple" 528 | } 529 | ], 530 | "stateMutability": "view", 531 | "type": "function" 532 | }, 533 | { 534 | "inputs": [ 535 | { "internalType": "string", "name": "handle", "type": "string" } 536 | ], 537 | "name": "getProfileIdByHandle", 538 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 539 | "stateMutability": "view", 540 | "type": "function" 541 | }, 542 | { 543 | "inputs": [ 544 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 545 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 546 | ], 547 | "name": "getPub", 548 | "outputs": [ 549 | { 550 | "components": [ 551 | { 552 | "internalType": "uint256", 553 | "name": "profileIdPointed", 554 | "type": "uint256" 555 | }, 556 | { 557 | "internalType": "uint256", 558 | "name": "pubIdPointed", 559 | "type": "uint256" 560 | }, 561 | { "internalType": "string", "name": "contentURI", "type": "string" }, 562 | { 563 | "internalType": "address", 564 | "name": "referenceModule", 565 | "type": "address" 566 | }, 567 | { 568 | "internalType": "address", 569 | "name": "collectModule", 570 | "type": "address" 571 | }, 572 | { "internalType": "address", "name": "collectNFT", "type": "address" } 573 | ], 574 | "internalType": "struct DataTypes.PublicationStruct", 575 | "name": "", 576 | "type": "tuple" 577 | } 578 | ], 579 | "stateMutability": "view", 580 | "type": "function" 581 | }, 582 | { 583 | "inputs": [ 584 | { "internalType": "uint256", "name": "profileId", "type": "uint256" } 585 | ], 586 | "name": "getPubCount", 587 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 588 | "stateMutability": "view", 589 | "type": "function" 590 | }, 591 | { 592 | "inputs": [ 593 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 594 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 595 | ], 596 | "name": "getPubPointer", 597 | "outputs": [ 598 | { "internalType": "uint256", "name": "", "type": "uint256" }, 599 | { "internalType": "uint256", "name": "", "type": "uint256" } 600 | ], 601 | "stateMutability": "view", 602 | "type": "function" 603 | }, 604 | { 605 | "inputs": [ 606 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 607 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 608 | ], 609 | "name": "getPubType", 610 | "outputs": [ 611 | { "internalType": "enum DataTypes.PubType", "name": "", "type": "uint8" } 612 | ], 613 | "stateMutability": "view", 614 | "type": "function" 615 | }, 616 | { 617 | "inputs": [ 618 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 619 | { "internalType": "uint256", "name": "pubId", "type": "uint256" } 620 | ], 621 | "name": "getReferenceModule", 622 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 623 | "stateMutability": "view", 624 | "type": "function" 625 | }, 626 | { 627 | "inputs": [], 628 | "name": "getState", 629 | "outputs": [ 630 | { 631 | "internalType": "enum DataTypes.ProtocolState", 632 | "name": "", 633 | "type": "uint8" 634 | } 635 | ], 636 | "stateMutability": "view", 637 | "type": "function" 638 | }, 639 | { 640 | "inputs": [ 641 | { "internalType": "string", "name": "name", "type": "string" }, 642 | { "internalType": "string", "name": "symbol", "type": "string" }, 643 | { "internalType": "address", "name": "newGovernance", "type": "address" } 644 | ], 645 | "name": "initialize", 646 | "outputs": [], 647 | "stateMutability": "nonpayable", 648 | "type": "function" 649 | }, 650 | { 651 | "inputs": [ 652 | { "internalType": "address", "name": "owner", "type": "address" }, 653 | { "internalType": "address", "name": "operator", "type": "address" } 654 | ], 655 | "name": "isApprovedForAll", 656 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 657 | "stateMutability": "view", 658 | "type": "function" 659 | }, 660 | { 661 | "inputs": [ 662 | { "internalType": "address", "name": "collectModule", "type": "address" } 663 | ], 664 | "name": "isCollectModuleWhitelisted", 665 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 666 | "stateMutability": "view", 667 | "type": "function" 668 | }, 669 | { 670 | "inputs": [ 671 | { "internalType": "address", "name": "followModule", "type": "address" } 672 | ], 673 | "name": "isFollowModuleWhitelisted", 674 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 675 | "stateMutability": "view", 676 | "type": "function" 677 | }, 678 | { 679 | "inputs": [ 680 | { "internalType": "address", "name": "profileCreator", "type": "address" } 681 | ], 682 | "name": "isProfileCreatorWhitelisted", 683 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 684 | "stateMutability": "view", 685 | "type": "function" 686 | }, 687 | { 688 | "inputs": [ 689 | { 690 | "internalType": "address", 691 | "name": "referenceModule", 692 | "type": "address" 693 | } 694 | ], 695 | "name": "isReferenceModuleWhitelisted", 696 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 697 | "stateMutability": "view", 698 | "type": "function" 699 | }, 700 | { 701 | "inputs": [ 702 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 703 | ], 704 | "name": "mintTimestampOf", 705 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 706 | "stateMutability": "view", 707 | "type": "function" 708 | }, 709 | { 710 | "inputs": [ 711 | { 712 | "components": [ 713 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 714 | { 715 | "internalType": "uint256", 716 | "name": "profileIdPointed", 717 | "type": "uint256" 718 | }, 719 | { 720 | "internalType": "uint256", 721 | "name": "pubIdPointed", 722 | "type": "uint256" 723 | }, 724 | { 725 | "internalType": "address", 726 | "name": "referenceModule", 727 | "type": "address" 728 | }, 729 | { 730 | "internalType": "bytes", 731 | "name": "referenceModuleData", 732 | "type": "bytes" 733 | } 734 | ], 735 | "internalType": "struct DataTypes.MirrorData", 736 | "name": "vars", 737 | "type": "tuple" 738 | } 739 | ], 740 | "name": "mirror", 741 | "outputs": [], 742 | "stateMutability": "nonpayable", 743 | "type": "function" 744 | }, 745 | { 746 | "inputs": [ 747 | { 748 | "components": [ 749 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 750 | { 751 | "internalType": "uint256", 752 | "name": "profileIdPointed", 753 | "type": "uint256" 754 | }, 755 | { 756 | "internalType": "uint256", 757 | "name": "pubIdPointed", 758 | "type": "uint256" 759 | }, 760 | { 761 | "internalType": "address", 762 | "name": "referenceModule", 763 | "type": "address" 764 | }, 765 | { 766 | "internalType": "bytes", 767 | "name": "referenceModuleData", 768 | "type": "bytes" 769 | }, 770 | { 771 | "components": [ 772 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 773 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 774 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 775 | { 776 | "internalType": "uint256", 777 | "name": "deadline", 778 | "type": "uint256" 779 | } 780 | ], 781 | "internalType": "struct DataTypes.EIP712Signature", 782 | "name": "sig", 783 | "type": "tuple" 784 | } 785 | ], 786 | "internalType": "struct DataTypes.MirrorWithSigData", 787 | "name": "vars", 788 | "type": "tuple" 789 | } 790 | ], 791 | "name": "mirrorWithSig", 792 | "outputs": [], 793 | "stateMutability": "nonpayable", 794 | "type": "function" 795 | }, 796 | { 797 | "inputs": [], 798 | "name": "name", 799 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 800 | "stateMutability": "view", 801 | "type": "function" 802 | }, 803 | { 804 | "inputs": [ 805 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 806 | ], 807 | "name": "ownerOf", 808 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 809 | "stateMutability": "view", 810 | "type": "function" 811 | }, 812 | { 813 | "inputs": [ 814 | { "internalType": "address", "name": "spender", "type": "address" }, 815 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, 816 | { 817 | "components": [ 818 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 819 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 820 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 821 | { "internalType": "uint256", "name": "deadline", "type": "uint256" } 822 | ], 823 | "internalType": "struct DataTypes.EIP712Signature", 824 | "name": "sig", 825 | "type": "tuple" 826 | } 827 | ], 828 | "name": "permit", 829 | "outputs": [], 830 | "stateMutability": "nonpayable", 831 | "type": "function" 832 | }, 833 | { 834 | "inputs": [ 835 | { "internalType": "address", "name": "owner", "type": "address" }, 836 | { "internalType": "address", "name": "operator", "type": "address" }, 837 | { "internalType": "bool", "name": "approved", "type": "bool" }, 838 | { 839 | "components": [ 840 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 841 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 842 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 843 | { "internalType": "uint256", "name": "deadline", "type": "uint256" } 844 | ], 845 | "internalType": "struct DataTypes.EIP712Signature", 846 | "name": "sig", 847 | "type": "tuple" 848 | } 849 | ], 850 | "name": "permitForAll", 851 | "outputs": [], 852 | "stateMutability": "nonpayable", 853 | "type": "function" 854 | }, 855 | { 856 | "inputs": [ 857 | { 858 | "components": [ 859 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 860 | { "internalType": "string", "name": "contentURI", "type": "string" }, 861 | { 862 | "internalType": "address", 863 | "name": "collectModule", 864 | "type": "address" 865 | }, 866 | { 867 | "internalType": "bytes", 868 | "name": "collectModuleData", 869 | "type": "bytes" 870 | }, 871 | { 872 | "internalType": "address", 873 | "name": "referenceModule", 874 | "type": "address" 875 | }, 876 | { 877 | "internalType": "bytes", 878 | "name": "referenceModuleData", 879 | "type": "bytes" 880 | } 881 | ], 882 | "internalType": "struct DataTypes.PostData", 883 | "name": "vars", 884 | "type": "tuple" 885 | } 886 | ], 887 | "name": "post", 888 | "outputs": [], 889 | "stateMutability": "nonpayable", 890 | "type": "function" 891 | }, 892 | { 893 | "inputs": [ 894 | { 895 | "components": [ 896 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 897 | { "internalType": "string", "name": "contentURI", "type": "string" }, 898 | { 899 | "internalType": "address", 900 | "name": "collectModule", 901 | "type": "address" 902 | }, 903 | { 904 | "internalType": "bytes", 905 | "name": "collectModuleData", 906 | "type": "bytes" 907 | }, 908 | { 909 | "internalType": "address", 910 | "name": "referenceModule", 911 | "type": "address" 912 | }, 913 | { 914 | "internalType": "bytes", 915 | "name": "referenceModuleData", 916 | "type": "bytes" 917 | }, 918 | { 919 | "components": [ 920 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 921 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 922 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 923 | { 924 | "internalType": "uint256", 925 | "name": "deadline", 926 | "type": "uint256" 927 | } 928 | ], 929 | "internalType": "struct DataTypes.EIP712Signature", 930 | "name": "sig", 931 | "type": "tuple" 932 | } 933 | ], 934 | "internalType": "struct DataTypes.PostWithSigData", 935 | "name": "vars", 936 | "type": "tuple" 937 | } 938 | ], 939 | "name": "postWithSig", 940 | "outputs": [], 941 | "stateMutability": "nonpayable", 942 | "type": "function" 943 | }, 944 | { 945 | "inputs": [ 946 | { "internalType": "address", "name": "from", "type": "address" }, 947 | { "internalType": "address", "name": "to", "type": "address" }, 948 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 949 | ], 950 | "name": "safeTransferFrom", 951 | "outputs": [], 952 | "stateMutability": "nonpayable", 953 | "type": "function" 954 | }, 955 | { 956 | "inputs": [ 957 | { "internalType": "address", "name": "from", "type": "address" }, 958 | { "internalType": "address", "name": "to", "type": "address" }, 959 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, 960 | { "internalType": "bytes", "name": "_data", "type": "bytes" } 961 | ], 962 | "name": "safeTransferFrom", 963 | "outputs": [], 964 | "stateMutability": "nonpayable", 965 | "type": "function" 966 | }, 967 | { 968 | "inputs": [ 969 | { "internalType": "address", "name": "operator", "type": "address" }, 970 | { "internalType": "bool", "name": "approved", "type": "bool" } 971 | ], 972 | "name": "setApprovalForAll", 973 | "outputs": [], 974 | "stateMutability": "nonpayable", 975 | "type": "function" 976 | }, 977 | { 978 | "inputs": [ 979 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 980 | { "internalType": "address", "name": "dispatcher", "type": "address" } 981 | ], 982 | "name": "setDispatcher", 983 | "outputs": [], 984 | "stateMutability": "nonpayable", 985 | "type": "function" 986 | }, 987 | { 988 | "inputs": [ 989 | { 990 | "components": [ 991 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 992 | { 993 | "internalType": "address", 994 | "name": "dispatcher", 995 | "type": "address" 996 | }, 997 | { 998 | "components": [ 999 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 1000 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 1001 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 1002 | { 1003 | "internalType": "uint256", 1004 | "name": "deadline", 1005 | "type": "uint256" 1006 | } 1007 | ], 1008 | "internalType": "struct DataTypes.EIP712Signature", 1009 | "name": "sig", 1010 | "type": "tuple" 1011 | } 1012 | ], 1013 | "internalType": "struct DataTypes.SetDispatcherWithSigData", 1014 | "name": "vars", 1015 | "type": "tuple" 1016 | } 1017 | ], 1018 | "name": "setDispatcherWithSig", 1019 | "outputs": [], 1020 | "stateMutability": "nonpayable", 1021 | "type": "function" 1022 | }, 1023 | { 1024 | "inputs": [ 1025 | { 1026 | "internalType": "address", 1027 | "name": "newEmergencyAdmin", 1028 | "type": "address" 1029 | } 1030 | ], 1031 | "name": "setEmergencyAdmin", 1032 | "outputs": [], 1033 | "stateMutability": "nonpayable", 1034 | "type": "function" 1035 | }, 1036 | { 1037 | "inputs": [ 1038 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1039 | { "internalType": "address", "name": "followModule", "type": "address" }, 1040 | { "internalType": "bytes", "name": "followModuleData", "type": "bytes" } 1041 | ], 1042 | "name": "setFollowModule", 1043 | "outputs": [], 1044 | "stateMutability": "nonpayable", 1045 | "type": "function" 1046 | }, 1047 | { 1048 | "inputs": [ 1049 | { 1050 | "components": [ 1051 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1052 | { 1053 | "internalType": "address", 1054 | "name": "followModule", 1055 | "type": "address" 1056 | }, 1057 | { 1058 | "internalType": "bytes", 1059 | "name": "followModuleData", 1060 | "type": "bytes" 1061 | }, 1062 | { 1063 | "components": [ 1064 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 1065 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 1066 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 1067 | { 1068 | "internalType": "uint256", 1069 | "name": "deadline", 1070 | "type": "uint256" 1071 | } 1072 | ], 1073 | "internalType": "struct DataTypes.EIP712Signature", 1074 | "name": "sig", 1075 | "type": "tuple" 1076 | } 1077 | ], 1078 | "internalType": "struct DataTypes.SetFollowModuleWithSigData", 1079 | "name": "vars", 1080 | "type": "tuple" 1081 | } 1082 | ], 1083 | "name": "setFollowModuleWithSig", 1084 | "outputs": [], 1085 | "stateMutability": "nonpayable", 1086 | "type": "function" 1087 | }, 1088 | { 1089 | "inputs": [ 1090 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1091 | { "internalType": "string", "name": "followNFTURI", "type": "string" } 1092 | ], 1093 | "name": "setFollowNFTURI", 1094 | "outputs": [], 1095 | "stateMutability": "nonpayable", 1096 | "type": "function" 1097 | }, 1098 | { 1099 | "inputs": [ 1100 | { 1101 | "components": [ 1102 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1103 | { 1104 | "internalType": "string", 1105 | "name": "followNFTURI", 1106 | "type": "string" 1107 | }, 1108 | { 1109 | "components": [ 1110 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 1111 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 1112 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 1113 | { 1114 | "internalType": "uint256", 1115 | "name": "deadline", 1116 | "type": "uint256" 1117 | } 1118 | ], 1119 | "internalType": "struct DataTypes.EIP712Signature", 1120 | "name": "sig", 1121 | "type": "tuple" 1122 | } 1123 | ], 1124 | "internalType": "struct DataTypes.SetFollowNFTURIWithSigData", 1125 | "name": "vars", 1126 | "type": "tuple" 1127 | } 1128 | ], 1129 | "name": "setFollowNFTURIWithSig", 1130 | "outputs": [], 1131 | "stateMutability": "nonpayable", 1132 | "type": "function" 1133 | }, 1134 | { 1135 | "inputs": [ 1136 | { "internalType": "address", "name": "newGovernance", "type": "address" } 1137 | ], 1138 | "name": "setGovernance", 1139 | "outputs": [], 1140 | "stateMutability": "nonpayable", 1141 | "type": "function" 1142 | }, 1143 | { 1144 | "inputs": [ 1145 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1146 | { "internalType": "string", "name": "imageURI", "type": "string" } 1147 | ], 1148 | "name": "setProfileImageURI", 1149 | "outputs": [], 1150 | "stateMutability": "nonpayable", 1151 | "type": "function" 1152 | }, 1153 | { 1154 | "inputs": [ 1155 | { 1156 | "components": [ 1157 | { "internalType": "uint256", "name": "profileId", "type": "uint256" }, 1158 | { "internalType": "string", "name": "imageURI", "type": "string" }, 1159 | { 1160 | "components": [ 1161 | { "internalType": "uint8", "name": "v", "type": "uint8" }, 1162 | { "internalType": "bytes32", "name": "r", "type": "bytes32" }, 1163 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }, 1164 | { 1165 | "internalType": "uint256", 1166 | "name": "deadline", 1167 | "type": "uint256" 1168 | } 1169 | ], 1170 | "internalType": "struct DataTypes.EIP712Signature", 1171 | "name": "sig", 1172 | "type": "tuple" 1173 | } 1174 | ], 1175 | "internalType": "struct DataTypes.SetProfileImageURIWithSigData", 1176 | "name": "vars", 1177 | "type": "tuple" 1178 | } 1179 | ], 1180 | "name": "setProfileImageURIWithSig", 1181 | "outputs": [], 1182 | "stateMutability": "nonpayable", 1183 | "type": "function" 1184 | }, 1185 | { 1186 | "inputs": [ 1187 | { 1188 | "internalType": "enum DataTypes.ProtocolState", 1189 | "name": "newState", 1190 | "type": "uint8" 1191 | } 1192 | ], 1193 | "name": "setState", 1194 | "outputs": [], 1195 | "stateMutability": "nonpayable", 1196 | "type": "function" 1197 | }, 1198 | { 1199 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 1200 | "name": "sigNonces", 1201 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 1202 | "stateMutability": "view", 1203 | "type": "function" 1204 | }, 1205 | { 1206 | "inputs": [ 1207 | { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } 1208 | ], 1209 | "name": "supportsInterface", 1210 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 1211 | "stateMutability": "view", 1212 | "type": "function" 1213 | }, 1214 | { 1215 | "inputs": [], 1216 | "name": "symbol", 1217 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 1218 | "stateMutability": "view", 1219 | "type": "function" 1220 | }, 1221 | { 1222 | "inputs": [ 1223 | { "internalType": "uint256", "name": "index", "type": "uint256" } 1224 | ], 1225 | "name": "tokenByIndex", 1226 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 1227 | "stateMutability": "view", 1228 | "type": "function" 1229 | }, 1230 | { 1231 | "inputs": [ 1232 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 1233 | ], 1234 | "name": "tokenDataOf", 1235 | "outputs": [ 1236 | { 1237 | "components": [ 1238 | { "internalType": "address", "name": "owner", "type": "address" }, 1239 | { 1240 | "internalType": "uint96", 1241 | "name": "mintTimestamp", 1242 | "type": "uint96" 1243 | } 1244 | ], 1245 | "internalType": "struct IERC721Time.TokenData", 1246 | "name": "", 1247 | "type": "tuple" 1248 | } 1249 | ], 1250 | "stateMutability": "view", 1251 | "type": "function" 1252 | }, 1253 | { 1254 | "inputs": [ 1255 | { "internalType": "address", "name": "owner", "type": "address" }, 1256 | { "internalType": "uint256", "name": "index", "type": "uint256" } 1257 | ], 1258 | "name": "tokenOfOwnerByIndex", 1259 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 1260 | "stateMutability": "view", 1261 | "type": "function" 1262 | }, 1263 | { 1264 | "inputs": [ 1265 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 1266 | ], 1267 | "name": "tokenURI", 1268 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 1269 | "stateMutability": "view", 1270 | "type": "function" 1271 | }, 1272 | { 1273 | "inputs": [], 1274 | "name": "totalSupply", 1275 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 1276 | "stateMutability": "view", 1277 | "type": "function" 1278 | }, 1279 | { 1280 | "inputs": [ 1281 | { "internalType": "address", "name": "from", "type": "address" }, 1282 | { "internalType": "address", "name": "to", "type": "address" }, 1283 | { "internalType": "uint256", "name": "tokenId", "type": "uint256" } 1284 | ], 1285 | "name": "transferFrom", 1286 | "outputs": [], 1287 | "stateMutability": "nonpayable", 1288 | "type": "function" 1289 | }, 1290 | { 1291 | "inputs": [ 1292 | { "internalType": "address", "name": "collectModule", "type": "address" }, 1293 | { "internalType": "bool", "name": "whitelist", "type": "bool" } 1294 | ], 1295 | "name": "whitelistCollectModule", 1296 | "outputs": [], 1297 | "stateMutability": "nonpayable", 1298 | "type": "function" 1299 | }, 1300 | { 1301 | "inputs": [ 1302 | { "internalType": "address", "name": "followModule", "type": "address" }, 1303 | { "internalType": "bool", "name": "whitelist", "type": "bool" } 1304 | ], 1305 | "name": "whitelistFollowModule", 1306 | "outputs": [], 1307 | "stateMutability": "nonpayable", 1308 | "type": "function" 1309 | }, 1310 | { 1311 | "inputs": [ 1312 | { 1313 | "internalType": "address", 1314 | "name": "profileCreator", 1315 | "type": "address" 1316 | }, 1317 | { "internalType": "bool", "name": "whitelist", "type": "bool" } 1318 | ], 1319 | "name": "whitelistProfileCreator", 1320 | "outputs": [], 1321 | "stateMutability": "nonpayable", 1322 | "type": "function" 1323 | }, 1324 | { 1325 | "inputs": [ 1326 | { 1327 | "internalType": "address", 1328 | "name": "referenceModule", 1329 | "type": "address" 1330 | }, 1331 | { "internalType": "bool", "name": "whitelist", "type": "bool" } 1332 | ], 1333 | "name": "whitelistReferenceModule", 1334 | "outputs": [], 1335 | "stateMutability": "nonpayable", 1336 | "type": "function" 1337 | }, 1338 | { 1339 | "anonymous": false, 1340 | "inputs": [ 1341 | { 1342 | "indexed": false, 1343 | "internalType": "string", 1344 | "name": "name", 1345 | "type": "string" 1346 | }, 1347 | { 1348 | "indexed": false, 1349 | "internalType": "string", 1350 | "name": "symbol", 1351 | "type": "string" 1352 | }, 1353 | { 1354 | "indexed": false, 1355 | "internalType": "uint256", 1356 | "name": "timestamp", 1357 | "type": "uint256" 1358 | } 1359 | ], 1360 | "name": "BaseInitialized", 1361 | "type": "event" 1362 | }, 1363 | { 1364 | "anonymous": false, 1365 | "inputs": [ 1366 | { 1367 | "indexed": true, 1368 | "internalType": "address", 1369 | "name": "collectModule", 1370 | "type": "address" 1371 | }, 1372 | { 1373 | "indexed": true, 1374 | "internalType": "bool", 1375 | "name": "whitelisted", 1376 | "type": "bool" 1377 | }, 1378 | { 1379 | "indexed": false, 1380 | "internalType": "uint256", 1381 | "name": "timestamp", 1382 | "type": "uint256" 1383 | } 1384 | ], 1385 | "name": "CollectModuleWhitelisted", 1386 | "type": "event" 1387 | }, 1388 | { 1389 | "anonymous": false, 1390 | "inputs": [ 1391 | { 1392 | "indexed": true, 1393 | "internalType": "uint256", 1394 | "name": "profileId", 1395 | "type": "uint256" 1396 | }, 1397 | { 1398 | "indexed": true, 1399 | "internalType": "uint256", 1400 | "name": "pubId", 1401 | "type": "uint256" 1402 | }, 1403 | { 1404 | "indexed": true, 1405 | "internalType": "address", 1406 | "name": "collectNFT", 1407 | "type": "address" 1408 | }, 1409 | { 1410 | "indexed": false, 1411 | "internalType": "uint256", 1412 | "name": "timestamp", 1413 | "type": "uint256" 1414 | } 1415 | ], 1416 | "name": "CollectNFTDeployed", 1417 | "type": "event" 1418 | }, 1419 | { 1420 | "anonymous": false, 1421 | "inputs": [ 1422 | { 1423 | "indexed": true, 1424 | "internalType": "uint256", 1425 | "name": "profileId", 1426 | "type": "uint256" 1427 | }, 1428 | { 1429 | "indexed": true, 1430 | "internalType": "uint256", 1431 | "name": "pubId", 1432 | "type": "uint256" 1433 | }, 1434 | { 1435 | "indexed": false, 1436 | "internalType": "uint256", 1437 | "name": "timestamp", 1438 | "type": "uint256" 1439 | } 1440 | ], 1441 | "name": "CollectNFTInitialized", 1442 | "type": "event" 1443 | }, 1444 | { 1445 | "anonymous": false, 1446 | "inputs": [ 1447 | { 1448 | "indexed": true, 1449 | "internalType": "uint256", 1450 | "name": "profileId", 1451 | "type": "uint256" 1452 | }, 1453 | { 1454 | "indexed": true, 1455 | "internalType": "uint256", 1456 | "name": "pubId", 1457 | "type": "uint256" 1458 | }, 1459 | { 1460 | "indexed": true, 1461 | "internalType": "uint256", 1462 | "name": "collectNFTId", 1463 | "type": "uint256" 1464 | }, 1465 | { 1466 | "indexed": false, 1467 | "internalType": "address", 1468 | "name": "from", 1469 | "type": "address" 1470 | }, 1471 | { 1472 | "indexed": false, 1473 | "internalType": "address", 1474 | "name": "to", 1475 | "type": "address" 1476 | }, 1477 | { 1478 | "indexed": false, 1479 | "internalType": "uint256", 1480 | "name": "timestamp", 1481 | "type": "uint256" 1482 | } 1483 | ], 1484 | "name": "CollectNFTTransferred", 1485 | "type": "event" 1486 | }, 1487 | 1488 | { 1489 | "anonymous": false, 1490 | "inputs": [ 1491 | { 1492 | "indexed": true, 1493 | "internalType": "address", 1494 | "name": "wallet", 1495 | "type": "address" 1496 | }, 1497 | { 1498 | "indexed": true, 1499 | "internalType": "uint256", 1500 | "name": "profileId", 1501 | "type": "uint256" 1502 | }, 1503 | { 1504 | "indexed": false, 1505 | "internalType": "uint256", 1506 | "name": "timestamp", 1507 | "type": "uint256" 1508 | } 1509 | ], 1510 | "name": "DefaultProfileSet", 1511 | "type": "event" 1512 | }, 1513 | { 1514 | "anonymous": false, 1515 | "inputs": [ 1516 | { 1517 | "indexed": true, 1518 | "internalType": "uint256", 1519 | "name": "profileId", 1520 | "type": "uint256" 1521 | }, 1522 | { 1523 | "indexed": true, 1524 | "internalType": "uint256", 1525 | "name": "followNFTId", 1526 | "type": "uint256" 1527 | }, 1528 | { 1529 | "indexed": false, 1530 | "internalType": "address", 1531 | "name": "from", 1532 | "type": "address" 1533 | }, 1534 | { 1535 | "indexed": false, 1536 | "internalType": "address", 1537 | "name": "to", 1538 | "type": "address" 1539 | }, 1540 | { 1541 | "indexed": false, 1542 | "internalType": "uint256", 1543 | "name": "timestamp", 1544 | "type": "uint256" 1545 | } 1546 | ], 1547 | "name": "FollowNFTTransferred", 1548 | "type": "event" 1549 | }, 1550 | 1551 | { 1552 | "anonymous": false, 1553 | "inputs": [ 1554 | { 1555 | "indexed": true, 1556 | "internalType": "address", 1557 | "name": "collector", 1558 | "type": "address" 1559 | }, 1560 | { 1561 | "indexed": true, 1562 | "internalType": "uint256", 1563 | "name": "profileId", 1564 | "type": "uint256" 1565 | }, 1566 | { 1567 | "indexed": true, 1568 | "internalType": "uint256", 1569 | "name": "pubId", 1570 | "type": "uint256" 1571 | }, 1572 | { 1573 | "indexed": false, 1574 | "internalType": "uint256", 1575 | "name": "rootProfileId", 1576 | "type": "uint256" 1577 | }, 1578 | { 1579 | "indexed": false, 1580 | "internalType": "uint256", 1581 | "name": "rootPubId", 1582 | "type": "uint256" 1583 | }, 1584 | { 1585 | "indexed": false, 1586 | "internalType": "uint256", 1587 | "name": "timestamp", 1588 | "type": "uint256" 1589 | } 1590 | ], 1591 | "name": "Collected", 1592 | "type": "event" 1593 | }, 1594 | { 1595 | "anonymous": false, 1596 | "inputs": [ 1597 | { 1598 | "indexed": true, 1599 | "internalType": "uint256", 1600 | "name": "profileId", 1601 | "type": "uint256" 1602 | }, 1603 | { 1604 | "indexed": true, 1605 | "internalType": "uint256", 1606 | "name": "pubId", 1607 | "type": "uint256" 1608 | }, 1609 | { 1610 | "indexed": false, 1611 | "internalType": "string", 1612 | "name": "contentURI", 1613 | "type": "string" 1614 | }, 1615 | { 1616 | "indexed": false, 1617 | "internalType": "uint256", 1618 | "name": "profileIdPointed", 1619 | "type": "uint256" 1620 | }, 1621 | { 1622 | "indexed": false, 1623 | "internalType": "uint256", 1624 | "name": "pubIdPointed", 1625 | "type": "uint256" 1626 | }, 1627 | { 1628 | "indexed": false, 1629 | "internalType": "bytes", 1630 | "name": "referenceModuleData", 1631 | "type": "bytes" 1632 | }, 1633 | { 1634 | "indexed": false, 1635 | "internalType": "address", 1636 | "name": "collectModule", 1637 | "type": "address" 1638 | }, 1639 | { 1640 | "indexed": false, 1641 | "internalType": "bytes", 1642 | "name": "collectModuleReturnData", 1643 | "type": "bytes" 1644 | }, 1645 | { 1646 | "indexed": false, 1647 | "internalType": "address", 1648 | "name": "referenceModule", 1649 | "type": "address" 1650 | }, 1651 | { 1652 | "indexed": false, 1653 | "internalType": "bytes", 1654 | "name": "referenceModuleReturnData", 1655 | "type": "bytes" 1656 | }, 1657 | { 1658 | "indexed": false, 1659 | "internalType": "uint256", 1660 | "name": "timestamp", 1661 | "type": "uint256" 1662 | } 1663 | ], 1664 | "name": "CommentCreated", 1665 | "type": "event" 1666 | }, 1667 | { 1668 | "anonymous": false, 1669 | "inputs": [ 1670 | { 1671 | "indexed": true, 1672 | "internalType": "uint256", 1673 | "name": "profileId", 1674 | "type": "uint256" 1675 | }, 1676 | { 1677 | "indexed": true, 1678 | "internalType": "address", 1679 | "name": "dispatcher", 1680 | "type": "address" 1681 | }, 1682 | { 1683 | "indexed": false, 1684 | "internalType": "uint256", 1685 | "name": "timestamp", 1686 | "type": "uint256" 1687 | } 1688 | ], 1689 | "name": "DispatcherSet", 1690 | "type": "event" 1691 | }, 1692 | { 1693 | "anonymous": false, 1694 | "inputs": [ 1695 | { 1696 | "indexed": true, 1697 | "internalType": "address", 1698 | "name": "caller", 1699 | "type": "address" 1700 | }, 1701 | { 1702 | "indexed": true, 1703 | "internalType": "address", 1704 | "name": "oldEmergencyAdmin", 1705 | "type": "address" 1706 | }, 1707 | { 1708 | "indexed": true, 1709 | "internalType": "address", 1710 | "name": "newEmergencyAdmin", 1711 | "type": "address" 1712 | }, 1713 | { 1714 | "indexed": false, 1715 | "internalType": "uint256", 1716 | "name": "timestamp", 1717 | "type": "uint256" 1718 | } 1719 | ], 1720 | "name": "EmergencyAdminSet", 1721 | "type": "event" 1722 | }, 1723 | { 1724 | "anonymous": false, 1725 | "inputs": [ 1726 | { 1727 | "indexed": true, 1728 | "internalType": "address", 1729 | "name": "moduleGlobals", 1730 | "type": "address" 1731 | }, 1732 | { 1733 | "indexed": false, 1734 | "internalType": "uint256", 1735 | "name": "timestamp", 1736 | "type": "uint256" 1737 | } 1738 | ], 1739 | "name": "FeeModuleBaseConstructed", 1740 | "type": "event" 1741 | }, 1742 | { 1743 | "anonymous": false, 1744 | "inputs": [ 1745 | { 1746 | "indexed": true, 1747 | "internalType": "uint256", 1748 | "name": "profileId", 1749 | "type": "uint256" 1750 | }, 1751 | { 1752 | "indexed": false, 1753 | "internalType": "address", 1754 | "name": "followModule", 1755 | "type": "address" 1756 | }, 1757 | { 1758 | "indexed": false, 1759 | "internalType": "bytes", 1760 | "name": "followModuleReturnData", 1761 | "type": "bytes" 1762 | }, 1763 | { 1764 | "indexed": false, 1765 | "internalType": "uint256", 1766 | "name": "timestamp", 1767 | "type": "uint256" 1768 | } 1769 | ], 1770 | "name": "FollowModuleSet", 1771 | "type": "event" 1772 | }, 1773 | { 1774 | "anonymous": false, 1775 | "inputs": [ 1776 | { 1777 | "indexed": true, 1778 | "internalType": "address", 1779 | "name": "followModule", 1780 | "type": "address" 1781 | }, 1782 | { 1783 | "indexed": true, 1784 | "internalType": "bool", 1785 | "name": "whitelisted", 1786 | "type": "bool" 1787 | }, 1788 | { 1789 | "indexed": false, 1790 | "internalType": "uint256", 1791 | "name": "timestamp", 1792 | "type": "uint256" 1793 | } 1794 | ], 1795 | "name": "FollowModuleWhitelisted", 1796 | "type": "event" 1797 | }, 1798 | { 1799 | "anonymous": false, 1800 | "inputs": [ 1801 | { 1802 | "indexed": true, 1803 | "internalType": "address", 1804 | "name": "delegate", 1805 | "type": "address" 1806 | }, 1807 | { 1808 | "indexed": true, 1809 | "internalType": "uint256", 1810 | "name": "newPower", 1811 | "type": "uint256" 1812 | }, 1813 | { 1814 | "indexed": false, 1815 | "internalType": "uint256", 1816 | "name": "timestamp", 1817 | "type": "uint256" 1818 | } 1819 | ], 1820 | "name": "FollowNFTDelegatedPowerChanged", 1821 | "type": "event" 1822 | }, 1823 | { 1824 | "anonymous": false, 1825 | "inputs": [ 1826 | { 1827 | "indexed": true, 1828 | "internalType": "uint256", 1829 | "name": "profileId", 1830 | "type": "uint256" 1831 | }, 1832 | { 1833 | "indexed": true, 1834 | "internalType": "address", 1835 | "name": "followNFT", 1836 | "type": "address" 1837 | }, 1838 | { 1839 | "indexed": false, 1840 | "internalType": "uint256", 1841 | "name": "timestamp", 1842 | "type": "uint256" 1843 | } 1844 | ], 1845 | "name": "FollowNFTDeployed", 1846 | "type": "event" 1847 | }, 1848 | { 1849 | "anonymous": false, 1850 | "inputs": [ 1851 | { 1852 | "indexed": true, 1853 | "internalType": "uint256", 1854 | "name": "profileId", 1855 | "type": "uint256" 1856 | }, 1857 | { 1858 | "indexed": false, 1859 | "internalType": "uint256", 1860 | "name": "timestamp", 1861 | "type": "uint256" 1862 | } 1863 | ], 1864 | "name": "FollowNFTInitialized", 1865 | "type": "event" 1866 | }, 1867 | { 1868 | "anonymous": false, 1869 | "inputs": [ 1870 | { 1871 | "indexed": true, 1872 | "internalType": "uint256", 1873 | "name": "profileId", 1874 | "type": "uint256" 1875 | }, 1876 | { 1877 | "indexed": true, 1878 | "internalType": "uint256", 1879 | "name": "followNFTId", 1880 | "type": "uint256" 1881 | }, 1882 | { 1883 | "indexed": false, 1884 | "internalType": "address", 1885 | "name": "from", 1886 | "type": "address" 1887 | }, 1888 | { 1889 | "indexed": false, 1890 | "internalType": "address", 1891 | "name": "to", 1892 | "type": "address" 1893 | }, 1894 | { 1895 | "indexed": false, 1896 | "internalType": "uint256", 1897 | "name": "timestamp", 1898 | "type": "uint256" 1899 | } 1900 | ], 1901 | "name": "FollowNFTTransferred", 1902 | "type": "event" 1903 | }, 1904 | { 1905 | "anonymous": false, 1906 | "inputs": [ 1907 | { 1908 | "indexed": true, 1909 | "internalType": "uint256", 1910 | "name": "profileId", 1911 | "type": "uint256" 1912 | }, 1913 | { 1914 | "indexed": false, 1915 | "internalType": "string", 1916 | "name": "followNFTURI", 1917 | "type": "string" 1918 | }, 1919 | { 1920 | "indexed": false, 1921 | "internalType": "uint256", 1922 | "name": "timestamp", 1923 | "type": "uint256" 1924 | } 1925 | ], 1926 | "name": "FollowNFTURISet", 1927 | "type": "event" 1928 | }, 1929 | { 1930 | "anonymous": false, 1931 | "inputs": [ 1932 | { 1933 | "indexed": true, 1934 | "internalType": "address", 1935 | "name": "follower", 1936 | "type": "address" 1937 | }, 1938 | { 1939 | "indexed": false, 1940 | "internalType": "uint256[]", 1941 | "name": "profileIds", 1942 | "type": "uint256[]" 1943 | }, 1944 | { 1945 | "indexed": false, 1946 | "internalType": "bytes[]", 1947 | "name": "followModuleDatas", 1948 | "type": "bytes[]" 1949 | }, 1950 | { 1951 | "indexed": false, 1952 | "internalType": "uint256", 1953 | "name": "timestamp", 1954 | "type": "uint256" 1955 | } 1956 | ], 1957 | "name": "Followed", 1958 | "type": "event" 1959 | }, 1960 | { 1961 | "anonymous": false, 1962 | "inputs": [ 1963 | { 1964 | "indexed": true, 1965 | "internalType": "address", 1966 | "name": "owner", 1967 | "type": "address" 1968 | }, 1969 | { 1970 | "indexed": true, 1971 | "internalType": "uint256", 1972 | "name": "profileId", 1973 | "type": "uint256" 1974 | }, 1975 | { 1976 | "indexed": false, 1977 | "internalType": "address[]", 1978 | "name": "addresses", 1979 | "type": "address[]" 1980 | }, 1981 | { 1982 | "indexed": false, 1983 | "internalType": "bool[]", 1984 | "name": "approved", 1985 | "type": "bool[]" 1986 | }, 1987 | { 1988 | "indexed": false, 1989 | "internalType": "uint256", 1990 | "name": "timestamp", 1991 | "type": "uint256" 1992 | } 1993 | ], 1994 | "name": "FollowsApproved", 1995 | "type": "event" 1996 | }, 1997 | { 1998 | "anonymous": false, 1999 | "inputs": [ 2000 | { 2001 | "indexed": true, 2002 | "internalType": "address", 2003 | "name": "caller", 2004 | "type": "address" 2005 | }, 2006 | { 2007 | "indexed": true, 2008 | "internalType": "address", 2009 | "name": "prevGovernance", 2010 | "type": "address" 2011 | }, 2012 | { 2013 | "indexed": true, 2014 | "internalType": "address", 2015 | "name": "newGovernance", 2016 | "type": "address" 2017 | }, 2018 | { 2019 | "indexed": false, 2020 | "internalType": "uint256", 2021 | "name": "timestamp", 2022 | "type": "uint256" 2023 | } 2024 | ], 2025 | "name": "GovernanceSet", 2026 | "type": "event" 2027 | }, 2028 | { 2029 | "anonymous": false, 2030 | "inputs": [ 2031 | { 2032 | "indexed": true, 2033 | "internalType": "uint256", 2034 | "name": "profileId", 2035 | "type": "uint256" 2036 | }, 2037 | { 2038 | "indexed": true, 2039 | "internalType": "uint256", 2040 | "name": "pubId", 2041 | "type": "uint256" 2042 | }, 2043 | { 2044 | "indexed": false, 2045 | "internalType": "uint256", 2046 | "name": "profileIdPointed", 2047 | "type": "uint256" 2048 | }, 2049 | { 2050 | "indexed": false, 2051 | "internalType": "uint256", 2052 | "name": "pubIdPointed", 2053 | "type": "uint256" 2054 | }, 2055 | { 2056 | "indexed": false, 2057 | "internalType": "bytes", 2058 | "name": "referenceModuleData", 2059 | "type": "bytes" 2060 | }, 2061 | { 2062 | "indexed": false, 2063 | "internalType": "address", 2064 | "name": "referenceModule", 2065 | "type": "address" 2066 | }, 2067 | { 2068 | "indexed": false, 2069 | "internalType": "bytes", 2070 | "name": "referenceModuleReturnData", 2071 | "type": "bytes" 2072 | }, 2073 | { 2074 | "indexed": false, 2075 | "internalType": "uint256", 2076 | "name": "timestamp", 2077 | "type": "uint256" 2078 | } 2079 | ], 2080 | "name": "MirrorCreated", 2081 | "type": "event" 2082 | }, 2083 | { 2084 | "anonymous": false, 2085 | "inputs": [ 2086 | { 2087 | "indexed": true, 2088 | "internalType": "address", 2089 | "name": "hub", 2090 | "type": "address" 2091 | }, 2092 | { 2093 | "indexed": false, 2094 | "internalType": "uint256", 2095 | "name": "timestamp", 2096 | "type": "uint256" 2097 | } 2098 | ], 2099 | "name": "ModuleBaseConstructed", 2100 | "type": "event" 2101 | }, 2102 | { 2103 | "anonymous": false, 2104 | "inputs": [ 2105 | { 2106 | "indexed": true, 2107 | "internalType": "address", 2108 | "name": "currency", 2109 | "type": "address" 2110 | }, 2111 | { 2112 | "indexed": true, 2113 | "internalType": "bool", 2114 | "name": "prevWhitelisted", 2115 | "type": "bool" 2116 | }, 2117 | { 2118 | "indexed": true, 2119 | "internalType": "bool", 2120 | "name": "whitelisted", 2121 | "type": "bool" 2122 | }, 2123 | { 2124 | "indexed": false, 2125 | "internalType": "uint256", 2126 | "name": "timestamp", 2127 | "type": "uint256" 2128 | } 2129 | ], 2130 | "name": "ModuleGlobalsCurrencyWhitelisted", 2131 | "type": "event" 2132 | }, 2133 | { 2134 | "anonymous": false, 2135 | "inputs": [ 2136 | { 2137 | "indexed": true, 2138 | "internalType": "address", 2139 | "name": "prevGovernance", 2140 | "type": "address" 2141 | }, 2142 | { 2143 | "indexed": true, 2144 | "internalType": "address", 2145 | "name": "newGovernance", 2146 | "type": "address" 2147 | }, 2148 | { 2149 | "indexed": false, 2150 | "internalType": "uint256", 2151 | "name": "timestamp", 2152 | "type": "uint256" 2153 | } 2154 | ], 2155 | "name": "ModuleGlobalsGovernanceSet", 2156 | "type": "event" 2157 | }, 2158 | { 2159 | "anonymous": false, 2160 | "inputs": [ 2161 | { 2162 | "indexed": true, 2163 | "internalType": "uint16", 2164 | "name": "prevTreasuryFee", 2165 | "type": "uint16" 2166 | }, 2167 | { 2168 | "indexed": true, 2169 | "internalType": "uint16", 2170 | "name": "newTreasuryFee", 2171 | "type": "uint16" 2172 | }, 2173 | { 2174 | "indexed": false, 2175 | "internalType": "uint256", 2176 | "name": "timestamp", 2177 | "type": "uint256" 2178 | } 2179 | ], 2180 | "name": "ModuleGlobalsTreasuryFeeSet", 2181 | "type": "event" 2182 | }, 2183 | { 2184 | "anonymous": false, 2185 | "inputs": [ 2186 | { 2187 | "indexed": true, 2188 | "internalType": "address", 2189 | "name": "prevTreasury", 2190 | "type": "address" 2191 | }, 2192 | { 2193 | "indexed": true, 2194 | "internalType": "address", 2195 | "name": "newTreasury", 2196 | "type": "address" 2197 | }, 2198 | { 2199 | "indexed": false, 2200 | "internalType": "uint256", 2201 | "name": "timestamp", 2202 | "type": "uint256" 2203 | } 2204 | ], 2205 | "name": "ModuleGlobalsTreasurySet", 2206 | "type": "event" 2207 | }, 2208 | { 2209 | "anonymous": false, 2210 | "inputs": [ 2211 | { 2212 | "indexed": true, 2213 | "internalType": "uint256", 2214 | "name": "profileId", 2215 | "type": "uint256" 2216 | }, 2217 | { 2218 | "indexed": true, 2219 | "internalType": "uint256", 2220 | "name": "pubId", 2221 | "type": "uint256" 2222 | }, 2223 | { 2224 | "indexed": false, 2225 | "internalType": "string", 2226 | "name": "contentURI", 2227 | "type": "string" 2228 | }, 2229 | { 2230 | "indexed": false, 2231 | "internalType": "address", 2232 | "name": "collectModule", 2233 | "type": "address" 2234 | }, 2235 | { 2236 | "indexed": false, 2237 | "internalType": "bytes", 2238 | "name": "collectModuleReturnData", 2239 | "type": "bytes" 2240 | }, 2241 | { 2242 | "indexed": false, 2243 | "internalType": "address", 2244 | "name": "referenceModule", 2245 | "type": "address" 2246 | }, 2247 | { 2248 | "indexed": false, 2249 | "internalType": "bytes", 2250 | "name": "referenceModuleReturnData", 2251 | "type": "bytes" 2252 | }, 2253 | { 2254 | "indexed": false, 2255 | "internalType": "uint256", 2256 | "name": "timestamp", 2257 | "type": "uint256" 2258 | } 2259 | ], 2260 | "name": "PostCreated", 2261 | "type": "event" 2262 | }, 2263 | { 2264 | "anonymous": false, 2265 | "inputs": [ 2266 | { 2267 | "indexed": true, 2268 | "internalType": "uint256", 2269 | "name": "profileId", 2270 | "type": "uint256" 2271 | }, 2272 | { 2273 | "indexed": true, 2274 | "internalType": "address", 2275 | "name": "creator", 2276 | "type": "address" 2277 | }, 2278 | { 2279 | "indexed": true, 2280 | "internalType": "address", 2281 | "name": "to", 2282 | "type": "address" 2283 | }, 2284 | { 2285 | "indexed": false, 2286 | "internalType": "string", 2287 | "name": "handle", 2288 | "type": "string" 2289 | }, 2290 | { 2291 | "indexed": false, 2292 | "internalType": "string", 2293 | "name": "imageURI", 2294 | "type": "string" 2295 | }, 2296 | { 2297 | "indexed": false, 2298 | "internalType": "address", 2299 | "name": "followModule", 2300 | "type": "address" 2301 | }, 2302 | { 2303 | "indexed": false, 2304 | "internalType": "bytes", 2305 | "name": "followModuleReturnData", 2306 | "type": "bytes" 2307 | }, 2308 | { 2309 | "indexed": false, 2310 | "internalType": "string", 2311 | "name": "followNFTURI", 2312 | "type": "string" 2313 | }, 2314 | { 2315 | "indexed": false, 2316 | "internalType": "uint256", 2317 | "name": "timestamp", 2318 | "type": "uint256" 2319 | } 2320 | ], 2321 | "name": "ProfileCreated", 2322 | "type": "event" 2323 | }, 2324 | { 2325 | "anonymous": false, 2326 | "inputs": [ 2327 | { 2328 | "indexed": true, 2329 | "internalType": "address", 2330 | "name": "profileCreator", 2331 | "type": "address" 2332 | }, 2333 | { 2334 | "indexed": true, 2335 | "internalType": "bool", 2336 | "name": "whitelisted", 2337 | "type": "bool" 2338 | }, 2339 | { 2340 | "indexed": false, 2341 | "internalType": "uint256", 2342 | "name": "timestamp", 2343 | "type": "uint256" 2344 | } 2345 | ], 2346 | "name": "ProfileCreatorWhitelisted", 2347 | "type": "event" 2348 | }, 2349 | { 2350 | "anonymous": false, 2351 | "inputs": [ 2352 | { 2353 | "indexed": true, 2354 | "internalType": "uint256", 2355 | "name": "profileId", 2356 | "type": "uint256" 2357 | }, 2358 | { 2359 | "indexed": false, 2360 | "internalType": "string", 2361 | "name": "imageURI", 2362 | "type": "string" 2363 | }, 2364 | { 2365 | "indexed": false, 2366 | "internalType": "uint256", 2367 | "name": "timestamp", 2368 | "type": "uint256" 2369 | } 2370 | ], 2371 | "name": "ProfileImageURISet", 2372 | "type": "event" 2373 | }, 2374 | { 2375 | "anonymous": false, 2376 | "inputs": [ 2377 | { 2378 | "indexed": true, 2379 | "internalType": "address", 2380 | "name": "referenceModule", 2381 | "type": "address" 2382 | }, 2383 | { 2384 | "indexed": true, 2385 | "internalType": "bool", 2386 | "name": "whitelisted", 2387 | "type": "bool" 2388 | }, 2389 | { 2390 | "indexed": false, 2391 | "internalType": "uint256", 2392 | "name": "timestamp", 2393 | "type": "uint256" 2394 | } 2395 | ], 2396 | "name": "ReferenceModuleWhitelisted", 2397 | "type": "event" 2398 | }, 2399 | { 2400 | "anonymous": false, 2401 | "inputs": [ 2402 | { 2403 | "indexed": true, 2404 | "internalType": "address", 2405 | "name": "caller", 2406 | "type": "address" 2407 | }, 2408 | { 2409 | "indexed": true, 2410 | "internalType": "enum DataTypes.ProtocolState", 2411 | "name": "prevState", 2412 | "type": "uint8" 2413 | }, 2414 | { 2415 | "indexed": true, 2416 | "internalType": "enum DataTypes.ProtocolState", 2417 | "name": "newState", 2418 | "type": "uint8" 2419 | }, 2420 | { 2421 | "indexed": false, 2422 | "internalType": "uint256", 2423 | "name": "timestamp", 2424 | "type": "uint256" 2425 | } 2426 | ], 2427 | "name": "StateSet", 2428 | "type": "event" 2429 | } 2430 | ] 2431 | -------------------------------------------------------------------------------- /networks.json: -------------------------------------------------------------------------------- 1 | { 2 | "matic": { 3 | "LensHub": { 4 | "address": "0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lens-subgraph", 3 | "license": "MIT", 4 | "scripts": { 5 | "codegen": "graph codegen", 6 | "build": "graph build", 7 | "deploy": "graph deploy --node https://api.thegraph.com/deploy/ rtomas/lens-subgraph", 8 | "create-local": "graph create --node http://localhost:8020/ rtomas/lens-subgraph", 9 | "remove-local": "graph remove --node http://localhost:8020/ rtomas/lens-subgraph", 10 | "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 rtomas/lens-subgraph" 11 | }, 12 | "dependencies": { 13 | "@graphprotocol/graph-cli": "0.29.2", 14 | "@graphprotocol/graph-ts": "0.26.0", 15 | "@protofire/subgraph-toolkit": "^0.1.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@protofire/subgraph-toolkit/prettier.config.js"); 2 | -------------------------------------------------------------------------------- /schema.graphql: -------------------------------------------------------------------------------- 1 | type Stat @entity { 2 | id: ID! 3 | "Total profiles" 4 | totalProfiles: BigInt! 5 | "Total accounts" 6 | totalAccounts: BigInt! 7 | "Total Post" 8 | totalPosts: BigInt! 9 | "Total Comments" 10 | totalComments: BigInt! 11 | "Total Mirrors" 12 | totalMirror: BigInt! 13 | "Total Publicactions" 14 | totalPublications: BigInt! 15 | "Last Comment created" 16 | lastCommentCreatedAt: BigInt 17 | "Last Post created" 18 | lastPostCreatedAt: BigInt 19 | "Last Mirror created" 20 | lastMirrorCreatedAt: BigInt 21 | "Last Profile created" 22 | lastProfileCreated: BigInt 23 | } 24 | 25 | type Profile @entity { 26 | id: ID! 27 | "Number of profile" 28 | profileId: BigInt! 29 | "Address from the creator profile" 30 | creator: Creator! 31 | "Address from the owner creator profile" 32 | owner: Account! 33 | "User attempting to follow the profile should be issued a Follow NFT" 34 | followNFT: Bytes 35 | "IPFS has the follow data" 36 | followNFTURI: String # string 37 | "Nickname of the profile" 38 | handle: String # string 39 | "URI image of the profile" 40 | imageURI: String # string 41 | "Date created profile" 42 | createdAt: BigInt 43 | "Follow Module Address" 44 | followModule: Bytes 45 | "Follow Module Return Data" 46 | followModuleReturnData: Bytes 47 | "Dispatcher address allowed to post, comment, mirror, set follow module and change the profile picture on behalf of the owner." 48 | dispatcher: Bytes 49 | "Last Date modify profile" 50 | lastUpdated: BigInt! 51 | "Total mirrors" 52 | totalMirrors: BigInt! 53 | "Total posts" 54 | totalPosts: BigInt! 55 | "Total comments" 56 | totalComments: BigInt! 57 | "Total Followers" 58 | totalFollowers: BigInt! 59 | "Total Following From owner Account" 60 | totalFollowings: BigInt! 61 | "List of followers Account" 62 | followers: [Account!]! 63 | "List of following Profiles" 64 | followings: [Profile!]! 65 | "List of comments" 66 | comments: [Comment!] @derivedFrom(field: "fromProfile") 67 | "List of post" 68 | posts: [Post!] @derivedFrom(field: "fromProfile") 69 | "List of Mirrors" 70 | mirrors: [Mirror!] @derivedFrom(field: "fromProfile") 71 | } 72 | 73 | type Account @entity { 74 | id: ID! 75 | "Address" 76 | address: Bytes! 77 | "Default Profile" 78 | defaultProfile: Profile 79 | "List of Id profiles(String)" 80 | profilesIds: [String!]! 81 | "List of Profiles that own this account" 82 | profiles: [Profile!] @derivedFrom(field: "owner") 83 | "List of Followings Profiles" 84 | following: [Profile!]! 85 | "List of Following profiles" 86 | totalFollowings: BigInt! 87 | } 88 | 89 | type Creator @entity { 90 | id: ID! 91 | "Address" 92 | address: Bytes! 93 | "Account Address is whitelisted" 94 | isWhitelisted: Boolean! 95 | "Date last modify Address" 96 | lastUpdated: BigInt! 97 | } 98 | 99 | interface Publication @entity { 100 | id: ID! 101 | "Profile that created the publication" 102 | fromProfile: Profile! 103 | "Publication Id" 104 | pubId: BigInt! 105 | referenceModule: Bytes! 106 | referenceModuleReturnData: Bytes 107 | "Date of creation" 108 | timestamp: BigInt! 109 | } 110 | 111 | type Post implements Publication @entity { 112 | id: ID! 113 | "Profile that created the post" 114 | fromProfile: Profile! 115 | "Publication Id" 116 | pubId: BigInt! 117 | referenceModule: Bytes! 118 | referenceModuleReturnData: Bytes 119 | "URI of the post content" 120 | contentURI: String! 121 | collectModule: Bytes! 122 | collectModuleReturnData: Bytes 123 | "Date of creation" 124 | timestamp: BigInt! 125 | } 126 | 127 | type Mirror implements Publication @entity { 128 | id: ID! 129 | "Profile that created the post" 130 | fromProfile: Profile! 131 | "Publication Id" 132 | pubId: BigInt! 133 | referenceModule: Bytes! 134 | referenceModuleReturnData: Bytes 135 | profileIdPointed: BigInt! 136 | pubIdPointed: BigInt! 137 | "Date of creation" 138 | timestamp: BigInt! 139 | } 140 | 141 | type Comment implements Publication @entity { 142 | id: ID! 143 | "Profile that created the post" 144 | fromProfile: Profile! 145 | "Publication Id" 146 | pubId: BigInt! 147 | referenceModule: Bytes! 148 | referenceModuleReturnData: Bytes 149 | "URI of the post content" 150 | contentURI: String! 151 | profileIdPointed: BigInt! 152 | pubIdPointed: BigInt! 153 | collectModule: Bytes 154 | collectModuleReturnData: Bytes 155 | "Date of creation" 156 | timestamp: BigInt! 157 | } 158 | 159 | type Follow @entity { 160 | id: ID! 161 | "Follower Account. " 162 | fromAccount: Account 163 | 164 | fromProfileSTR: String 165 | "Array of profiles that are followed" 166 | toProfile: [Profile!] 167 | "Date from when the follow initiated" 168 | timestamp: BigInt! 169 | } 170 | 171 | type FollowNFTTransferred @entity { 172 | id: ID! 173 | profileId: BigInt 174 | followNFTID: BigInt 175 | from: Bytes 176 | to: Bytes 177 | timestamp: BigInt 178 | data: String 179 | } 180 | -------------------------------------------------------------------------------- /src/constanst.ts: -------------------------------------------------------------------------------- 1 | import { ADDRESS_ZERO } from '@protofire/subgraph-toolkit' 2 | // id for lensInfo entity 3 | export const LENS_ID = ADDRESS_ZERO 4 | -------------------------------------------------------------------------------- /src/mappings/index.ts: -------------------------------------------------------------------------------- 1 | import { ADDRESS_ZERO, integer, ZERO_ADDRESS } from '@protofire/subgraph-toolkit' 2 | import { BigInt, Bytes, log } from '@graphprotocol/graph-ts' 3 | import { 4 | ProfileCreated, 5 | FollowNFTURISet, 6 | ProfileImageURISet, 7 | FollowModuleSet, 8 | DispatcherSet, 9 | ProfileCreatorWhitelisted, 10 | PostCreated, 11 | MirrorCreated, 12 | CommentCreated, 13 | Followed, 14 | DefaultProfileSet, 15 | FollowNFTTransferred, 16 | } from '../../generated/LensHub/LensHub' 17 | import { accounts, profiles, creators, publicactions, follows, transfersNFT, stats } from '../modules' 18 | import { Account } from '../../generated/schema' 19 | import { LENS_ID } from '../constanst' 20 | 21 | export function handleProfileCreated(event: ProfileCreated): void { 22 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.params.timestamp) 23 | let creator = accounts.getOrCreateAccount(event.params.creator) 24 | let to = accounts.getOrCreateAccount(event.params.to) 25 | to.profilesIds = accounts.getListProfileOwned(to, event.params.profileId) 26 | 27 | profile.creator = event.params.creator.toHexString() 28 | profile.owner = event.params.to.toHexString() 29 | profile.followNFTURI = event.params.followNFTURI 30 | profile.followModule = event.params.followModule 31 | profile.handle = event.params.handle 32 | profile.followModuleReturnData = event.params.followModuleReturnData 33 | profile.imageURI = event.params.imageURI 34 | profile.lastUpdated = event.block.timestamp 35 | 36 | creator.save() 37 | to.save() 38 | profile.save() 39 | } 40 | 41 | export function handleFollowNFTURISet(event: FollowNFTURISet): void { 42 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.block.timestamp) 43 | 44 | profile.followNFTURI = event.params.followNFTURI 45 | profile.save() 46 | } 47 | 48 | export function handleProfileImageURISet(event: ProfileImageURISet): void { 49 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.block.timestamp) 50 | 51 | profile.imageURI = event.params.imageURI 52 | profile.save() 53 | } 54 | 55 | export function handleFollowModuleSet(event: FollowModuleSet): void { 56 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.block.timestamp) 57 | 58 | profile.followModule = event.params.followModule 59 | profile.followModuleReturnData = event.params.followModuleReturnData 60 | profile.save() 61 | } 62 | 63 | export function handleDispatcherSet(event: DispatcherSet): void { 64 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.block.timestamp) 65 | profile.dispatcher = event.params.dispatcher 66 | profile.save() 67 | } 68 | 69 | export function handleProfileCreatorWhitelisted(event: ProfileCreatorWhitelisted): void { 70 | let creator = creators.getOrCreateCreator(event.params.profileCreator, event.params.timestamp) 71 | creator.isWhitelisted = event.params.whitelisted 72 | creator.lastUpdated = event.params.timestamp 73 | creator.save() 74 | } 75 | 76 | export function handlePostCreated(event: PostCreated): void { 77 | let post = publicactions.getOrCreatePost(event.params.profileId, event.params.pubId) 78 | post.fromProfile = event.params.profileId.toString() 79 | post.pubId = event.params.pubId 80 | post.referenceModule = event.params.referenceModule 81 | post.referenceModuleReturnData = event.params.referenceModuleReturnData 82 | post.timestamp = event.params.timestamp 83 | post.contentURI = event.params.contentURI 84 | post.collectModule = event.params.collectModule 85 | post.collectModuleReturnData = event.params.collectModuleReturnData 86 | 87 | let stat = stats.getOrCreateLensInfo() 88 | stat.lastPostCreatedAt = event.params.timestamp 89 | stat.save() 90 | 91 | post.save() 92 | } 93 | 94 | export function handleMirrorCreated(event: MirrorCreated): void { 95 | let mirror = publicactions.getOrCreateMirror(event.params.profileId, event.params.pubId) 96 | mirror.fromProfile = event.params.profileId.toString() 97 | mirror.pubId = event.params.pubId 98 | mirror.referenceModule = event.params.referenceModule 99 | mirror.referenceModuleReturnData = event.params.referenceModuleReturnData 100 | mirror.timestamp = event.params.timestamp 101 | mirror.profileIdPointed = event.params.profileIdPointed 102 | mirror.pubIdPointed = event.params.pubIdPointed 103 | 104 | let stat = stats.getOrCreateLensInfo() 105 | stat.lastMirrorCreatedAt = event.params.timestamp 106 | stat.save() 107 | 108 | mirror.save() 109 | } 110 | 111 | export function handleCommentCreated(event: CommentCreated): void { 112 | let comment = publicactions.getOrCreateComment(event.params.profileId, event.params.pubId) 113 | comment.fromProfile = event.params.profileId.toString() 114 | comment.pubId = event.params.pubId 115 | comment.referenceModule = event.params.referenceModule 116 | comment.referenceModuleReturnData = event.params.referenceModuleReturnData 117 | comment.timestamp = event.params.timestamp 118 | comment.contentURI = event.params.contentURI 119 | comment.profileIdPointed = event.params.profileIdPointed 120 | comment.pubIdPointed = event.params.pubIdPointed 121 | comment.collectModule = event.params.collectModule 122 | comment.collectModuleReturnData = event.params.collectModuleReturnData 123 | 124 | let stat = stats.getOrCreateLensInfo() 125 | stat.lastCommentCreatedAt = event.params.timestamp 126 | stat.save() 127 | 128 | comment.save() 129 | } 130 | 131 | export function handleFollowed(event: Followed): void { 132 | let newFollows: string[] = [] 133 | newFollows = event.params.profileIds.map((profileId: BigInt): string => profileId.toString()) 134 | 135 | // Remove to build it in transfer NFT event 136 | //accounts.addFollowedProfile(event.params.follower, newFollows, event.params.timestamp) 137 | 138 | let follow = follows.getOrCreateFollow( 139 | event.params.follower 140 | .toHexString() 141 | .concat('-') 142 | .concat(event.transaction.hash.toHex()), 143 | ) 144 | 145 | follow.fromAccount = event.params.follower.toHexString() 146 | follow.fromProfileSTR = event.params.follower.toHexString() 147 | follow.toProfile = newFollows 148 | follow.timestamp = event.params.timestamp 149 | follow.save() 150 | } 151 | 152 | export function handleDefaultProfileSet(event: DefaultProfileSet): void { 153 | let account = accounts.getOrCreateAccount(event.params.wallet) 154 | account.defaultProfile = event.params.profileId.toString() 155 | account.save() 156 | } 157 | 158 | export function handleFollowNFTTransferred(event: FollowNFTTransferred): void { 159 | let transferId: string = event.params.profileId 160 | .toString() 161 | .concat('-') 162 | .concat(event.transaction.hash.toHex()) 163 | let from = event.params.from.toHexString() 164 | let to = event.params.to.toHexString() 165 | let profile = profiles.getOrCreateProfile(event.params.profileId, event.block.timestamp) 166 | 167 | if (from == ZERO_ADDRESS) { 168 | // MINT FOLLOW NFT 169 | let toAccount = accounts.getOrCreateAccount(event.params.to) 170 | 171 | //add and count the follower to the profile and the fromAccount 172 | profile.totalFollowers = profile.totalFollowers.plus(integer.ONE) 173 | let newFollowers = profile.followers 174 | 175 | if (newFollowers != null) { 176 | newFollowers.push(toAccount.id) 177 | profile.followers = newFollowers 178 | } 179 | 180 | let newFollowing = toAccount.following 181 | if (newFollowing != null) { 182 | newFollowing.push(profile.id) 183 | toAccount.following = newFollowing 184 | } 185 | toAccount.totalFollowings = toAccount.totalFollowings.plus(integer.ONE) 186 | profiles.updateProfilesFollowings(toAccount.profilesIds, newFollowing, toAccount.totalFollowings) 187 | 188 | toAccount.save() 189 | } else if (to == ZERO_ADDRESS) { 190 | // BURN FOLLOW NFT 191 | let fromAccount = accounts.getOrCreateAccount(event.params.from) 192 | profile.totalFollowers = profile.totalFollowers.minus(integer.ONE) 193 | 194 | //minus and count the follower to the profile and the fromAccount 195 | let newFollowing = fromAccount.following 196 | const index = newFollowing.indexOf(profile.id) 197 | if (index > -1) newFollowing.splice(index, 1) 198 | fromAccount.following = newFollowing 199 | fromAccount.totalFollowings = fromAccount.totalFollowings.minus(integer.ONE) 200 | 201 | // update de total of the following and the list to all the profiles from the address account 202 | profiles.updateProfilesFollowings(fromAccount.profilesIds, newFollowing, fromAccount.totalFollowings) 203 | fromAccount.save() 204 | } 205 | profile.save() 206 | 207 | let nft = transfersNFT.getOrCreateTransfersNFT(transferId) 208 | nft.from = event.params.from 209 | nft.to = event.params.to 210 | nft.timestamp = event.params.timestamp 211 | nft.followNFTID = event.params.followNFTId 212 | nft.profileId = event.params.profileId 213 | nft.save() 214 | } 215 | -------------------------------------------------------------------------------- /src/modules/accounts.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Bytes } from '@graphprotocol/graph-ts' 2 | import { ZERO_ADDRESS, integer } from '@protofire/subgraph-toolkit' 3 | import { Account } from '../../generated/schema' 4 | import { stats } from './lens' 5 | import { profiles } from '../modules' 6 | 7 | export namespace accounts { 8 | export function getOrCreateAccount(accountAddress: Bytes): Account { 9 | let accountId = accountAddress.toHexString() 10 | 11 | let account = Account.load(accountId) 12 | if (account == null) { 13 | account = new Account(accountId) 14 | account.address = accountAddress 15 | account.totalFollowings = integer.ZERO 16 | account.following = new Array() 17 | account.profilesIds = new Array() 18 | //account.save() 19 | 20 | // +1 amount of lens profiles 21 | let lensInfo = stats.getOrCreateLensInfo() 22 | lensInfo.totalAccounts = lensInfo.totalAccounts.plus(integer.ONE) 23 | lensInfo.save() 24 | } 25 | return account as Account 26 | } 27 | 28 | export function getListProfileOwned(account: Account, profileId: BigInt): Array { 29 | let newListProfiles = account.profilesIds 30 | newListProfiles.push(profileId.toString()) 31 | account.profilesIds = newListProfiles 32 | 33 | return newListProfiles 34 | } 35 | 36 | // OLD ONE 37 | /* export function addFollowedProfile(accountAddress: Bytes, profilesNumberList: string[], timestamp: BigInt): void { 38 | let account = getOrCreateAccount(accountAddress) 39 | let newFollowing: string[] = account.following 40 | 41 | for (let i = 0; i < profilesNumberList.length; i = i + 1) { 42 | newFollowing.push(profilesNumberList[i]) 43 | 44 | //Add one follower to the profile 45 | let profile = profiles.getOrCreateProfile(BigInt.fromString(profilesNumberList[i]), timestamp) 46 | profile.totalFollowers = profile.totalFollowers.plus(integer.ONE) 47 | profile.save() 48 | } 49 | 50 | account.following = newFollowing 51 | account.save() 52 | } */ 53 | } 54 | -------------------------------------------------------------------------------- /src/modules/creators.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Bytes } from '@graphprotocol/graph-ts' 2 | import { ZERO_ADDRESS, integer } from '@protofire/subgraph-toolkit' 3 | import { Creator } from '../../generated/schema' 4 | 5 | export namespace creators { 6 | export function getOrCreateCreator(accountAddress: Bytes, timeStamp: BigInt): Creator { 7 | let creatorId = accountAddress.toHexString() 8 | 9 | let creator = Creator.load(creatorId) 10 | if (creator == null) { 11 | creator = new Creator(creatorId) 12 | creator.address = accountAddress 13 | creator.isWhitelisted = false 14 | creator.lastUpdated = timeStamp 15 | creator.save() 16 | } 17 | return creator as Creator 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/modules/follows.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Bytes } from '@graphprotocol/graph-ts' 2 | import { ZERO_ADDRESS, integer } from '@protofire/subgraph-toolkit' 3 | import { Follow } from '../../generated/schema' 4 | export namespace follows { 5 | export function getOrCreateFollow(accountAddress: string): Follow { 6 | let follow = Follow.load(accountAddress) 7 | if (follow == null) { 8 | follow = new Follow(accountAddress) 9 | } 10 | return follow as Follow 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/modules/index.ts: -------------------------------------------------------------------------------- 1 | export * from './profiles' 2 | export * from './lens' 3 | export * from './accounts' 4 | export * from './creators' 5 | export * from './publications' 6 | export * from './follows' 7 | export * from './transfersNFT' 8 | -------------------------------------------------------------------------------- /src/modules/lens.ts: -------------------------------------------------------------------------------- 1 | import { Bytes } from '@graphprotocol/graph-ts' 2 | import { integer } from '@protofire/subgraph-toolkit' 3 | import { Stat } from '../../generated/schema' 4 | import { LENS_ID } from '../constanst' 5 | 6 | export namespace stats { 7 | export function getOrCreateLensInfo(): Stat { 8 | let statInfo = Stat.load(LENS_ID) 9 | if (statInfo == null) { 10 | statInfo = new Stat(LENS_ID) 11 | statInfo.totalAccounts = integer.ZERO 12 | statInfo.totalProfiles = integer.ZERO 13 | statInfo.totalPosts = integer.ZERO 14 | statInfo.totalMirror = integer.ZERO 15 | statInfo.totalAccounts = integer.ZERO 16 | statInfo.totalPublications = integer.ZERO 17 | statInfo.totalComments = integer.ZERO 18 | 19 | statInfo.save() 20 | } 21 | return statInfo as Stat 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/profiles.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Bytes, log } from '@graphprotocol/graph-ts' 2 | import { ZERO_ADDRESS, integer } from '@protofire/subgraph-toolkit' 3 | import { Profile } from '../../generated/schema' 4 | import { stats } from './lens' 5 | 6 | export namespace profiles { 7 | export function getOrCreateProfile(profileNumber: BigInt, timeStamp: BigInt): Profile { 8 | let profileId = profileNumber.toString() 9 | 10 | let profile = Profile.load(profileId) 11 | if (profile == null) { 12 | // init profile 13 | profile = new Profile(profileId) 14 | profile.profileId = profileNumber 15 | profile.createdAt = timeStamp 16 | profile.totalComments = integer.ZERO 17 | profile.totalPosts = integer.ZERO 18 | profile.totalMirrors = integer.ZERO 19 | profile.totalFollowers = integer.ZERO 20 | profile.totalFollowings = integer.ZERO 21 | profile.followers = new Array() 22 | profile.followings = new Array() 23 | 24 | // +1 amount of lens profiles 25 | let lensInfo = stats.getOrCreateLensInfo() 26 | lensInfo.totalProfiles = lensInfo.totalProfiles.plus(integer.ONE) 27 | lensInfo.lastProfileCreated = timeStamp 28 | lensInfo.save() 29 | } 30 | return profile as Profile 31 | } 32 | 33 | // le falta porque necesito update del profile tambien del que sigue y del que es seguido 34 | export function updateProfilesFollowings( 35 | accountProfiles: Array, 36 | newFollowing: Array, 37 | totalFollowings: BigInt, 38 | ): void { 39 | for (let i = 0; i < accountProfiles.length; ++i) { 40 | let profile = getOrCreateProfile(BigInt.fromString(accountProfiles[i]), BigInt.fromI32(0)) 41 | profile.totalFollowings = totalFollowings 42 | profile.followings = newFollowing 43 | profile.save() 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/modules/publications.ts: -------------------------------------------------------------------------------- 1 | import { ADDRESS_ZERO, integer } from '@protofire/subgraph-toolkit' 2 | import { BigInt } from '@graphprotocol/graph-ts' 3 | import { Post, Comment, Mirror } from '../../generated/schema' 4 | import { stats } from './lens' 5 | 6 | export namespace publicactions { 7 | export namespace helpers { 8 | export function getNewPublicactionId(profileId: BigInt, pubId: BigInt): string { 9 | return profileId 10 | .toString() 11 | .concat('-') 12 | .concat(pubId.toString()) 13 | } 14 | } 15 | 16 | export function getOrCreatePost(profileId: BigInt, pubId: BigInt): Post { 17 | let publicationId = helpers.getNewPublicactionId(profileId, pubId) 18 | let post = Post.load(publicationId) 19 | if (post == null) { 20 | post = new Post(publicationId) 21 | 22 | // +1 amount of Post 23 | let lensInfo = stats.getOrCreateLensInfo() 24 | lensInfo.totalPosts = lensInfo.totalPosts.plus(integer.ONE) 25 | lensInfo.totalPublications = lensInfo.totalPublications.plus(integer.ONE) 26 | lensInfo.save() 27 | } 28 | return post as Post 29 | } 30 | 31 | export function getOrCreateMirror(profileId: BigInt, pubId: BigInt): Mirror { 32 | let publicationId = helpers.getNewPublicactionId(profileId, pubId) 33 | let mirror = Mirror.load(publicationId) 34 | if (mirror == null) { 35 | mirror = new Mirror(publicationId) 36 | 37 | // +1 amount of Mirror 38 | let lensInfo = stats.getOrCreateLensInfo() 39 | lensInfo.totalMirror = lensInfo.totalMirror.plus(integer.ONE) 40 | lensInfo.totalPublications = lensInfo.totalPublications.plus(integer.ONE) 41 | lensInfo.save() 42 | } 43 | return mirror as Mirror 44 | } 45 | 46 | export function getOrCreateComment(profileId: BigInt, pubId: BigInt): Comment { 47 | let publicationId = helpers.getNewPublicactionId(profileId, pubId) 48 | let comment = Comment.load(publicationId) 49 | if (comment == null) { 50 | comment = new Comment(publicationId) 51 | 52 | // +1 amount of Comments 53 | let lensInfo = stats.getOrCreateLensInfo() 54 | lensInfo.totalComments = lensInfo.totalComments.plus(integer.ONE) 55 | lensInfo.totalPublications = lensInfo.totalPublications.plus(integer.ONE) 56 | 57 | lensInfo.save() 58 | } 59 | return comment as Comment 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/modules/transfersNFT.ts: -------------------------------------------------------------------------------- 1 | import { FollowNFTTransferred } from '../../generated/schema' 2 | 3 | export namespace transfersNFT { 4 | export function getOrCreateTransfersNFT(transferId: string): FollowNFTTransferred { 5 | let nft = FollowNFTTransferred.load(transferId) 6 | if (nft == null) { 7 | nft = new FollowNFTTransferred(transferId) 8 | nft.save() 9 | } 10 | return nft as FollowNFTTransferred 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /subgraph.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.2 2 | schema: 3 | file: ./schema.graphql 4 | dataSources: 5 | - kind: ethereum 6 | name: LensHub 7 | network: matic 8 | source: 9 | address: '0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d' 10 | abi: LensHub 11 | startBlock: 28384641 12 | mapping: 13 | kind: ethereum/events 14 | apiVersion: 0.0.5 15 | language: wasm/assemblyscript 16 | entities: 17 | - Profile 18 | - Account 19 | abis: 20 | - name: LensHub 21 | file: ./abis/LensHub.json 22 | eventHandlers: 23 | - event: ProfileCreated(indexed uint256,indexed address,indexed address,string,string,address,bytes,string,uint256) 24 | handler: handleProfileCreated 25 | - event: FollowNFTURISet(indexed uint256,string,uint256) 26 | handler: handleFollowNFTURISet 27 | - event: ProfileImageURISet(indexed uint256,string,uint256) 28 | handler: handleProfileImageURISet 29 | - event: DispatcherSet(indexed uint256,indexed address,uint256) 30 | handler: handleDispatcherSet 31 | - event: ProfileCreatorWhitelisted(indexed address,indexed bool,uint256) 32 | handler: handleProfileCreatorWhitelisted 33 | - event: FollowModuleSet(indexed uint256,address,bytes,uint256) 34 | handler: handleFollowModuleSet 35 | - event: PostCreated(indexed uint256,indexed uint256,string,address,bytes,address,bytes,uint256) 36 | handler: handlePostCreated 37 | - event: MirrorCreated(indexed uint256,indexed uint256,uint256,uint256,bytes,address,bytes,uint256) 38 | handler: handleMirrorCreated 39 | - event: CommentCreated(indexed uint256,indexed uint256,string,uint256,uint256,bytes,address,bytes,address,bytes,uint256) 40 | handler: handleCommentCreated 41 | - event: Followed(indexed address,uint256[],bytes[],uint256) 42 | handler: handleFollowed 43 | - event: DefaultProfileSet(indexed address,indexed uint256,uint256) 44 | handler: handleDefaultProfileSet 45 | - event: FollowNFTTransferred(indexed uint256,indexed uint256,address,address,uint256) 46 | handler: handleFollowNFTTransferred 47 | file: ./src/mappings/index.ts 48 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@graphprotocol/graph-ts/types/tsconfig.base.json", 3 | "include": ["src"] 4 | } 5 | --------------------------------------------------------------------------------