What role does a Program play in Allo?
On-chain, a program is a set of metadata stored on IPFS about an organization and a list of addresses that are able to update that metadata (what the protocol calls a Program Operator).
Every new program should be created through the Factory contract (see Contracts). When a new program is created, events are emitted by the Factory, which are then indexed so the data on a new is accessible. Deploying a program outside of the Factory will cost more gas and mean the new program isn't indexed and part of the data available through the protocol's subgraphs.
The metadata is made up of a protocol id (i.e.
1for IPFS) and a pointer to data off-chain (i.e. bafkreigda2vbuqipts6ttwmveqjmpjo35xyoqvxqrzh3pneb4zvcxqzta4). This metadata can be updated by any of the program operators using the
updateMetaPtr(MetaPtr)method of the
An initial list of program operators should be provided to the factory when a new program is created. The role system is based on OpenZeppelin's
AccessControlEnumerableand so exposes methods like
grantRole(bytes32,address)for adding new Program Operators.
New rounds are created through the separate, Round Factory contract (see Contracts), which expects the address of the program that will "own" the round. Round ownership signifies that the rounds are connected to the program in the data that gets indexed by the protocols subgraphs. The program contract is not granted a role on the round contract.