This document provides deep technical analysis of SHELTR’s blockchain implementation, smart contract architecture, and security protocols. Designed for developers, blockchain engineers, and security auditors.
SHELTR implements the world’s first dual-token charitable ecosystem on Base network, combining participant protection through SHELTR-S (stable token) with community governance via SHELTR (growth token). Our revolutionary architecture ensures 85% of donations reach participants as stable value, 10% funds housing solutions, and 5% supports the participant's registered shelter operations through smart contract-governed fund allocation.
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; contract SHELTRCore is AccessControl, ReentrancyGuard, Pausable { // Distribution constants (immutable for security) uint256 public constant DIRECT_SUPPORT = 85; uint256 public constant HOUSING_FUND = 10; uint256 public constant SHELTER_OPERATIONS = 5; // Participant-shelter mapping for 5% allocation mapping(address => address) public participantShelter; uint256 public constant WELCOME_BONUS = 100 * 1e18; // 100 SHELTR-S function processDonation( address donor, address participant, uint256 amount ) external onlyRole(DISTRIBUTOR_ROLE) nonReentrant whenNotPaused { uint256 directSupport = (amount * DIRECT_SUPPORT) / 100; uint256 housingContribution = (amount * HOUSING_FUND) / 100; uint256 shelterOperations = (amount * SHELTER_OPERATIONS) / 100; // Mint SHELTR-S tokens for participant (1:1 with USDC) ISheltrStable(address(sheltrStable)).mint(participant, directSupport); // Handle 5% allocation: shelter ops or additional housing fund if (participantShelter[participant] != address(0)) { IERC20(usdc).transfer(participantShelter[participant], shelterOperations); } else { housingContribution += shelterOperations; // Add to housing fund } emit DonationProcessed(donor, participant, amount, directSupport, housingContribution); } }
If participant is not registered through a shelter, the 5% shelter allocation is automatically redirected to their individual housing fund account, ensuring 100% efficiency regardless of onboarding path.
const BASE_CONFIG = { network: 'base-mainnet', chainId: 8453, rpcUrl: 'https://mainnet.base.org', blockTime: 2, // seconds contracts: { sheltrCore: '0x...', sheltrStable: '0x...', sheltrGrowth: '0x...', usdcReserve: '0xa0b86a33e6...' } };