Global Data

@Jean_Safar Remember that access to contracts depends on the Party that is performing the lookup, not other contracts. You could “hardcode” the name of a global party, and then have that global Party serve the data to other users. That global party would be responsible for updating that data and also accepting (ex. via triggers) requests to access that data. Ideally, you would manage access to that global contract via a simple key so that the observers could look up that data.

template GlobalData
  with
    global : Party
    config_data : Text    -- TODO
    observers : [Party]
  where
    signatory global
    observer observers
    key global : Party
    maintainer key

    controller global can
      AddObserver : ContractId GlobalData
        with
          who : Party
        do
          create this with observers = who :: observers
3 Likes