My Code below ( Following an Online Course, absolute beginner here ^_^)

pragma solidity >=0.4.17 <0.7.0;

contract CampaignFactory{
    Campaign[] public deployedCampaigns;

    function createCampaign(uint minimum) public{
        Campaign newCampaign = new Campaign(minimum,msg.sender);


    function getDeployedCampaigns() public view returns ( Campaign[] memory) {
        return deployedCampaigns;

contract Campaign{

    struct Request {
        string description;
        uint value;
        address recipient;
        bool complete;
        uint approvalCount;
        mapping( address => bool ) approvals;


 Request[]  public requests;           
 address public manager;                     
 uint public minimumContribution;                      
 mapping( address => bool) public approvers;                       
 uint public contributersCount;                                         

    modifier restricted(){                       
        require(msg.sender == manager);                   

  // constructor************************************************  
    constructor(uint minimum,address creator) public {          
        manager = creator;
        minimumContribution = minimum;


    function contribute() public payable{
        require(msg.value > minimumContribution);

        approvers[msg.sender] = true;


    function createRequest(string memory description, uint value, address recipient ) public restricted() {
        Request memory newRequest = Request({
            description: description,
            value: value,
            recipient: recipient,
            complete: false,
            approvalCount: 0




    function approveRequest( uint index) public{
        Request storage request_index = requests[index];



        request_index.approvals[msg.sender] = true;



    function finalizeRequest(uint  index) public payable restricted {
        Request storage  request = requests[index];
        require(request.approvalCount > (contributersCount / 2));

        //address payable recipient = address(uint160(request.recipient));
        // above is one of the ways i got to know for implementation but sticking to the course 
        request.complete = true;



NO ERROR but NO transfer of ether (last two lines), tried in REMIX everything works fine, except no ether is transferred

A Beginner here, following an online course, making a DApp , also after compiling the contract through Compile.js, no build=> .json file is build, which i guess is because of faulty solidity contract above, works fine for the course instructor, i guess its because the code is outdated?

is there a solution for this or i have to find a alternative for this?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.