blocklytics / spells-subgraph

Graph protocol subgraph for Spells.fyi
MIT License
6 stars 2 forks source link

Add admin fields to `Platform` entity #9

Closed calebsheridan closed 4 years ago

calebsheridan commented 4 years ago

Abstract

Timelocks are not used by all platforms. This could be because either:

These platforms should still be included in the project.

Schema Update

type Platform @entity {
  id: ID!
  target: [Target]! @derivedFrom(field: "platform")
  timelock: [Timelock]! @derivedFrom(field: "platform")
  currentAdmin: String   # New field. Ethereum address or null (no admin)
  usesAdmin: Boolean!    # New field.
  usesTimelock: Boolean! # New field.
}

Example queries

Supported platforms with an admin and without a timelock

where: { 
  usesAdmin: true
  usesTimelock: false
}

Supported platforms with an admin and timelock

where: { 
  usesAdmin: true,
  usesTimelock: true,
}

Supported platforms without an admin

where: { 
  usesAdmin: false
}

See also

https://defiwatch.net/admin-key-config-and-opsec/project-reviews

5