Skip to content

Conversation

STetsing
Copy link
Collaborator

@STetsing STetsing commented Feb 12, 2025

Introducing code suggestion for Vyper and circom

How to test

Follow the steps below, simply delete some variables and trigger the code suggestion.

-> Vyper

  • create a test.vy file in the file explorer
  • paste this sample code in the editor
#pragma version >0.3.10

# Open Auction

# Auction params
# Beneficiary receives money from the highest bidder
beneficiary: public(address)
auctionStart: public(uint256)
auctionEnd: public(uint256)

# Current state of auction
highestBidder: public(address)
highestBid: public(uint256)

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

# Keep track of refunded bids so we can follow the withdraw pattern
pendingReturns: public(HashMap[address, uint256])

# Create a simple auction with `_auction_start` and
# `_bidding_time` seconds bidding time on behalf of the
# beneficiary address `_beneficiary`.
@deploy
def __init__(_beneficiary: address, _auction_start: uint256, _bidding_time: uint256):
    self.beneficiary = _beneficiary
    self.auctionStart = _auction_start  # auction start time can be in the past, present or future
    self.auctionEnd = self.auctionStart + _bidding_time
    assert block.timestamp < self.auctionEnd # auction end time should be in the future

-> Circom

  • create a test.circom file in the file explorer
  • paste this sample code in the editor
pragma circom 2.0.0;

/*This circuit template checks that c is the multiplication of a and b.*/  

template Multiplier2 () {  

   // Declaration of signals.  
   signal input a;  
   signal input b;  
   signal output c;  

   // Constraints.  
   c <== a * b;  
}

Copy link

netlify bot commented Feb 12, 2025

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 6c18835
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/67d7f50f4b210800083aa264
😎 Deploy Preview https://deploy-preview-5767--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@STetsing STetsing changed the title initial support for vyper and circom initial code suggestion support for vyper and circom Feb 12, 2025
@joeizang
Copy link
Collaborator

vyper is a lot like python "with types". so some of the symbols might not be required.

@STetsing STetsing merged commit c5146aa into master Mar 17, 2025
34 checks passed
@STetsing STetsing deleted the more_language_support branch March 17, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants