Skip to content

Reference: Params and proto objects #15

@calebsheridan

Description

@calebsheridan

Description

⚠️ This is a reference ticket that describes the schema for tracking Params. Work to build this schema should take place in other tickets:

Params are platform configurations that can be changed by spells.

Updated schema

type Param @entity {
  id: ID!
  description: String!      # Human-readable description
  currentValue: String!     # String representation of the value
  platform: Platform!       # Affected platform
  target: Target!           # Affected contract
  history: [ParamHistory]! @derivedFrom(field:"param")
  proposals: [ParamProposal]! @derivedFrom(field:"param")
}

type ParamHistory @entity {
  id: ID!
  param: Param!
  oldValue: String!
  newValue: String!
  changedInSpell: Spell! # Spell that changed the Param when it was executed
  timestamp: BigInt!     # Time of spell execution
}

type ParamProposal @entity {
  id: ID!
  param: Param!
  proposedValue: String!
  proposedInSpell: Spell!
  timestamp: BigInt!      # Time of spell creation
  eta: BigInt!            # Eta of spell
}

Current value

When a Spell is executed, the current value of the Param should be updated.

The current value of the Param will also often be set at contract execution. This must be handled manually for now, when the Params are initially created.

The old value will be placed in a proto object ParamHistory.

Proposed values

Params may have multiple proposed values from multiple spells. These are tracked and updated as a proto object ParamProposal.

The proto object only needs to be created when a new Spell is cast and does not need to be further updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions