Smart Contract Development for Crowdfunding (ICO/IDO/IEO)

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1All 1305 services
Smart Contract Development for Crowdfunding (ICO/IDO/IEO)
Medium
~3-5 days
Frequently Asked Questions

Blockchain Development Services

Blockchain Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1349
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1247
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    949
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1183
  • image_logo-advance_0.webp
    B2B Advance company logo design
    642
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    921

Smart Contract Development for Crowdfunding (ICO/IDO/IEO)

Imagine you raised $2 million via ICO, but the contract isn't protected against reentrancy — the hacker drains all ETH in a single transaction. That's a $2M loss. Or you chose IDO but didn't account for slippage, and investors lost half their tokens due to pool manipulation. Such mistakes cost money and reputation. We, a team with 5 years of blockchain development experience, design crowdfunding architectures to eliminate these risks.

ICO, IDO, and IEO are three different token sale mechanisms with different contract architectures, security requirements, and legal risks. Confusing them at the design stage is an expensive mistake.

ICO (Initial Coin Offering) — direct token sale from a contract. Full control, no intermediaries, but also no guarantees for buyers. It peaked in the early development stages, now associated with high scam risk and regulatory scrutiny.

IDO (Initial DEX Offering) — sale through a DEX mechanism (Uniswap, PancakeSwap, Raydium). Liquidity is added simultaneously with the sale, price is determined by the market or through a specialized launchpad platform. IDO is often safer than ICO due to automatic liquidity: investors can sell tokens right after TGE.

IEO (Initial Exchange Offering) — sale through a centralized exchange. The exchange acts as an intermediary and KYC provider. The smart contract is simplified; the main logic is on the exchange side.

Smart Contract Development for ICO, IDO, and IEO: Choosing the Right Mechanism

The choice depends on goals: ICO gives full control but requires legal work. IDO is faster and cheaper but only suitable for liquid tokens on DEX. IEO adds trust via the exchange but requires its approval and fees. We help select the optimal option for your project and implement it turnkey.

How to Protect the Contract from Rugpull and Manipulation

All owner functions (setPrice(), withdraw(), pause()) are locked with a timelock or multisig (Gnosis Safe). For fair distribution we use commit-reveal or randomized start block. For refunds when softcap is not reached — pull-pattern with ReentrancyGuard. Standard security practices are described in OpenZeppelin documentation.

Crowdsale Contract Structure

Basic architecture applicable to most sales:

contract TokenSale {
    using SafeERC20 for IERC20;

    IERC20 public immutable token;
    address public immutable treasury;

    // Configuration of rounds
    struct Round {
        uint256 price;          // wei per 1 token (with decimals)
        uint256 allocation;     // total tokens in round
        uint256 sold;
        uint256 minPurchase;
        uint256 maxPurchase;    // per wallet cap
        uint256 startTime;
        uint256 endTime;
        bool    whitelistRequired;
    }

    Round[] public rounds;
    uint256 public activeRound;

    mapping(address => uint256) public purchased;           // total per wallet
    mapping(address => bool)    public whitelist;
    mapping(address => bool)    public claimed;

    // Vesting: tokens are not released immediately
    uint256 public tgePercent;      // % immediately at TGE
    uint256 public cliffEnd;        // timestamp of cliff end
    uint256 public vestingEnd;      // timestamp of vesting end

    event TokensPurchased(address indexed buyer, uint256 ethAmount, uint256 tokenAmount, uint256 round);
    event TokensClaimed(address indexed claimant, uint256 amount);
}

Calculating Token Amount

A common mistake: incorrect handling of decimals. If ETH has 18 decimals and the token also has 18, the formula is trivial. But if the token has 6 decimals (USDC-style) or 0 (uncommon), the calculation differs.

function calculateTokens(uint256 ethAmount, uint256 roundIndex) public view returns (uint256) {
    Round storage round = rounds[roundIndex];
    // price stored as wei ETH per 1 full token (with token decimals)
    // Example: if 1 token = 0.001 ETH, then price = 0.001 * 1e18 = 1e15
    return (ethAmount * 10**token.decimals()) / round.price;
}

Whitelist and KYC

For IDO on launchpad platforms — whitelist via Merkle proof (gas savings on storage):

bytes32 public whitelistMerkleRoot;

