explaingit

capminal/capminal-contracts

24SolidityAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

Open-source smart contracts for the Capminal protocol on Base blockchain, letting users stake $CAP tokens to earn rewards or convert them into daily AI compute credits.

Mindmap

mindmap
  root((capminal-contracts))
    Modules
      Cap Staking
      CAPU Vault
    Cap Staking
      Lock $CAP tokens
      Multiplier 1x to 5x
      Off-chain reward share
    CAPU Vault
      Stake $CAP for sCAP
      Lock sCAP for CAPU
      1 dollar per day AI credits
    Tech stack
      Solidity
      Foundry
      OpenZeppelin
      Base blockchain
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Deploy and interact with Cap Staking contracts to let $CAP holders lock tokens and earn proportional rewards based on lock duration

USE CASE 2

Convert $CAP into sCAP and then CAPU to grant yourself daily AI compute credits on the Capminal platform

USE CASE 3

Study the streaming reward distribution mechanism for a real-world upgradeable vault implementation in Solidity

USE CASE 4

Fork the monorepo structure as a starting point for a multi-module Foundry + OpenZeppelin smart contract project

Tech stack

SolidityFoundryOpenZeppelinBase blockchain

Getting it running

Difficulty · hard Time to first run · 1h+

Requires Foundry toolchain and familiarity with Base blockchain deployment, $CAP token interaction needs a funded wallet on Base mainnet.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This repository contains the open-source smart contracts for the Capminal protocol. Smart contracts are programs that run on a blockchain network and execute automatically according to their written rules. Capminal is built on the Base blockchain network and revolves around a token called $CAP. The repository has two main modules. The first is Cap Staking, which lets holders lock up their $CAP tokens for a chosen period of time. Longer lock durations earn a larger share of rewards, with a multiplier that ranges from 1x for short locks up to 5x for longer commitments. The actual reward distribution happens off-chain, with the on-chain contract tracking each person's share. The second module is the CAPU Vault, which introduces a two-step process to convert $CAP into AI compute credits. First, you stake $CAP and receive sCAP in return, a non-transferable receipt token that represents your locked position. Then you lock sCAP to mint CAPU, a compute asset that grants $1 per day of AI access credits on the Capminal platform. The contracts also distribute $CAP rewards to sCAP holders using a streaming mechanism. The vault contracts are designed to be upgradeable over time without redeploying. The project is organized as a monorepo where each module lives in its own folder with its own build configuration. Building and testing uses a Solidity development tool called Foundry. Dependencies come from well-known open-source libraries including OpenZeppelin. The $CAP token is already deployed on Base mainnet. The repository is published under the MIT license.

Copy-paste prompts

Prompt 1
I want to stake $CAP tokens using the Capminal staking contract. How do I call the lock function, and what multiplier will I get for a 90-day lock versus a 365-day lock?
Prompt 2
Walk me through the two-step process of converting $CAP into CAPU compute credits: how do I go from $CAP to sCAP to CAPU using these contracts?
Prompt 3
How are the Capminal contracts structured as a Foundry monorepo? Show me how to build and run the test suite for just the Cap Staking module.
Prompt 4
The CAPU Vault is designed to be upgradeable. How does the upgrade mechanism work in these contracts, and what do I need to do to propose an upgrade?
Open on GitHub → Explain another repo

← capminal on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.