# Proposed SOW: PyFi <> Hypotenuse Labs
Document outlines a proposed Scope of Work (SOW) including timelines, outcomes and compensation structure for a collaboration between Hypotenuse Labs (the Consultant) and PyFi Labs (the Company).
Engagement: [ INSERT TIME]
Fee Structure: [INSERT]
### Phase: R&D
##### Milestone I: Research
Activities
* Conduct research on competing DeFi protocols architectures (eg. Lido, Whales, Ondo, Pendle)
* Research and advise core team on indexing platforms, APIs essential for the project's full-stack implementation
* Collaborate with core team to produce diagrams illustrating the flow of money and step processes
Outcome: Technical Architecture Proposal
##### Milestone II: Smart Contract Design & Development
Activities
* Architecture diagram for minting module and marketplace system
* Architecture diagram for StakeWise vault forks
* Define solidity version and tooling stack
* Define all modules (eg. Controller, Factory)
* Define an ABI including storage, functions, events
* Generate pseudocode logic for each function and collaborate with core team members to verify correctness
* Develop ERC-20 compliant minting/redemption contracts for the LSB tokens used within the protocol (P and Y tokens)
* Develop a P2P CLOB engine contract to track bid and ask orders
Outcome: Production-grade smart contracts for Vaults, minter and Seaport marketplace
##### Milestone III: Frontend Development & Support
Activities
* Project setup (React, Next, wagmi, viem.sh) to support blur.io features
* Design implemenation, take high fidelity mockups from design team and create functional components including styling and state management
* API integration (with custom Pye backend)
* SEO and performance optimization
* Testing: unit testing, integration testing, end-to-end testing
* Deployment
* Post-launch support, integration of new tokens, validators and features for end users
Outcome: Vercel-based frontend with blur.io parity, PT support post-launch
##### Milestone IV: Testing and QA
Activities
* Define invariants for mutational functions
* Testing using both automated testing frameworks and manual testing procedures
* Deploy smart contracts on a testnet for initial testing and debugging
* Conduct user acceptance test (UAT) with core team
* Provide comprehensive documentation for smart contract functionalities, including deployment instructions, API documentation, and user guides.
Outcome: Technical Docs (eg. docs.pye.fi)
##### Milestone V: Security Audits
Activities
* Perform thorough review of SC, identifying common vulnerabilities (e.g., reentrancy, integer overflow/underflow, access control issues).
* Use automated security analysis tools (e.g., MythX, Slither, Oyente) to identify potential vulnerabilities.
* Conduct manual testing to identify vulnerabilities that automated tools might miss.
* Collaborate with wardens and securitiy firms to patch vulnerabilities and ensure adherence to best practices in smart contract development.
* Setup workflows for monitoring and incident response planning.
Outcome: Patch vulnerability findings in contests, bounties and security firm engagements. In addition to monitoring tools for tracking SC activit
Outcome: Technical Docs (eg. docs.pye.fi)
##### Milestone VI: Technical Paper
Activities
* Identify and formally define the types of market mechanisms and auctions being employed (eg. CLOB with GTC, FOK order types)
* Collaborate with core team to produce basic Python backtest
* Collaborate with core team on a public facing technical paper explaining our market mechanisms
Outcome: Technical Paper
### Final Deliverable
A widget and a marketplace that will allow users to stake, redeem and sell their pT and yT on three blockchains.