# Proposal Deployment and Interaction Documentation
This document will detail how to deploy and set up a new Proposal, and how to interact with it once it's set up. For a more detailed description of each contract, refer to [the docs](Github link)
## Steps for Proposal deployment
### Prologue: Deploying the factories
1. Deploy the ModuleFactory contract
2. Deploy the ProposalFactory contract, passing the addresses of Proposal and ModuleFactory implementations
### Overview of contracts to be deployed
- Proposal
- PaymentProcessor
- MilestoneManager
- ListAuthorizer
### Necessary Metadata for each deployed contract
For each module to be deployed, create a metadata object with the following structure:
```
IModule.Metadata(
uint majorVersion;
uint minorVersion;
string url;
string title;
);
```
### How do we initialize it all to leave it "ready"
1. Deploy implementations of each module (e.g., PaymentProcessor, MilestoneManager, ListAuthorizer)
2. Deploy a beacon for each module
3. Set the implementation address in the respective beacon
4. Register modules at the ModuleFactory using their metadata and beacons
From then on we can create a new proposal using the ProposalFactory with the necessary module configurations
## Example usage
### Setting all up
1. Make sure the steps described above have been executed.
2. Prepare a `ProposalConfig` struct indicating the `owner` and `token` addresses.
3. Prepare Metadata structs for all modules the Proposal will be set up with
5. Call `createNewProposal()` on the proposalFactory contract supplying all the module Metadata to create a new proposal with all necessary modules.
### Adding 3 Milestones
1. Access the `MilestoneManager` module of the proposal.
2. Define the contributors, deadlines, budgets, and descriptions for each milestone.
3. Call `addMilestone()` with the specified parameters for each milestone.
### Starting the first milestone
1. Wait for the `MilestoneUpdateTimelock` to pass.
2. Call `startNextMilestone()` on the `MilestoneManager` module.
### Completing Milestone and starting the next one
1. After the milestone is submitted, call `completeMilestone()` with the `milestoneId` on the `MilestoneManager`.
2. Wait for the first milestone's duration to end.
3. Call `startNextMilestone()` on the `MilestoneManager`.
### Stopping the second milestone
1. Call `stopMilestone()` with the `milestoneId` on the `MilestoneManager`.
### Adding a substitute second Milestone in the correct position
1. Define the contributors, deadline, budget, and description for the substitute milestone.
2. Call `insertMilestoneAt()` with the specified parameters and the position of the original second milestone.
### Starting the new second milestone
1. Call `startNextMilestone()` on the `MilestoneManager`.
### Starting the third milestone without completing the second
1. Wait for the duration of the second milestone to finish to be able to start the third.