
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
@juicedollar/jusd
Advanced tools
JuiceDollar (JUSD) - Oracle-free, Bitcoin-collateralized stablecoin on Citrea. Decentralized minting with democratic governance.
An oracle-free, collateralized stablecoin forked from dEURO
This repository contains the smart contracts for JuiceDollar (JUSD), a decentralized stablecoin system with native protocol shares (JUICE).
Links:
All source code is located in the contracts folder.
| Contract | Description |
|---|---|
| JuiceDollar.sol | The JUSD ERC20 stablecoin token |
| Equity.sol | The JUICE ERC20 token (Juice Protocol) |
| Leadrate.sol | Leading interest rate module for the system |
| Contract | Description |
|---|---|
| MintingHub.sol | Oracle-free collateralized minting system |
| Position.sol | Individual collateralized loan position |
| PositionFactory.sol | Factory to create new positions |
| PositionRoller.sol | Roll positions into new ones |
| Contract | Description |
|---|---|
| Savings.sol | Interest distribution to JUSD holders |
| SavingsVaultJUSD.sol | ERC4626 vault for JUSD savings |
| StablecoinBridge.sol | 1:1 swaps with external stablecoins (StartUSD for bootstrap) |
| Contract | Description |
|---|---|
| FrontendGateway.sol | Rewards frontend providers for referrals |
| MintingHubGateway.sol | Minting with frontend provider rewards |
| SavingsGateway.sol | Savings with frontend provider rewards |
| CoinLendingGateway.sol | Native coin (cBTC) lending with custom liquidation |
JuiceDollar is part of a three-generation fork chain:
Frankencoin-ZCHF (Original)
↓
d-EURO (December 2024 fork)
↓
JuiceDollar (Current repository)
Upstream: d-EURO/smartContracts
Origin: Frankencoin-ZCHF/FrankenCoin
Deployment Networks:
d-EURO forked from Frankencoin at commit a2ce625 (December 2, 2024), introducing significant protocol improvements. JuiceDollar continues this evolution with deployment on Citrea, using cBTC as the native currency.
JuiceDollar inherits security audits from its upstream repositories:
| Date | Auditor | Report |
|---|---|---|
| 2023-02-10 | Blockbite | Report |
| 2023-06-09 | Code4rena | Report |
| 2023-10-30 | ChainSecurity | Report |
| 2024-09-25 | Decurity | Report |
| 2024-11-28 | ChainSecurity | Report |
| Auditor | Scope | Report |
|---|---|---|
| ChainSecurity | dEURO fork changes (Interest Accrual, Auction, Accounting) | Audit |
| Audit Boutique | dEURO smart contracts | Report PDF |
yarn install
Create a .env file (see .env.example):
# Required: Deployer wallet private key
DEPLOYER_PRIVATE_KEY=your_private_key_here
# Optional: For contract verification on Citrea explorer
# CITREA_EXPLORER_API_KEY=your_api_key_here
yarn run compile
yarn run test # Run all tests
yarn run test test/TESTSCRIPT.ts # Run specific test
yarn run coverage # Generate coverage report
npx tsc-watch --onCompilationComplete "npx hardhat test ./test/RollerTests.ts"
Deploy to Citrea Testnet:
hh deploy --network citreaTestnet --tags MockTokens
hh deploy --network citreaTestnet --tags JuiceDollar
hh deploy --network citreaTestnet --tags PositionFactory
hh deploy --network citreaTestnet --tags MintingHub
hh deploy --network citreaTestnet --tags positions
Testing on local fork:
# Set USE_FORK=true in .env, then:
npx hardhat node
NOTE: The bootstrap bridge (StartUSD → JUSD) is deployed automatically via deployProtocol.ts
For additional bridges:
# 1. Add bridge config to scripts/deployment/config/stablecoinBridgeConfig.ts
# 2. Deploy using BRIDGE_KEY environment variable:
BRIDGE_KEY=<KEY> npx hardhat run scripts/deployment/deploy/deployBridge.ts --network citrea
# Test on forked network
USE_FORK=true BRIDGE_KEY=<KEY> npx hardhat run scripts/deployment/deploy/deployBridge.ts --network hardhat
Bridge configurations: scripts/deployment/config/stablecoinBridgeConfig.ts
@juicedollar/jusd1.0.0 (see package.json)# 1. Login to NPM
npm login
# 2. Publish (build happens automatically via prepublishOnly)
yarn run publish
# 1. Update contracts (if changed)
# Edit contracts, then export ABIs:
yarn run ts:export:abis
# 2. Update version in package.json (semantic versioning)
# Patch: 1.0.0 → 1.0.1 (bug fixes)
# Minor: 1.0.0 → 1.1.0 (new features)
# Major: 1.0.0 → 2.0.0 (breaking changes)
# 3. Commit changes
git add . && git commit -m "Release v1.0.1: Description"
# 4. Publish (build happens automatically)
yarn run publish
Note: The prepublishOnly script automatically runs yarn run build before publishing.
TypeScript ABIs (exports/abis/):
export const JuiceDollarABI = [...] as const;
Address Config (exports/address.config.ts):
export const ADDRESS: Record<number, ChainAddress> = {
[citrea.id]: { juiceDollar: '0x...', equity: '0x...' }
};
Invariant/stateful fuzzing tests verify system integrity under random operations.
Location: foundry-test/invariant/
Invariants.t.sol - Defines system invariantsHandler.t.sol - Defines random actionsConfiguration: foundry.toml
Remappings: remappings.txt
# Install Foundry: https://book.getfoundry.sh/
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Install dependencies
forge install
# Clean artifacts
forge clean
# Run tests
forge test
# Verbose output (filter noise)
forge test -vvv | grep -v "Bound result"
# Show progress
forge test --show-progress
# Re-run failed test (enable snapshots in foundry.toml)
forge test --rerun
Set in foundry.toml:
[invariant]
fail_on_revert = true
MIT License - See LICENSE file
Copyright (c) 2024 DistributedCollective
This project is a fork of d-EURO, which itself is a fork of Frankencoin-ZCHF.
For contribution guidelines, please open an issue in this repository or refer to the upstream dEURO repository.
Built with ❤️ by the JuiceDollar team
FAQs
JuiceDollar (JUSD) - Oracle-free, Bitcoin-collateralized stablecoin on Citrea. Decentralized minting with democratic governance.
The npm package @juicedollar/jusd receives a total of 949 weekly downloads. As such, @juicedollar/jusd popularity was classified as not popular.
We found that @juicedollar/jusd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.