Vyper

1 program Added 2025-10-23T15:20:30Z Model: deepseek/deepseek-chat-v3-0324Temp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit 0cf9828c53 · authored 2025-10-23T17:20:30+02:00 · model deepseek/deepseek-chat-v3-0324

Sources mentioning this language

3 sources · pl_id: pl/vyper
LLM (this repo) · 1LinguistPygments

Extensions claimed by this language

2 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.vylinguistprimary19.6K files
.vypygmentsprimary19.6K files

Related languages

Viper (0.40)Hopper (0.25)Kipper (0.25)Clipper (0.23)Juniper (0.23)

LLM-contributed programs

Simple Auction Contract

Provenance: commit 0cf9828c53 · authored 2025-10-23T17:20:30+02:00 · model deepseek/deepseek-chat-v3-0324 · Temp 0.4
code.vy · license: MIT · added: 2025-10-23T15:20:30Z
# @version ^0.3.1

# Simple auction contract

# Auction parameters
beneficiary: public(address)
auctionStart: public(uint256)
auctionEnd: public(uint256)

# Current state of auction
highestBidder: public(address)
highestBid: public(uint256)
pendingReturns: public(HashMap[address, uint256])

# Set to true at the end, disallows any change
ended: public(bool)

# Events that will be fired on changes.
HighestBidIncreased: event({bidder: indexed(address), amount: uint256})
AuctionEnded: event({winner: indexed(address), amount: uint256})


@external
def __init__(_beneficiary: address, _bidding_time: uint256):
    self.beneficiary = _beneficiary
    self.auctionStart = block.timestamp
    self.auctionEnd = self.auctionStart + _bidding_time


@external
@payable
def bid():
    # Check if bidding period is over.
    assert block.timestamp < self.auctionEnd, "Auction already ended"

    # Check if bid is high enough
    assert msg.value > self.highestBid, "There already is a higher bid"

    # Track the previous bidder's refund
    if self.highestBid != 0:
        self.pendingReturns[self.highestBidder] += self.highestBid

    # Track new highest bid
    self.highestBidder = msg.sender
    self.highestBid = msg.value

    log HighestBidIncreased(msg.sender, msg.value)


@external
def withdraw() -> bool:
    pending_amount: uint256 = self.pendingReturns[msg.sender]
    if pending_amount > 0:
        self.pendingReturns[msg.sender] = 0
        send(msg.sender, pending_amount)
    return True


@external
def endAuction():
    # 1. Conditions
    assert block.timestamp >= self.auctionEnd, "Auction not yet ended"
    assert not self.ended, "auctionEnd has already been called"

    # 2. Effects
    self.ended = True
    log AuctionEnded(self.highestBidder, self.highestBid)

    # 3. Interaction
    send(self.beneficiary, self.highestBid)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Vyper (mapped to pl/vyper). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Vyper/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← vvvv gamma Vyxal →