1. Home
  2. /
  3. Vyper Typing Test
  4. /
  5. Simple Counter Contract

Simple Counter Contract - Vyper Typing CST Test

Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
count: public(uint256)

@external
def __init__():
self.count = 0

@external
def increment():
self.count += 1

@external
def reset():
self.count = 0
Coding works best on desktop or with an external keyboard.
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.

Simple Counter Contract — Vyper Code

A minimal counter smart contract using Vyper with increment and reset functions.

count: public(uint256)

@external
def __init__():
	self.count = 0

@external
def increment():
	self.count += 1

@external
def reset():
	self.count = 0

Vyper Language Guide

Vyper is a security-focused, Python-like smart contract programming language for the Ethereum Virtual Machine (EVM). It emphasizes simplicity, readability, and auditability-making it ideal for high-assurance smart contracts.

Primary Use Cases

  • ▸High-assurance smart contracts
  • ▸DeFi protocols and vaults
  • ▸Governance and treasury contracts
  • ▸Security-audited financial logic
  • ▸Minimalistic EVM dApps

Notable Features

  • ▸Python-like syntax
  • ▸Strong typing and safety checks
  • ▸No modifiers -> predictable flow
  • ▸No inheritance -> reduced complexity
  • ▸Built-in overflow/underflow protection

Origin & Creator

Vyper was created by the Ethereum Foundation with contributions from Vitalik Buterin and the research team. It emerged around 2017 as a safer alternative to Solidity.

Industrial Note

Vyper is heavily used in high-stakes DeFi protocols, DAO governance, staking pools, and security-critical Ethereum contracts where simplicity and predictability matter more than feature richness.

Quick Explain

  • ▸Vyper syntax is inspired by Python but intentionally limited for security.
  • ▸It removes complex features to reduce attack surfaces (no modifiers, no inheritance).
  • ▸Compiled directly to Ethereum Virtual Machine bytecode.
  • ▸Designed for formal verification and auditing.
  • ▸Used by DeFi, security-critical dApps, and DAO contracts.

Core Features

  • ▸Events and logs
  • ▸Interfaces
  • ▸Custom structs
  • ▸ABI compatibility with Solidity
  • ▸EVM-level optimization

Learning Path

  • ▸Learn Python basics
  • ▸Understand EVM
  • ▸Write minimal contracts
  • ▸Master Vyper syntax
  • ▸Learn auditing & gas optimization

Practical Examples

  • ▸Minimal ERC-20 token
  • ▸Treasury vault
  • ▸DAO voting contract
  • ▸Time-locked withdrawals
  • ▸Staking and reward distribution

Comparisons

  • ▸Vyper vs Solidity: Vyper is safer but has fewer features.
  • ▸Vyper vs Rust-based languages: Vyper is simpler but less powerful.
  • ▸Vyper vs Yul: Vyper is high-level; Yul is low-level.
  • ▸Vyper vs Cairo: Cairo targets STARK VMs; Vyper targets EVM.
  • ▸Vyper vs Move: Move is resource-based; Vyper is minimalistic.

Strengths

  • ▸High security and predictability
  • ▸Easy to read and audit
  • ▸Minimal attack surface
  • ▸Formally verifiable
  • ▸Ideal for critical DeFi contracts

Limitations

  • ▸No inheritance
  • ▸No modifiers
  • ▸Limited built-in tooling vs Solidity
  • ▸Smaller ecosystem
  • ▸Not ideal for highly complex contracts

When NOT to Use

  • ▸Highly complex inheritance-based systems
  • ▸Large modular contract architectures
  • ▸Contracts requiring inline assembly
  • ▸Custom low-level opcodes
  • ▸Massive multi-file OOP-style programs

Cheat Sheet

  • ▸@external -> public function
  • ▸@view -> read-only
  • ▸@payable -> accept ETH
  • ▸event Transfer: ...
  • ▸struct User: ...

FAQ

  • ▸Is Vyper safer than Solidity?
  • ▸Yes - by design.
  • ▸Is Vyper widely used?
  • ▸Yes in DeFi and audited contracts.
  • ▸Does Vyper support inheritance?
  • ▸No - intentionally removed.
  • ▸Is Vyper slower?
  • ▸No - often more gas-efficient.
  • ▸Can Vyper and Solidity interact?
  • ▸Yes - ABI compatible.

30-Day Skill Plan

  • ▸Week 1: Vyper syntax
  • ▸Week 2: Events + functions
  • ▸Week 3: Interfaces + ABI
  • ▸Week 4: Security testing
  • ▸Week 5: Build DeFi primitives

Final Summary

  • ▸Vyper is a secure, minimal, Python-like EVM language.
  • ▸Ideal for high-assurance and audited smart contracts.
  • ▸No modifiers, no inheritance, less complexity.
  • ▸Used widely in DeFi, DAOs, and financial logic.
  • ▸Perfect for developers who value safety + clarity.

Project Structure

  • ▸contracts/ - Vyper source files
  • ▸tests/ - Python tests
  • ▸scripts/ - deployment scripts
  • ▸interfaces/ - .vy interface files
  • ▸build/ - compiled artifacts

Monetization

  • ▸Develop audited contracts
  • ▸Write DeFi Vyper modules
  • ▸Offer security audits
  • ▸Sell DAO governance templates
  • ▸Consult enterprise blockchain teams

Productivity Tips

  • ▸Keep contracts small
  • ▸Use interfaces wisely
  • ▸Rely on Brownie for testing
  • ▸Simplify state transitions
  • ▸Avoid unnecessary features

Basic Concepts

  • ▸Functions with strict typing
  • ▸Events for logging
  • ▸State variables with visibility
  • ▸Custom structs
  • ▸Fallback and default functions

Official Docs

  • ▸https://vyper.readthedocs.io
  • ▸https://github.com/vyperlang/vyper

More Vyper Typing Exercises

Owner-Only StorageSimple Bank (Deposit + Withdraw)ERC20-Like Token (Minimal)Timestamp LockerSimple VotingWhitelist AccessEvent LoggerImmutable ConfigSimple Multiplier

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher