---
# System prepended metadata

title: Boost/Minion Subgraph Integration
tags: [Product]

---

---
tags: Product
---

# Boost/Minion Subgraph Integration


## Minion factory
We need a factory or series of factories to generate the minion contracts.
- 'Deploy' events to emit relevant data
  - related moloch contract address
  - new minion address
  - 'type' or 'boost' to indicate use case? 
      - might need to derive this if we have to have a separate factories for each usecase/boost
  - forged minions might have extra data associated - see transmutation factory


Minimal event
```
 emit Deployment(
   moloch,
   minion,
   boost
 );

```


Transmutation factory event for reference
```
 emit Deployment(
   _moloch,
   _distributionToken,
   minion,
   transmutation,
   trust
 );

```

#### can we limit the number of these or will we need one for each 'type'?
- Basic minion
- Forged minions


#### will need to deploy these for all networks


## Supergraph
We can add a data source for each factory to listen for the 'Deploy' events.

1. Add a Minion entity, it's id will be the minion contract address
 - type and/or boost fields can be used as some sort of indicator if the minion as a specific use case or is a general minion.

```
type Minion @entity {
  id: ID!
  molochAddress: Bytes!
  moloch: Moloch!
  type: String!
  type: String!
}
```

2. Connect to the Moloch entity

```
type Moloch @entity {
  id: ID!
  ...
  
  minions: [Minion!]!
}

```


3. Proposal submission/processing events in the moloch can now look at the address the proposals are coming from to identify if it is one of the minions and populate proposal metadata accordingly.

- Likely couple this with anything else we want to add to the details json like we are doing with minion/transmutation proposals now.

## Boost subgraph
If more complex data is needed, or if other events need to be tracked on the new minion we can build off the existing transmutation subgraph:
https://thegraph.com/explorer/subgraph/odyssy-automaton/daohaus-transmutation

1. Add data sources for each factory to register the minion
2. Add template data source to listen to the other minion events


#### This will be on a case by case basis



#### Notes

Kovan Factory 0xf46D5825e451f30540eaeDe3Dba31236a9e84a0f
quickdao 9000 minion 0x36473d5bbfa176733898019245a603d915171b7c

api to get abi

blockscout
https://blockscout.com/poa/xdai/api?module=contract&action=getabi&address=0x65d96f0DCD65dFbF6835807A2fDc5ba39fC273aA

etherscan
https://api.etherscan.io/api?module=contract&action=getabi&address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413&apikey=YourApiKeyToken