Company: Merehead
Role: Senior Solidity Developer
Stack: Solidity · ERC-20 · AccessControl · ReentrancyGuard · Truffle
Period: 06/2021 - 12/2021
Architected and implemented a decentralized project management and payment protocol enabling transparent, milestone-driven collaboration between initiators, contributors, and observers. The system enforces payment terms on-chain, eliminating intermediaries and payment disputes in remote, project-based work.
approveProjects(), createPackages(), getMgps(), getBonuses(), getObserverFees()bonusScore / 1e6 ratio for fair bonus distributionTokenFactory for deploying fresh IOUToken contracts| Decision | Rationale |
|---|---|
| Library-based contract architecture | Business logic in ProjectLibrary, PackageLibrary, CollaboratorLibrary enables independent testing and reuse |
| Collision-resistant ID generation | keccak256(msg.sender + blockhash(block.number - 1) + nonce) provides unpredictable IDs without counters, reduces front-running |
| Triple-nested mapping state | collaboratorData[projectId][packageId][address] enables O(1) lookups and clean deletion across thousands of concurrent projects |
| Reentrancy-safe payment claims | All six claim functions guarded with nonReentrant modifier + SafeERC20 transfers |
| Cascading budget validation | Rejecting a collaborator auto-refunds their MGP allocation back up the chain, preventing budget leaks |
Libraries mutate storage directly via reference, not return values. ProjectLibrary, PackageLibrary, and CollaboratorLibrary receive storage pointers to their respective structs. Mutations are applied in-place inside the library, keeping the main ReBakedDAO contract a thin router with no logic of its own - each library can be tested independently against isolated storage fixtures.
Cascading budget refund is automatic, not explicit. When a collaborator is rejected, their MGP allocation is returned up the full hierarchy: collaborator slot cleared → package budget restored → project budget incremented. This happens in one call with no separate cleanup transaction, preventing budget fragmentation across hundreds of concurrent packages.
See Merehead page for additional context.