pragma solidity ^0.4.24; contract startUpFunding { //DATA FOR PROJECT struct projectIdeas { //we require idProjectIdea string ideaGoal; address projectWallet; //we do not need this here ? string ideaDescription; string ideaDetails; string votes; } struct projects { string projectName; address projectWallet; string projectGit; string projectWhitePaper; string projectHash; uint256 projectDeadLine; projectIdeas projIdeas ; // we need mapping here for idProjectIdea ? } mapping(uint => projects) projectId; /// Set project data /// input data example: 0001,"FirstProject",0xca35b7d915458ef540ade6068dfe2f44e8fa733c,"git link","WhitePaper link","hash",1534499073 /* //DATA FOR INVESTOR - investorWallet (used to return ether if project doesn't get funding) - investedIdea : struct - idProject - idProjectIdea - amount */ // PROJECT FUNCTIONS : begin function projectCreate(uint id, string projectName, address projectWallet, string projectGit, string projectWhitePaper, string projectHash, uint256 projectDeadLine) public returns(bool success) { projectId[id].projectName = projectName; projectId[id].projectWallet = projectWallet; projectId[id].projectGit = projectGit; projectId[id].projectWhitePaper = projectWhitePaper; projectId[id].projectHash = projectHash; projectId[id].projectDeadLine = projectDeadLine; return true; } /// input data example: 0001,"idea goal",0x14723a09acff6d2a60dcdf7aa4aff308fddc160c,"idea Description","idea Details","votes" function projectIdeaCreate(uint id, string ideaGoal, //address projectWallet, No need this here string ideaDescription, string ideaDetails, string votes) public returns(bool success) { projectId[id].projIdeas.ideaGoal = ideaGoal; //projectId[idProj].projIdeas[idProjIdea] ? we need new index for each project idea // projectId[id].projIdeas.projectWallet = projectWallet; No need this here projectId[id].projIdeas.ideaDescription = ideaDescription; projectId[id].projIdeas.ideaDetails = ideaDetails; projectId[id].projIdeas.votes = votes; return true; } /// Get project data function projectGet(uint id) public view returns( string projectName, address projectWallet, string projectGit, string projectWhitePaper, string projectHash, uint256 projectDeadLine) { return( projectId[id].projectName, projectId[id].projectWallet, projectId[id].projectGit, projectId[id].projectWhitePaper, projectId[id].projectHash, projectId[id].projectDeadLine //we need to call projectIdeas here when returning - also add the var type - struct ? ); } function projectIdeasGet(uint id) public view returns( //change this to private ? also projectIdeas should be array string ideaGoal, address projectWallet, string ideaDescription, string ideaDetails, string votes) { return( projectId[id].projIdeas.ideaGoal, //projectId[idProj].projIdeas[idProjIdea] ? we need new index for each project idea projectId[id].projIdeas.projectWallet, // not required? projectId[id].projIdeas.ideaDescription, projectId[id].projIdeas.ideaDetails, projectId[id].projIdeas.votes ); } /* :projectIsActive() return bool - check for "projectGoalDeadLine" :projectIdeaGoalReach() return bool - check "ideaGoal" amount :projectTransferFunds() return bool - requires :projectIdeaGoalReach() to be true - requires :projectIsActive(bool) to be false - transfer funds from investors to "projectWallet" - ends contract or :projectIsActive() is enought? */ // PROJECT FUNCTIONS : end // INVESTOR FUNCTIONS : begin /* :ideaInvest() returns bool - will add value (promise) to "investedIdea" - require check if :projectIsActive() & :projectIdeaGoalReach() :investorTotalBalanceCheck() returns float - check how much has invested in all project ideas "investedIdea" and return the total amount - cycle :investorProjectBalanceCheck() :investorProjectBalanceCheck() returns float - check how much has invested in all project ideas "investedIdea" and return the total amount */ // INVESTOR FUNCTIONS : end }
0.4.18