# dapp-crowdfund-campaigns
Overview:
- The
CampaignIndex
component is the initial screen of the application, displaying a list of deployed campaigns. - It fetches the details of each campaign, including the campaign name and manager name.
Features:
- Displays a list of campaigns with their names, manager names, and a link to view each project.
- Provides a button to create a new project.
Overview:
- The
CampaignShow
component displays detailed information about a specific campaign, including its summary and a contribution form.
Features:
- Displays key information about the campaign, such as manager name, minimum contribution, balance, etc.
- Allows users to contribute to the campaign using the
ContributeForm
component. - Provides a button to view the spending requests associated with the campaign.
Overview:
- The
CampaignNew
component allows users to create a new campaign by providing details such as the project name, manager name, and minimum contribution.
Features:
- Form for users to input project details.
- Handles the creation of a new campaign through the factory contract.
Overview:
- The
RequestIndex
component displays a list of spending requests associated with a specific campaign.
Features:
- Lists all spending requests with details like ID, description, value, recipient, approvals, etc.
- Provides a button to add a new spending request.
Overview:
- The
RequestNew
component allows users to create a new spending request for a specific campaign.
Features:
- Form for users to input spending request details.
- Handles the creation of a new spending request through the
campaign
contract.
Overview:
- The
ContributeForm
component provides a form for users to contribute to a specific campaign.
Features:
- Form for users to input the amount they want to contribute.
- Handles the contribution through the
campaign
contract.
Overview:
- The
RequestRow
component represents a row in the table displaying spending requests in theRequestIndex
component.
Features:
- Displays details of a spending request, including ID, description, value, recipient, approvals, etc.
- Provides buttons to approve and finalize spending requests.
The Campaign Smart Contract is designed to facilitate crowdfunding campaigns on the Ethereum blockchain. It consists of two contracts: CampaignFactory
for creating new campaigns, and Campaign
for managing individual campaigns. This documentation provides a comprehensive overview of the contracts, their functionalities, and usage.
- Type:
address payable[] public
- Description: An array to store the addresses of all deployed campaigns.
- Parameters:
uint minimum
: Minimum contribution required to participate in the campaign.string memory name
: Name of the campaign.string memory managerName
: Name of the campaign manager.
- Description: Creates a new campaign with specified parameters and adds its address to
deployedCampaigns
.
- Returns:
address payable[] memory
: Array of addresses of all deployed campaigns.
- Description: Retrieves the array of deployed campaign addresses.
- Fields:
string description
: Description of the spending request.uint value
: Amount of Ether to be sent for the request.address recipient
: Address to receive the Ether.bool complete
: Indicates whether the request has been processed.uint approvalCount
: Number of approvals received.mapping(address => bool) approvals
: Mapping of approvers and their approval status.
- Type:
Request[] public
- Description: An array to store spending requests for the campaign.
- Type:
address public
- Description: Address of the campaign manager.
- Type:
string public
- Description: Name of the campaign manager.
- Type:
uint public
- Description: Minimum contribution required to become an approver.
- Type:
string public
- Description: Name of the campaign.
- Type:
mapping(address => bool) public
- Description: Mapping of addresses that have contributed to the campaign.
- Type:
uint public
- Description: Number of contributors to the campaign.
- Description: Ensures that the caller of a function is the campaign manager.
- Description: Allows users to contribute Ether to the campaign, becoming an approver.
- Parameters:
string memory description
: Description of the spending request.uint value
: Amount of Ether to be sent for the request.address recipient
: Address to receive the Ether.
- Description: Creates a spending request for the campaign.
- Parameters:
uint index
: Index of the spending request to be approved.
- Description: Allows approvers to vote in favor of a spending request.
- Parameters:
uint index
: Index of the spending request to be finalized.
- Description: Executes the spending request if approved by the majority of approvers.
- Returns:
uint
: Minimum contribution.uint
: Current balance of the campaign.uint
: Number of spending requests.uint
: Number of campaign approvers.address
: Address of the campaign manager.string memory
: Name of the campaign.string memory
: Name of the campaign manager.
- Description: Retrieves key details about the campaign.
- Returns:
uint
: Number of spending requests.
- Description: Retrieves the total number of spending requests in the campaign.
This documentation provides a comprehensive guide to the Campaign Smart Contract and its functionalities. Developers can use this information to understand and integrate the contract into their decentralized applications (DApps). If further clarification or assistance is required, please feel free to contact the contract developer.