Timelock System
The timelock creates a mandatory waiting period between initiating and completing a withdrawal.
How It Works
Initiate Withdrawal
User requests withdrawal from Social Vault
Timelock Starts
Request enters pending state with countdown
Guardian Notification
All 5 Guardians receive push notification
Approval Period
3/5 Guardians must approve before timelock expires
Release
After timelock + approvals, funds are released
Timelock Durations
| Withdrawal Amount | Timelock Period |
|---|
| < $100 | 24 hours |
| 100−500 | 36 hours |
| 500−1,000 | 48 hours |
| 1,000−5,000 | 60 hours |
| > $5,000 | 72 hours |
Cancellation
Withdrawals can be cancelled during the timelock:
- By user: Cancel anytime before release
- By Guardian: Any Guardian can cancel
- Automatic: If 2+ Guardians flag as suspicious
// Cancellation scenarios
const withdrawal = {
amount: 500,
timelock: 48, // hours
status: 'PENDING',
approvals: 1,
flags: 0
};
// User cancels
withdrawal.status = 'CANCELLED_BY_USER';
// Guardian cancels
withdrawal.status = 'CANCELLED_BY_GUARDIAN';
// Automatic cancellation (2+ flags)
if (withdrawal.flags >= 2) {
withdrawal.status = 'CANCELLED_SUSPICIOUS';
}
Emergency Bypass
There is intentionally NO emergency bypass. This is by design to prevent coerced “emergency” transfers.
If you need immediate access to funds:
- Keep everyday spending in your regular wallet
- Only store long-term holdings in Social Vault
- Plan withdrawals in advance
Smart Contract Implementation
// SocialVault.sol (simplified)
struct Withdrawal {
address recipient;
uint256 amount;
uint256 initiatedAt;
uint256 timelockEnd;
uint8 approvals;
bool executed;
}
function initiateWithdrawal(uint256 amount) external {
uint256 timelock = calculateTimelock(amount);
withdrawals[withdrawalCount++] = Withdrawal({
recipient: msg.sender,
amount: amount,
initiatedAt: block.timestamp,
timelockEnd: block.timestamp + timelock,
approvals: 0,
executed: false
});
emit WithdrawalInitiated(msg.sender, amount, timelock);
}
function calculateTimelock(uint256 amount) internal pure returns (uint256) {
if (amount < 100e6) return 24 hours;
if (amount < 1000e6) return 48 hours;
return 72 hours;
}
View Contract
Full Social Vault contract documentation