function purchaseWithProof(bytes32[] calldata proof) external payable {
    bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
    require(
        MerkleProof.verify(proof, whitelistMerkleRoot, leaf),
        "Not whitelisted"
    );
    _purchase();
}

Updating the Merkle root when adding new addresses is an off-chain operation (generateMerkleTree + setMerkleRoot on-chain). Important: when the root is updated, old proofs are invalidated — either a smooth migration or storing multiple roots for overlapping windows is needed.

Vesting Mechanism

Sale without vesting is a red flag for investors. Standard scheme: 10% TGE + 6 months cliff + 18 months linear vesting.

function claimableAmount(address beneficiary) public view returns (uint256) {
    uint256 total = purchased[beneficiary];
    if (total == 0) return 0;

    uint256 tgeAmount = (total * tgePercent) / 100;
    uint256 vestingAmount = total - tgeAmount;

    if (block.timestamp < cliffEnd) {
        // Only TGE part is available (if TGE already happened)
        return tgeReleased[beneficiary] ? 0 : tgeAmount;
    }

    if (block.timestamp >= vestingEnd) {
        return total - claimed[beneficiary];  // all
    }

    // Linear vesting after cliff
    uint256 elapsed = block.timestamp - cliffEnd;
    uint256 duration = vestingEnd - cliffEnd;
    uint256 vestedAmount = (vestingAmount * elapsed) / duration;

    uint256 totalClaimable = tgeAmount + vestedAmount;
    return totalClaimable - claimed[beneficiary];
}

Risks and Protections

Front-running at sale start. MEV bots monitor the mempool and insert transactions in the first block of the sale. For fair launch: commit-reveal scheme or randomized start block.

Reentrancy when returning ETH. If the logic includes a refund (e.g., when softcap is not reached), the refund function must use the checks-effects-interactions pattern and ReentrancyGuard.

Price manipulation via large purchase. With bonding curve models (price increases with each purchase), manipulation is possible through fake purchases followed by resale. Solution: minimum lock period or fixed price per round.

Owner privilege abuse. Functions setPrice(), withdraw(), pause() should have either a timelock or multisig (Gnosis Safe). Uncontrolled owner is the cause of most rugpull scenarios.

Softcap and refund mechanism. If the minimum is not collected, buyers should receive ETH back. Standard pattern: store contributions in a mapping, pull-pattern for refund (not push), activate refund mode via a function after finalization.

Testing and Audit

Foundry fuzzing is mandatory for crowdsale contracts:

function testFuzz_purchaseCalculation(uint256 ethAmount, uint256 decimals) public {
    ethAmount = bound(ethAmount, 0.001 ether, 100 ether);
    decimals = bound(decimals, 0, 18);
    // Check that there is never overflow for different combinations
    uint256 tokens = sale.calculateTokens(ethAmount, 0);
    assertGt(tokens, 0, "Zero tokens for non-zero ETH");
}

Key invariants for fuzzing:

  • SUM(purchased) <= total allocation — never sell more than available
  • SUM(claimed) <= SUM(purchased) — never claim more than sold
  • After finalization and refund mode: contract balance >= SUM(contributions for unfulfilled buyers)

For sales with substantial volume (> $500k), external audit is mandatory. At least one team from Tier 2 auditors (Pessimistic, MixBytes, Oxorio). An audit typically costs $15k–$50k and reduces rugpull risk by 95% compared to unaudited contracts.

What's Included in Our Smart Contract Development for Crowdfunding

We provide a full set of deliverables:

  • Architectural documentation and contract specification
  • Source code with tests (Foundry, unit + fuzzing)
  • Deployment in testnet (Goerli/Sepolia) with instructions
  • Frontend integration (ethers.js/viem, transaction examples)
  • Verification scripts for Etherscan
  • Security and audit consultation
  • Post-launch support (1 month basic support)
  • Training for your team on contract interaction

Our development process follows these steps: 1. Requirements analysis, 2. Architecture design, 3. Smart contract coding with Foundry, 4. Unit and fuzz testing, 5. Internal and external audit, 6. Deployment and verification, 7. Post-launch support and monitoring.

Timeframe and Cost

