π οΈ How We Built the $TASK Presale Dapp on Base
When we set out to build TaskForce β a 0% fee Web3 platform for freelancers β we knew we needed more than a whitepaper. We needed a working product. The first step: building a secure, transparent, and fully on-chain presale for our native token, $TASK.
Hereβs how we built and deployed our presale Dapp β live now on Base Mainnet.
π― Goals for the Presale
We designed our smart contract to support:
β
4 Phases with dynamic pricing
β
Hard cap / soft cap enforcement
β
Refunds if soft cap not met
β
50% unlocked + 50% vested claiming
β
ETH withdrawal to treasury
β
Unsold token recovery
β
Fully trackable via the frontend (no backend)
Built using Solidity + Hardhat, with a modern frontend stack powered by Next.js, WAGMI, and Viem, all deployed to Base (L2 by Coinbase).
π§± Smart Contract Overview
Our TaskTokenPresale contract:
Accepts ETH based on current phase pricing
Calculates token entitlement on buy (not direct mint)
Implements vesting logic after presale ends
Provides refunds if soft cap is unmet
Enforces admin withdrawal rules post-sale
Key claim logic example:
function claimTokens() public {
require(block.timestamp > presaleEndTime, "Presale not ended");
require(!initialClaimed[msg.sender], "Already claimed");
uint256 claimAmount = tokenEntitlement[msg.sender] / 2;
initialClaimed[msg.sender] = true;
token.transfer(msg.sender, claimAmount);
}
All presale-related minting is temporary and strictly time-locked.
π Frontend Stack
βοΈ Next.js App Router
π WAGMI + Viem
π¨ TailwindCSS
π .env.production for Base Mainnet
π Automatic chain detection and wallet switching
Features:
Real-time phase countdown
ETH contribution input + transaction toasts
Dynamic claim / refund button logic
Smart contract reads via useReadContract() to stay trustless
π§ͺ Testing Strategy
Ran full test cycles on Base Sepolia
Simulated phase time shifts with Hardhat
Verified claim/refund conditions across wallets
Ensured cross-wallet UX: MetaMask, Trust Wallet, WalletConnect
π Deployment Process
Deployed upgraded $TASK token on Base
Minted 30M $TASK to presale contract
Final presale config:
4 phases
Soft cap: 30 ETH
Hard cap: 200 ETH
Phase 1 discount: 56%
Final Mainnet addresses:
Token: 0x516e09011C082d34f4EB795ebac3efBAD6D753F0
Presale: 0x18E0B87Fc62D1349d060E79843e55b8658B8f2D9
π‘ Lessons Learned
Wrong-chain wallet detection is crucial
ENS lookups fail on Base Sepolia, watch out
Mobile WalletConnect needs fallback explorer links
We used Vanta.js backgrounds β beautiful, but tricky with SSR hydration
π§ Whatβs Coming Next
Add βAdd $TASK to Walletβ feature
Submit for BaseScan verification
Begin staking Dapp and DAO module
Open source the codebase
π Try It Yourself
π Website: https://taskforceweb3.com
π Join the Presale: https://taskforceweb3.com/#presale
π Whitepaper: https://taskforceweb3.com/whitepaper
π’ Twitter: https://twitter.com/TeamTaskweb3
Top comments (0)