Smart Contracts
Technical documentation for DogWithCap smart contracts.
Contract Addresses
WicChain Testnet
DogWithCapStaking: 0x0EdA695A21E38C1953B80578fd84Ea4923Fe5D6c
WICC Token: 0xA7D3cc0c72B85B9143e9b12B6717a9218d3df6c5
Chain ID: 6689These are testnet addresses. Mainnet addresses will be different.
DogWithCapStaking Contract
The main staking contract handles all core platform functionality.
Key Features
- Permanent Staking: No unstake function, users earn perpetual interest
- Daily Interest: 0.2% per day (adjustable by admin)
- Milestone System: Bronze, Silver, Gold, Diamond achievements
- Vesting Rewards: Linear vesting with no cliff
- Referral Program: 5% commission on referred stakes
- Cross-Chain Cash Out: Bridge to Solana network
Core Functions
Staking
function stake(uint256 amount, address referrer)
external
returns (uint256 positionId)Creates a new staking position.
Parameters:
amount: Amount of WICC tokens to stakereferrer: Optional referrer address
Returns:
positionId: Unique identifier for the position
Requirements:
- Amount >= 100 WICC
- User must approve tokens first
- 60-second cooldown between actions
Claiming Interest
function claimPositionInterest(uint256 positionId)
external
returns (uint256 claimedAmount)Claims accumulated interest from a specific position.
Parameters:
positionId: ID of position to claim from
Returns:
claimedAmount: Amount of interest claimed
Bulk Claiming
function claimAllPositions() externalClaims interest from all active positions in a single transaction.
Referral Claims
function claimReferralRewards() externalClaims accumulated referral commission rewards.
Milestone Vesting
function claimMilestoneVesting(uint8[] calldata milestoneLevels)
externalClaims vested milestone bonuses.
Parameters:
milestoneLevels: Array of milestone levels to claim (1-4)
View Functions
Get User Info
function getUserInfo(address user)
external
view
returns (
uint256 totalStaked,
uint256 unclaimedReferralRewards,
uint256 totalPendingInterest,
uint256 totalVestingAmount,
uint256 totalClaimableVesting,
address referrer,
MilestoneLevel milestone,
uint256 totalPositions
)Get Position Details
function getPosition(address user, uint256 positionId)
external
view
returns (
uint256 amount,
uint256 claimedInterest,
uint256 pendingInterest,
uint256 startTime,
uint256 lastClaimTime,
uint256 stakingDays,
bool isActive
)Get Contract Stats
function getContractStats()
external
view
returns (
uint256 totalStaked,
uint256 totalUsers,
uint256 rewardPool,
uint256 totalPositions,
uint256 contractBalance,
uint256 totalInterestPaid,
uint256 totalReferralsPaid,
uint256 pendingCashOutAmount,
uint256 currentDailyRate
)Events
event PositionCreated(
address indexed user,
uint256 indexed positionId,
uint256 amount,
address indexed referrer,
uint256 timestamp
)
event PositionClaimed(
address indexed user,
uint256 indexed positionId,
uint256 interestClaimed,
uint256 totalClaimed,
uint256 paidDays,
uint256 timestamp
)
event MilestoneAchieved(
address indexed user,
MilestoneLevel indexed newLevel,
uint256 totalBonus,
uint256 vestingDuration,
uint256 timestamp
)
event ReferralReward(
address indexed referrer,
address indexed referee,
uint256 stakeAmount,
uint256 rewardAmount,
uint256 newTotalVolume,
uint256 timestamp
)Milestone Requirements
Bronze (Level 1)
minStakeAmount: 50,000,000,000 WICC (50B)
minReferralVolume: 250,000,000,000 WICC (250B)
totalBonus: 12,500,000,000 WICC (12.5B)
vestingDuration: 120 daysSilver (Level 2)
minStakeAmount: 150,000,000,000 WICC (150B)
minReferralVolume: 750,000,000,000 WICC (750B)
totalBonus: 60,000,000,000 WICC (60B)
vestingDuration: 90 daysGold (Level 3)
minStakeAmount: 250,000,000,000 WICC (250B)
minReferralVolume: 1,250,000,000,000 WICC (1.25T)
totalBonus: 125,000,000,000 WICC (125B)
vestingDuration: 60 daysDiamond (Level 4)
minStakeAmount: 500,000,000,000 WICC (500B)
minReferralVolume: 2,500,000,000,000 WICC (2.5T)
totalBonus: 325,000,000,000 WICC (325B)
vestingDuration: 30 daysSecurity Features
Access Control
import "@openzeppelin/contracts/access/Ownable.sol"Owner-only functions:
setDailyInterestRate()depositRewards()updateMilestoneRequirement()pause()/unpause()markCashOutProcessed()refundCashOut()
Reentrancy Protection
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"All state-changing functions use nonReentrant modifier.
Pausable
import "@openzeppelin/contracts/security/Pausable.sol"Emergency pause mechanism for all user-facing functions.
Rate Limiting
modifier rateLimited() {
require(
block.timestamp >= lastActionTime[msg.sender] + CLAIM_COOLDOWN,
"Cooldown active"
);
_;
lastActionTime[msg.sender] = block.timestamp;
}60-second cooldown between actions prevents spam.
Token Economics
Interest Distribution
totalStaked: Sum of all active positions
rewardPool: Available funds for interest payments
contractBalance: Total tokens in contract
Available for rewards = contractBalance - totalStaked - reservedForCashOutReferral Economics
Referral Rate: 5% (REFERRAL_RATE = 5000 basis points)
Commission = stakeAmount * 5%
Paid from platform reservesVesting Economics
Milestone bonuses use linear vesting with no cliff:
Daily Vesting Rate = totalBonus / vestingDurationDays
Claimable = (elapsed days × daily rate) - claimed amountIntegration Guide
Web3 Setup
import { createPublicClient, createWalletClient } from 'viem';
import { wicchain } from 'viem/chains';
const publicClient = createPublicClient({
chain: wicchain,
transport: http('https://testnet-rpc.wicchain.com')
});Contract Interaction
import { CONTRACT_ADDRESSES } from '@/lib/contracts';
import STAKING_ABI from './DogWithCapStaking.json';
// Read contract
const userInfo = await publicClient.readContract({
address: CONTRACT_ADDRESSES.DogWithCapStaking,
abi: STAKING_ABI,
functionName: 'getUserInfo',
args: [userAddress]
});
// Write contract
const { hash } = await walletClient.writeContract({
address: CONTRACT_ADDRESSES.DogWithCapStaking,
abi: STAKING_ABI,
functionName: 'stake',
args: [amount, referrerAddress]
});Audit Information
Smart contract audit reports will be published here once completed.
Audit Scope
- Core staking functionality
- Vesting mechanisms
- Referral system
- Access control
- Emergency functions
Known Issues
Currently no known critical issues. All findings from internal review have been addressed.
Source Code
View the complete source code:
Next Steps
- 📖 API Reference - Backend API documentation
- 🔧 Integration Guide - Build on DogWithCap
- 📊 Contract Events - Event specifications