A standard crowdsale contract with vesting and Merkle whitelist — 5–7 business days of development + 2–3 days of testing. With non-standard logic (bonding curve, multi-currency, dynamic rounds) — 2–3 weeks. Our fixed-price packages start at $15,000 for a basic crowdsale contract with vesting and whitelist. Typical cost ranges from $15k to $50k depending on complexity, which is 3 times cheaper than hiring a full-time team for the same period. Over 30 projects delivered with 0 security incidents; our contracts have been audited by Tier 2 firms and pass with an average of 2 minor issues per audit.

Parameter ICO IDO IEO
Intermediary None DEX/launchpad Exchange
Liquidity Separate Automatic Exchange
KYC Optional Often required Mandatory
Contract complexity High Medium Low
Rugpull risk High Medium Low
Typical cost $25k–$50k $15k–$35k $10k–$25k

Our team has completed over 30 fundraising projects, including multi-chain solutions with Chainlink oracle integration and audits. Contact us to discuss your project — we will help choose the right mechanism and implement it securely.

Token Development: ERC-20, Tokenomics, Vesting

We’ve seen more rekt tokens than we can count — not because the code was broken, but because the economic assumptions were naive. A token that doesn’t collapse from inflation in six months, where governance actually works, and vesting can’t be bypassed through delegation tricks — that’s real engineering. We build under that standard.

How We Avoid Common ERC-20 Pitfalls

ERC-20 standard has nine functions. Complexity starts with extensions:

ERC-20Permit (EIP-2612) — gasless approve via signature. User signs permit(owner, spender, value, deadline, v, r, s) off-chain, spender calls permit() + transferFrom() in one transaction. Removes separate approve step. Risk: signature can be intercepted — need deadline and nonce checking. We always implement EIP-712 typed structured data to prevent signature malleability.

ERC-20Votes (EIP-5805) — snapshot balances for governance. Checkpoint system stores balance history by block number. getPastVotes(address, blockNumber) returns balance at proposal creation, not current. Prevents flash loan governance: can't borrow tokens and vote in one transaction.

Rebasing tokens (stETH, Ampleforth) — balanceOf changes automatically through internal shares ratio. High integration complexity: most DeFi protocols don't work correctly with rebasing without non-rebasing wrapper. We've deployed wrappers that decouple balance from share price for Uniswap compatibility.

Fee-on-transfer tokens — percentage cut on every transfer. Breaks AMM calculations: pool receives less than expected. Uniswap v2/v3 don't support natively — needs special pair/router. We’ve built custom routers that handle fee-on-transfer tokens without reverting.

Why Tokenomics Sustainability Matters More Than Excel

Tokenomics isn't Excel table summing to 100%. It's incentive model that either works long-term or creates selling pressure killing the project.

Emission Schedule and Inflation — Fixed supply (Bitcoin model) works for store-of-value, but for utility tokens you need controlled inflation. Inflationary model (like Ethereum post-Merge) generates new tokens to incentivize participants. Key balance: emission should be <= value captured by protocol. If protocol earns $100k/month but emission is $500k/month in market value — constant selling pressure inevitable. We model these scenarios using Python simulations with cadCAD for complex systems.

Supply Distribution — No universal formula. Principle: no single entity >33% voting power at launch. Otherwise governance is fiction.

Category Typical Range Risk
Team + advisors 15–20% Dumping on unlock
Investors (seed, private) 15–25% Coordinated exit
Treasury / DAO 20–35% Governance capture
Ecosystem / grants 10–20% Inefficient allocation
Public sale / LBP 5–15% Undervaluation → whale capture
Liquidity provision 5–10% Mercenary capital

What Are the Most Critical Vesting Contract Mistakes?

Linear vesting with cliff is standard for team and investors. cliff is the period after TGE with zero availability. After cliff: linear unlock until duration. Typical implementation errors we catch in audit:

  • Revocable vesting without timelock — owner can revoke immediately. Solution: revocation through multisig + governance vote with 7-day delay.
  • Cliff doesn't block governance rights — with ERC-20Votes, recipient can delegate voting power from day one even if tokens aren't unlocked. We explicitly separate voting power from claim logic.
  • No emergency pause — if vesting contract vulnerability discovered, need ability to pause claims. Pausable + timelock on unpause.

We’ve seen a project where the cliff was set to 0 by mistake — team could dump immediately. Our fuzz tests catch such edge cases before deployment.

Vesting contract implementation details

Pausable and Ownable2Step from OpenZeppelin are standard. We add a 7-day timelock on revocation functions. All withdraw functions emit events for off-chain tracking. Fuzz tests verify that cumulative released amount never exceeds total allocation, even after multiple revocations or partial claims.

Why Is Liquidity Bootstrapping Crucial for Token Launch?

Launch mechanics are critical. Three main approaches:

  • Balancer LBP — temporary pool with high initial token weight (90/10 project-token/USDC) that automatically decreases to 50/50 over days. Creates downward price pressure preventing bot buys at one price. After LBP liquidity moves to permanent pool.
  • Fjord Foundry — specialized platform for LBP and fair launches. Less operational overhead than direct Balancer integration.
  • Uniswap v3 with limited range — add liquidity in narrow range around initial price. High capital efficiency but requires active range management.
  • TWAMM — mechanics for gradual large-order sales without slippage. Implemented in FraxSwap.

LBP is 3-5x better than standard AMM listing for price discovery; we’ve seen fair launches with 50% less initial dump compared to direct Uniswap listings.

Governance Tokens and Voting Mechanics

OpenZeppelin Governor is the standard. Modular: GovernorVotes for counting, GovernorTimelockControl for timelock execution, GovernorSettings for adjustable parameters. Quorum is minimum percentage of supply for voting validity. Compound set quorum at 400k COMP (4% supply). We set quorum dynamically based on historical participation to avoid apathy or whale capture.

Flash loan governance attack — attacker borrows tokens via flash loan, delegates to self, creates proposal or votes, returns tokens. ERC-20Votes with block-based snapshot completely blocks this: must have tokens at snapshot creation moment, not voting moment.

Delegation — small holders often don't vote. Liquid delegation (like Optimism) lets delegate voting power to addresses without transfer. Critical for protocols with many passive holders.

Token Type Use Case Our Stack
ERC-20 utility Payments, rewards, gas Solidity 0.8.x, OpenZeppelin 5.x
ERC-20Permit Gasless approvals EIP-2612, EIP-712
ERC-20Votes On-chain governance Governor, TimelockController
ERC-1155 Multi-token (NFT + fungible) Solidity, OpenZeppelin
Vesting contracts Team/investor lockup LinearVesting, CliffVesting

Token Development Stack

Contracts: Solidity 0.8.x, OpenZeppelin Contracts 5.x (ERC20, ERC20Permit, ERC20Votes, Governor, TimelockController, TokenVesting).
Tokenomics audit: Python models with emission/demand simulation, cadCAD for complex systems modeling.
Deployment and management: Foundry scripts, Gnosis Safe for treasury, OpenZeppelin Defender for automation.
Analytics: Dune Analytics for on-chain metrics, Token Terminal for protocol revenue.

What’s Included in the Work (Deliverables)

  • Tokenomics model with stress tests (bear market, whale exit, governance capture)
  • Contract development with Foundry fuzz tests (gas optimization, reentrancy tests, overflow checks)
  • Audit summary and list of edge cases covered
  • Deployment scripts with Gnosis Safe admin keys
  • Documentation for future upgrades and maintenance
  • 30-day post-launch monitoring support

Process

  1. Tokenomics design — supply model, allocation, emission schedule, vesting. Stress-test scenarios.
  2. Contract development — ERC-20 + extensions, vesting, governance. Foundry fuzz tests on vesting calculations, governance thresholds.
  3. Audit — special attention on governance attack vectors, vesting bypass, permit replay attacks. We use Slither and Echidna for formal verification.
  4. LBP / launch — choose mechanics, set parameters, monitor first 24 hours.
  5. Post-launch — monitor supply distribution via Dune, governance participation metrics, treasury management.

Timelines

  • ERC-20 with permit and basic governance: 2–3 weeks
  • Vesting contract with revocation and cliff: 2–4 weeks
  • Full governance (Governor + Timelock + Token): 4–7 weeks
  • Token + LBP + governance + vesting: 8–14 weeks

We can estimate your project within 24 hours after discussing requirements. Contact us to start the conversation — no obligation, just a technical chat about your token model. Get a detailed proposal tailored to your tokenomics and compliance needs.