
Resupply Architecture
- 1 installs
- Updated February 9, 2026
- cyotee/resupply-skill
Design and implement supply chain and resource management APIs.
About
Resupply-architecture provides backend patterns for supply chain and inventory systems. Developers use it to design scalable APIs for resource allocation and logistics.
- Supply chain API patterns and best practices
- Resource management and inventory architecture
Resupply Architecture by the numbers
- 1 all-time installs (skills.sh)
- Ranked #3,836 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Jul 8, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cyotee/resupply-skill --skill resupply-architectureAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| Last updated | February 9, 2026 |
| Repository | cyotee/resupply-skill ↗ |
What it does
Design and implement supply chain and resource management APIs.
Files
Resupply Protocol Architecture
Resupply is a CDP-based (Collateralized Debt Position) stablecoin lending protocol enabling users to borrow reUSD stablecoins against ERC4626 vault tokens as collateral. The protocol integrates with Curve Lend, Frax Lend, Convex, and Yearn for yield-bearing collateral support.
Core Components
Core Contract (/src/dao/Core.sol)
The central authority contract managing system-wide configuration:
// Key state variables
address public feeReceiver; // Protocol fee recipient
uint256 public epochLength; // Default: 1 week (604800 seconds)
uint256 public startTime; // Protocol start timestamp
// Operator management
mapping(address operator => bool isEnabled) public operatorPermissions;
mapping(address operator => IAuthHook hook) public authHooks;Key functions:
execute(address target, bytes calldata data)- Execute calls through Core with operator permissionssetOperatorPermissions(address operator, bool enabled)- Enable/disable operatorssetAuthHook(address operator, IAuthHook hook)- Set pre/post execution hooks
ResupplyRegistry (/src/protocol/ResupplyRegistry.sol)
Single source of truth for all protocol addresses and deployed pairs:
// Registry mappings
address[] public pairs; // All deployed lending pairs
mapping(address => bool) public isPair; // Pair validation
mapping(bytes32 => address) public coreHandlers; // Named component lookup
// Core handler keys
bytes32 constant PAIR_DEPLOYER = keccak256("PAIR_DEPLOYER");
bytes32 constant LIQUIDATION_HANDLER = keccak256("LIQUIDATION_HANDLER");
bytes32 constant REDEMPTION_HANDLER = keccak256("REDEMPTION_HANDLER");
bytes32 constant REWARD_HANDLER = keccak256("REWARD_HANDLER");
bytes32 constant INSURANCE_POOL = keccak256("INSURANCE_POOL");Registry access pattern:
address deployer = registry.coreHandlers(PAIR_DEPLOYER);
address[] memory allPairs = registry.getAllPairs();
bool valid = registry.isPair(pairAddress);Operator Pattern
Operators are authorized contracts that can execute privileged actions through Core:
| Operator | Purpose |
|---|---|
Guardian | Emergency pause, access control |
TreasuryManager | Treasury fund management |
BorrowLimitController | Dynamic borrow limit adjustments |
PairAdder | Adding new lending pairs |
EmissionsController | Governance token emissions |
Auth Hook Pattern:
interface IAuthHook {
function canCall(address caller, address target, bytes4 selector) external view returns (bool);
function preHook(address caller, address target, bytes calldata data) external;
function postHook(address caller, address target, bytes calldata data, bytes calldata result) external;
}Token Architecture
reUSD Stablecoin (/src/protocol/Stablecoin.sol)
The protocol's native stablecoin with controlled minting:
// LayerZero OFT for cross-chain support
contract Stablecoin is OFT {
address public minter; // Only minter can mint/burn
function mint(address account, uint256 amount) external;
function burn(address account, uint256 amount) external;
}RSUP Governance Token (/src/dao/GovToken.sol)
Governance token for protocol voting and staking rewards:
contract GovToken is OFT {
address public minter;
uint256 public maxMintable; // Capped supply
}Precision Constants
All contracts use consistent precision values:
uint256 constant LTV_PRECISION = 1e5; // Loan-to-value ratios (95% = 95_000)
uint256 constant EXCHANGE_PRECISION = 1e18; // Exchange rates
uint256 constant RATE_PRECISION = 1e18; // Interest rates per second
uint256 constant PAIR_DECIMALS = 1e18; // Token decimals assumptionEpoch System
The protocol operates on weekly epochs for reward distribution and governance:
uint256 constant EPOCH_LENGTH = 604800; // 1 week in seconds
function getEpoch() public view returns (uint256) {
return (block.timestamp - startTime) / epochLength;
}Integration Points
Resupply integrates with external protocols through pair deployers:
- Curve Lend:
CurveLendMinterFactory,CurveLendOperator - Frax Lend: Frax lending pair configurations
- Convex: CRV/CVX reward routing
- LayerZero: Cross-chain token bridging (OFT standard)
Additional Resources
For a complete list of all protocol contracts with paths, see `references/contracts.md`.
Resupply Contract Reference
Complete list of Resupply protocol contracts organized by category.
Core Infrastructure
| Contract | Path | Description |
|---|---|---|
| Core | /src/dao/Core.sol | Central authority, operator permissions |
| ResupplyRegistry | /src/protocol/ResupplyRegistry.sol | Protocol address registry |
Token Contracts
| Contract | Path | Description |
|---|---|---|
| Stablecoin | /src/protocol/Stablecoin.sol | reUSD token (OFT) |
| GovToken | /src/dao/GovToken.sol | RSUP governance token (OFT) |
Lending System
| Contract | Path | Description |
|---|---|---|
| ResupplyPair | /src/protocol/ResupplyPair.sol | Lending pair implementation |
| ResupplyPairCore | /src/protocol/pair/ResupplyPairCore.sol | Core lending logic |
| ResupplyPairDeployer | /src/protocol/ResupplyPairDeployer.sol | Pair factory |
Risk Management
| Contract | Path | Description |
|---|---|---|
| LiquidationHandler | /src/protocol/LiquidationHandler.sol | Liquidation processing |
| RedemptionHandler | /src/protocol/RedemptionHandler.sol | Collateral redemption |
| InsurancePool | /src/protocol/InsurancePool.sol | Bad debt coverage (reIP) |
Interest & Oracles
| Contract | Path | Description |
|---|---|---|
| InterestRateCalculator | /src/protocol/InterestRateCalculator.sol | Interest rate model |
| InterestRateCalculatorV2 | /src/protocol/InterestRateCalculatorV2.sol | Updated rate model |
| BasicVaultOracle | /src/protocol/BasicVaultOracle.sol | ERC4626 price oracle |
| UnderlyingOracle | /src/protocol/UnderlyingOracle.sol | Underlying asset prices |
Reward Distribution
| Contract | Path | Description |
|---|---|---|
| RewardHandler | /src/protocol/RewardHandler.sol | Central reward distribution |
| RewardDistributorMultiEpoch | /src/protocol/RewardDistributorMultiEpoch.sol | Multi-epoch reward tracking |
| MultiRewardsDistributor | /src/dao/staking/MultiRewardsDistributor.sol | Multi-token rewards |
Governance & Staking
| Contract | Path | Description |
|---|---|---|
| Voter | /src/dao/Voter.sol | DAO voting |
| GovStaker | /src/dao/staking/GovStaker.sol | RSUP staking |
| GovStakerEscrow | /src/dao/staking/GovStakerEscrow.sol | Locked staking |
DAO Operators
| Contract | Path | Description |
|---|---|---|
| Guardian | /src/dao/operators/Guardian.sol | Emergency controls |
| TreasuryManager | /src/dao/operators/TreasuryManager.sol | Treasury management |
| BorrowLimitController | /src/dao/operators/BorrowLimitController.sol | Borrow limits |
| PairAdder | /src/dao/operators/PairAdder.sol | Pair management |
Token Generation & Vesting
| Contract | Path | Description |
|---|---|---|
| VestManager | /src/dao/tge/VestManager.sol | Vesting management |
| VestManagerBase | /src/dao/tge/VestManagerBase.sol | Vesting base |
| PermaStaker | /src/dao/tge/PermaStaker.sol | Permanent staking |
| EmissionsController | /src/dao/emissions/EmissionsController.sol | Token emissions |
External Integrations
| Contract | Path | Description |
|---|---|---|
| CurveLendMinterFactory | /src/protocol/integrations/ | Curve Lend integration |
| CurveLendOperator | /src/protocol/integrations/ | Curve Lend operations |
Interfaces
Key interfaces for integration:
IResupplyPair- Lending pair interfaceICore- Core contract interfaceIResupplyRegistry- Registry interfaceIStablecoin- Stablecoin interfaceIGovStaker- Staking interfaceIVoter- Governance interfaceIRewardHandler- Rewards interfaceIInsurancePool- Insurance interface
Registry Handler Keys
bytes32 constant PAIR_DEPLOYER = keccak256("PAIR_DEPLOYER");
bytes32 constant LIQUIDATION_HANDLER = keccak256("LIQUIDATION_HANDLER");
bytes32 constant REDEMPTION_HANDLER = keccak256("REDEMPTION_HANDLER");
bytes32 constant REWARD_HANDLER = keccak256("REWARD_HANDLER");
bytes32 constant INSURANCE_POOL = keccak256("INSURANCE_POOL");
bytes32 constant GOV_STAKER = keccak256("GOV_STAKER");
bytes32 constant VOTER = keccak256("VOTER");