gitmyhub

capminal-contracts

Solidity ★ 101 updated 17d ago

Capminal Smart Contracts Repository

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.

SolidityFoundryOpenZeppelinBase blockchainsetup: hardcomplexity 4/5

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.

Where it fits