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
payable
modifier to theowner
field in theCampaign
struct to indicate that the owner can receive ether. - Added a
active
field to theCampaign
struct to indicate if the campaign is still active or has ended. - Removed the return value of the
createCampaign
function since it was not being used. - Added more input validation to the
createCampaign
function to ensure that required fields are not empty and values are greater than 0. - Removed the
numberOfCampaigns - 1
return value from thecreateCampaign
function since it was not necessary. - Changed the
getDonors
function to external and added theview
modifier since it does not modify state. - Changed the
getDonors
function name togetCampaignDonors
for clarity. - Changed the
getCampaigns
function to two separate functions,getActiveCampaigns
andgetEndedCampaigns
, which list active and ended campaigns respectively. - Added input validation to the
donateToCampaign
function to check that the campaign is active and has not ended before accepting donations. - Changed the
campaign.owner.call
method tocampaign.owner.transfer
to simplify the payment process and reduce the risk of reentrancy attacks. - Changed the
getDonors
andgetCampaigns
functions to return arrays ofCampaign
structs for consistency. - Changed the
getActiveCampaigns
andgetEndedCampaigns
functions to only return campaigns that are active or have ended, respectively. - Added an
endCampaign
function to allow the campaign owner to end a campaign. - Added
ifundit.sol
interface contract to define the functions that the proxy contract will use. - Added
funditproxy.sol
proxy 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
fundit
folder to contain the main contract, proxy contract, and interface contract. - Moved
fundit
,ifundit
, andfunditproxy
contracts to thecontracts/fundit
folder. - Renamed contracts using MixedCase to
FundIt
,IFundIt
, andFundItProxy
. - Added
FundItStorage
contract to separate logic from storage. - Added annotations to the
FundIt
contract to explain the functions and variables. - Added import of OpenZeppelin's
Ownable
,Pausable
,ReentrancyGuard
, andSafeMath
contracts. - Added function to receive and revert direct payment to the
FundIt
andFundItProxy
contracts. - Changed the
createCampaign
function to allow capping campaign duration. - Changed the
createCampaign
function to usecalldata
instead ofmemory
for gas efficiency. - Changed the
donateToCampaign
function to allow donated funds to accumulate in the contract. - Added
withdrawFunds
function to allow the campaign owner to withdraw funds from the contract. - Added
CampaignCreated
,DonationMade
,CampaignEnded
, andWithdrawn
events to track state changes. - Set the initial maximum number of days a campaign may run at 180 days.
- Changed all relevant imported contracts to
Upgradeable
versions using the transparent upgrade method.