This contract implements a crowdfunding-style escrow system for real estate projects. It allows developers to create fundraising campaigns, receive contributions in ETH, and conditionally access funds depending on whether the funding goal is met before the deadline.
- Developers can create campaigns by providing a name, funding goal (in ETH), and deadline (timestamp).
- Each campaign is uniquely identified and tracked.
- Anyone can contribute ETH to a campaign before the deadline.
- Contributions are recorded per user and locked in escrow.
- Funds are held securely until the deadline.
- If the funding goal is met, only the campaign owner can release funds to themselves.
- If the funding goal is not met, contributors can individually claim refunds.
- Uses OpenZeppelin's
Ownable,Pausable, andReentrancyGuardcontracts:Ownablerestricts admin actions like pausing.Pausableallows emergency pause of contributions.ReentrancyGuardprotects against reentrancy in withdrawals/refunds.
- Follows
checks-effects-interactionspattern for fund handling.
CampaignCreatedContributionReceivedFundsReleasedRefundIssued
- ETH-only was used for simplicity, but the contract is modular and can be upgraded to support ERC20 tokens (e.g., USDC) for stablecoin-based funding.
- Funds are only released manually by the campaign owner (once eligible), giving flexibility for post-campaign compliance.
- Refunds are pull-based: users must actively claim, avoiding unintended gas consumption.
- All timestamps are based on
block.timestamp, assuming an honest miner majority. - Campaign owners are trusted to register only valid real estate campaigns; legal validation is assumed off-chain.
assetrix/
β βββ contracts/ β βββ Assetrix.sol # Main smart contract β βββ ARCHITECTURE.md # Architecture decisions β β βββ README.md # Design decisions and usage
This project is licensed under the MIT License - see the LICENSE file for details.
Mujeeb Sulayman
Blockchain Developer