The DiscretePayoutVault is a Solidity-based smart contract for managing deposits, minting shares, and distributing proceeds proportionally to users' shareholdings. This contract is designed to handle discrete (non-continuous) payouts, ensuring a fair and transparent mechanism for proceeds distribution.
- Deposit & Withdrawal: Users can deposit USD tokens into the vault and receive an equivalent amount of shares at a 1:1 ratio. Shares represent their stake in the vault.
- Discrete Proceeds Distribution: Proceeds can be distributed to all shareholders proportionally, based on their shareholdings at the time of distribution.
- Claim Proceeds: Users can claim their share of the distributed proceeds at any time.
- Multi-Round Proceeds: The contract supports multiple rounds of proceeds distribution, ensuring non-dilution of the proceeds.
- Users deposit USD tokens into the vault, receiving a 1:1 equivalent in shares.
- Proceeds (e.g., profits or rewards) are distributed by the vault owner to all shareholders proportionally to their holdings at the time of distribution.
- Users can claim their share of the distributed proceeds at any time.
- Users can withdraw their initial deposit along with any unclaimed proceeds.
- UsdToken: A mock ERC20 token used for testing purposes.
- DiscretePayoutVault: The main contract that manages deposits, proceeds distribution, and withdrawals.
-
Clone the repository and navigate to the project directory:
git clone <repository-url> cd <project-directory>
-
Install dependencies using Foundry:
forge install
-
Compile the smart contracts:
forge build
The project uses Foundry for testing. The test suite is located in the test directory and includes comprehensive test cases for all functionalities of the DiscretePayoutVault.
To run the tests:
forge test
This project is licensed under the MIT License. See the LICENSE file for more details.