This directory contains the contracts for the Eyeseek crowdfunding system. Created with Hardhat.
Eyeseek is using Diamond multi-facet proxy architecture.
The architecture is slightly more complex to absorb then regular Solidity patterns, but come with huge benefits:
- Extended contract size and functionality
- Upgradability
- Separation of logical layer and storage layer
git clone https://github.com/Eyeseek-org/diamond
npm install
Env variables contain blockchain explorer API keys to verify contracts
Deploying
- In
./scripts/deploy.ts
make sure to update the values ofUSDC_ADDRESS
andUSDT_ADDRESS
to the correct addresses for the network being deployed to. - Run the deploy script with
npx hardhat run scripts/deploy.ts --network {NETWORK}
This will initialize the initial diamond with the following facets:DiamondCutFacet
- facet to add/remove facetsDiamondLoupeFacet
- facet to query diamond infoOwnershipFacet
- facet to transfer ownership of the diamondMasterFacet
- the main facet that contains the logic across the appRewardFacet
- the facet that contains the logic for the reward system - Create rewardFundFacet
- the facet that contains the logic for the funding system - Create new project, Display project info, Return microfund balances
Contract functions cannot be interacted via classic blockchain explorers like etherscan, Louper is needed to use on any network for
- Quick contract testing
- Exporting abi for the frontend
Upgrading
- Upgrade the diamond
In
./scripts/upgrade.ts
edit the values ofDIAMOND_ADDRESS
,FUNCTIONS_TO_REMOVE
andFUNCTIONS_TO_ADD
to correctly list what should be removed and what should be added. Then run the upgrade script withnpx hardhat run ./scripts/upgrade.ts --network {NETWORK}
.
References Awesome Diamonds