Questions tagged [vyper]

Vyper is a smart contract development language which can be used in place of Solidity.

Vyper is a smart contract development language which can be used in place of Solidity.

In the words of Vyper developers themselves, Vyper

will deliberately forbid things or make things harder if it deems fit to do so for the goal of increasing security.

There are three main goals of Vyper:

  • Security - it should be possible and natural to build secure smart contracts in Vyper.
  • Language and compiler simplicity - the language and the compiler implementation should strive to be simple.
  • Auditability - Vyper code should be maximally human-readable. Furthermore, it should be maximally difficult to write misleading code. Simplicity for the reader is more important than simplicity for the writer, and simplicity for readers with low prior experience with Vyper (and low prior experience with programming in general) is particularly important.

Useful Links: Github

20 questions
5
votes
1 answer

Vyper how to convert uint256 to String?

I need to convert a uint256 to String in vyper, I notice that theres something similar on Solidity (Taken from OpenSea's docs): /** * @dev Returns an URI for a given token ID */ function tokenURI(uint256 _tokenId) public view returns…
Alex
  • 139
  • 6
3
votes
3 answers

Problems installing cytoolz on Python@3.10

I am trying to install cytoolz in virtualenv: Python version = 3.10.0 Pip version = 21.3.1 After running pip install cytoolz in the activated virtualenv I am getting the following log: Collecting cytoolz Using cached cytoolz-0.11.0.tar.gz (477…
Hristo Todorov
  • 263
  • 2
  • 12
2
votes
2 answers

Do I need to use approve method in ERC721?

I am practicing the smart contract and NFT looks interested to me. ERC721 written in Vyper What is the mechanic of approve in it? What is isApprovedForAll does? IMO. I don't need to use approve method. I just use transferFrom() is enough. Correct…
joe
  • 8,383
  • 13
  • 61
  • 109
2
votes
1 answer

A security issue with require(send()) in Solidity

I'm working on a uni project based on blockchain, and I have to audit our system, check known attacks, ect. This the the document that I check, principaly, since i start to work on smart contracts issues first : Known-attack ethereum smart…
Zartant
  • 109
  • 9
2
votes
1 answer

Vyper: compatible to write/deploy Ethereum classic smart-contract with python?

Since Python Serpent Compiler is considered outdated and not secure by Vitalik (also confirmed by this audit and here), it is more recommended to write/deploy Ethereum smart-contract from python with Vyper compiler. It is sure that Vyper works on…
A. STEFANI
  • 6,707
  • 1
  • 23
  • 48
1
vote
0 answers

How to get TypeChain to generate types for Vyper contracts

Typechain generates types for Solidity contracts but not for Vyper contracts. I see that *.dbg.json file are generated for each corresponding *.sol file but not for *.vy Edited: generating types via cli: npx typechain --target=ethers-v5…
1
vote
1 answer

How to test payable/external method with waffle and ethers.js

Here is the smart contract, written in vyper, to be tested owner: public(address) name: public(String[100]) total_amount: uint256 @external def __init__(_name: String[100]): self.owner = tx.origin self.name =…
bidon
  • 53
  • 6
1
vote
1 answer

Solidity & Truffle - Automatic test case generate in Solidity and JavaScript, What is the best option? Props and Cons?

I created new ERC-20 token and now, want to add test code. Is there any ways to auto-generate test-cases in SOL files? And also want to know the way of auto generate test code in Truffle JavaScript framework. I already googled and got some useful…
1
vote
1 answer

Vyper Equivalent for solidity's address(this)

How to get the address of current contract in Vyper. In solidity address(this) is used. What is the equivalent in Vyper. address myContractAddress; myContractAddress = address(this);
1
vote
0 answers

What does 'variable: value' mean in Python3?

I came across the following syntax in some Python3 code I found online: Note: this is actually from Vyper, a subset of Python3 used for programming on Ethereum. The developers of Vyper claim that all Vyper code is valid Python3 syntax (although the…
Marco Merlini
  • 875
  • 7
  • 29
0
votes
0 answers

Compiling Vyper files results in a 'path exists outside base folder' error

I received a truffle compile error while compiling Vyper files /VyperStorage.vy - path exists outside base folder I was working with the truffle VyperStorage Example Box. When I execute truffle compile it shows me the error above. I have installed…
0
votes
1 answer

Performing an atomic swap in solidity with a disposable smart-contract

I want to perform an atomic token swap without a pre-deployed smart-contract and I am wondering how to do that in Solidity. The most common approach to do atomic swaps between tokenA and tokenB is the P2-SC-2P (Peer-to-Smart-contract-to-Peer)…
Thibauld
  • 183
  • 1
  • 9
0
votes
1 answer

ETH Brownie Module Not Found Errror

So I had gotten this error 2 days ago when I started to install brownie and use it for developing using vyper, So I factory reset my whole laptop only to get the same error... I followed the installation instruction on…
0
votes
1 answer

In Brownie, is there a way to define a constant in one place and use it in both a Vyper smart contract and a test script?

I'm looking for something like an environment variable or a #define where the constant value gets substituted into the smart contract prior to compilation. I have carefully read through the Brownie docs and found nothing but this seems like…
0
votes
1 answer

Is there a way in vyper to calculate e^x with x being a signed decimal?

For my thesis, I have been looking for an equation that calculates an exp(x) with Vyper smart contract. I choose Vyper over Solidity for its ability to handle fixed-point numbers. However, I couldn't find an efficient to do this since Vyper doesn't…
1
2