FundItETC is an open-source, decentralized crowd funding platform under development for deployment on Ethereum Classic.
It was originally inspired by a JSMastery educational project by Adrian Hajdin to whom we express sincere gratitude.
In the spirit of open-source project development and in keeping with the Ethereum Classic Foundational Principles, this project is openly available for review and feedback. Your input and suggestions are welcomed and encouraged. Please submit your feedback via the Issues tab.
If you are interested in contributing to this or any of the other upcoming ValueForge projects, please see the information here.
The back-end for FundItETC is a suite of four Solidity smart contracts developed for deployment on the ETC network. It utilizes the OpenZeppelin Solidity contract library, thirdweb's Web3 and HardHat frameworks.
FundItETC will be accompanied by a JavaScript-based UI/UX application and HTML website which is expected to utilize the Tailwind CSS framework.
Here are the changes and explanations from the original JSMastery project's Solidity contract:
- Changed the Solidity version pragma to
^0.8.9, which allows for minor version updates to Solidity 0.8. - Added a
payablemodifier to theownerfield in theCampaignstruct to indicate that the owner can receive ether. - Added a
activefield to theCampaignstruct to indicate if the campaign is still active or has ended. - Removed the return value of the
createCampaignfunction since it was not being used. - Added more input validation to the
createCampaignfunction to ensure that required fields are not empty and values are greater than 0. - Removed the
numberOfCampaigns - 1return value from thecreateCampaignfunction since it was not necessary. - Changed the
getDonorsfunction to external and added theviewmodifier since it does not modify state. - Changed the
getDonorsfunction name togetCampaignDonorsfor clarity. - Changed the
getCampaignsfunction to two separate functions,getActiveCampaignsandgetEndedCampaigns, which list active and ended campaigns respectively. - Added input validation to the
donateToCampaignfunction to check that the campaign is active and has not ended before accepting donations. - Changed the
campaign.owner.callmethod tocampaign.owner.transferto simplify the payment process and reduce the risk of reentrancy attacks. - Changed the
getDonorsandgetCampaignsfunctions to return arrays ofCampaignstructs for consistency. - Changed the
getActiveCampaignsandgetEndedCampaignsfunctions to only return campaigns that are active or have ended, respectively. - Added an
endCampaignfunction to allow the campaign owner to end a campaign. - Added
ifundit.solinterface contract to define the functions that the proxy contract will use. - Added
funditproxy.solproxy contract to allow for the upgrade of the main contract without affecting the proxy contract. This is to be done by changing the address of the main contract in the proxy contract. - Changed all relevant functions to use the proxy contract instead of the main contract address.
- Added a
funditfolder to contain the main contract, proxy contract, and interface contract. - Moved
fundit,ifundit, andfunditproxycontracts to thecontracts/funditfolder. - Renamed contracts using MixedCase to
FundIt,IFundIt, andFundItProxy. - Added
FundItStoragecontract to separate logic from storage. - Added annotations to the
FundItcontract to explain the functions and variables. - Added import of OpenZeppelin's
Ownable,Pausable,ReentrancyGuard, andSafeMathcontracts. - Added function to receive and revert direct payment to the
FundItandFundItProxycontracts. - Changed the
createCampaignfunction to allow capping campaign duration. - Changed the
createCampaignfunction to usecalldatainstead ofmemoryfor gas efficiency. - Changed the
donateToCampaignfunction to allow donated funds to accumulate in the contract. - Added
withdrawFundsfunction to allow the campaign owner to withdraw funds from the contract. - Added
CampaignCreated,DonationMade,CampaignEnded, andWithdrawnevents to track state changes. - Set the initial maximum number of days a campaign may run at 180 days.
- Changed all relevant imported contracts to
Upgradeableversions using the transparent upgrade method.