Welcome to The-Matrix project! This repository contains a full-featured smart contract ecosystem built on the Hardhat framework.
The-Matrix project is designed to facilitate complex on-chain interactions with a suite of smart contracts and utilities. The ecosystem includes core contracts for token operations, various financial pools, vesting mechanisms, and comprehensive interface definitions. This repository exemplifies robust digital asset management using modern Solidity development practices, advanced testing setups, and integration with OpenZeppelin libraries.
The repository is structured into several key directories:
-
contracts/: Contains the Solidity source files. These include:
- Core Contracts:
Matrix.sol
: The central contract driving the ecosystem.Pills.sol
: Responsible for managing pill tokens or functionalities related to this metaphor.Source.sol
,StSource.sol
: Additional contracts managing asset flow within the ecosystem.Tracker.sol
: Implements tracking functionality for various operations.Vault.sol
: Manages secure storage and access control of tokens.vesting.sol
: Implements vesting schedules and token lock mechanisms.
- Core Contracts:
-
contracts/interfaces/: Contains interface definitions that ensure standardization and interoperability between contracts:
IBlast.sol
,IPills.sol
,ISource.sol
,ITracker.sol
-
contracts/pools/: Contains pool contracts tailored for different financial strategies and reward distributions:
PillPool.sol
,PrizePool.sol
,SecondaryPrizePool.sol
,SourcePool.sol
,YieldPool.sol
-
scripts/: Contains deployment scripts (
deploy.ts
) and other automation scripts for deploying the contracts on Ethereum-compatible networks. -
test/: Contains test suites written in TypeScript that interact with the smart contracts using Hardhat to validate functionality and resilience.
-
cache/: Used to store compiled Solidity cache files for faster recompilations.
-
typechain-types/: Contains TypeScript type definitions generated by TypeChain that facilitate Ethereum smart contract integration.
-
Other configuration files:
hardhat.config.ts
: Hardhat configuration file.tsconfig.json
: TypeScript configuration file.package.json
: Project dependencies and scripts.
The project incorporates several smart contracts written in Solidity that work together to form a cohesive ecosystem:
-
Matrix.sol: Acts as the central hub, orchestrating contract interactions and serving as the interface for external communications.
-
Pills.sol: Manages specialized tokens/metaphors associated with the project, potentially used for rewards or governance.
-
Source.sol & StSource.sol: Handle asset flow, ensuring secure and compliant management of resources.
-
Tracker.sol: Logs transactions and contract interactions to provide transparency and auditability.
-
Vault.sol: Implements secure storage and access controls for sensitive tokens and data.
-
vesting.sol: Distributes tokens gradually over time with vesting schedules to align long-term incentives.
Located in the contracts/interfaces/
directory, these Solidity interfaces ensure that contracts adhere to a standardized set of functions. They enhance interoperability and make it easier to manage contract dependencies.
The pool contracts in contracts/pools/
manage different financial strategies, including staking, prize distribution, and yield generation. Each pool contract caters to specific aspects of the ecosystem's financial operations:
-
PillPool.sol: Typically used for staking or incentivization mechanisms.
-
PrizePool.sol & SecondaryPrizePool.sol: Manage prize distributions and reward mechanisms.
-
SourcePool.sol & YieldPool.sol: Handle funding flows and yield generation for participants.
Deployment scripts, found in the scripts/
directory, are written in TypeScript and harness the capabilities of Hardhat. These scripts automate contract deployment, including initialization and post-deployment verifications.
The entire contract suite is rigorously tested using Hardhat and TypeScript. The tests, located in the test/
directory, cover unit tests, integration tests, and scenarios mimicking real-world blockchain interactions.
- Installation: Run
npm install
to install the dependencies. - Compilation: Compile the contracts using
npx hardhat compile
. - Testing: Execute tests via
npx hardhat test
. - Deployment: Deploy the project using deployment scripts like
npx hardhat run scripts/deploy.ts --network <your-network>
.
- Hardhat: A comprehensive Ethereum development environment that simplifies the process of compiling, deploying, and testing smart contracts.
- TypeChain: Generates TypeScript type definitions for Solidity contracts to ensure safer interactions between your contracts and TypeScript code.
- OpenZeppelin: Provides reliable and community-reviewed smart contract modules, particularly for security-critical components.
- TypeScript: Used extensively to enforce type safety in scripts and tests, enhancing productivity and maintainability.
To begin working with The-Matrix:
-
Clone the repository:
git clone https://github.com/k3rn3lpanicc/The-Matrix.git cd The-Matrix
-
Install all dependencies:
npm install
-
Compile the contracts:
npx hardhat compile
-
Run tests to verify contract functionalities:
npx hardhat test
-
Deploy the contracts to your selected network:
npx hardhat run scripts/deploy.ts --network <your-network>
We welcome contributions! To get started:
- Fork the repository.
- Create a new feature branch.
- Commit your improvements with clear messages.
- Open a Pull Request detailing your changes.
- Hardhat for its extensive developer tooling.
- TypeChain for bridging Solidity and TypeScript.
- OpenZeppelin for secure, well-audited smart contracts.
For any further questions or issues, please refer to the detailed internal documentation or open an issue on GitHub.