Questions tagged [vyper]

Vyper is a contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine.

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

Why is my view function running out of gas when reading from mapping/HashMap?

I have the following vyper code: address_to_addresses: public(HashMap[address, address[2]) Vyper auto generates a view function called address_to_addresses(arg0: address, arg1: uint256) -> address ...
0
votes
0answers
37 views

How is address comparison done in Vyper?

In solidity, you can do this: address_1 < address_2 But the same code is not possible in vyper. How can I compare which address is larger than the other in vyper?
0
votes
0answers
6 views

What are LLL_codes in Vyper and how do I define those for built-in functions?

I need to create a custom compiler for Vyper with only one addition - set of new built-in functions. How can one do that? I have managed to find file containing all of them, yet I had no luck to find ...
0
votes
1answer
28 views

Contract to interact with another contract written in vyper

I am trying to interact with another contract (Curve finance) via my own contract. (eg get prices, to execute trades , etc) The thing is , the contract is written in Vyper. https://etherscan.io/...
0
votes
0answers
31 views

Transaction error thrown with Vyper smart contract in MetaMask

I am trying to troubleshoot a problem I'm having with a crowdsale contract (written in Vyper). The contract compiles fine, and I can deploy the contract to Rinkeby without any problems, however when I ...
1
vote
1answer
56 views

Is there a Vyper equivalent to OpenZeppelin's SafeERC20.safeTransfer?

OpenZeppelin provides the SafeERC20 Solidity library as a way to handle the possible variations of ERC20. Is there an equivalent way to do this using Vyper?
2
votes
1answer
36 views

Does Vyper have an equivalent CHAINID assembly function?

Since v0.5.12, Solidity provides a CHAINID OPCODE in assembly: function getChainID() external view returns (uint256) { uint256 id; assembly { id := chainid() } return id; } ...
0
votes
1answer
23 views

How do you create an array in vyper?

How do you create an array in vyper? I want to create the array below but vyper is confusion. Outcomes = [5, 500, 5000, 50000, 500000000, -1, -100, -1000, -10000, -100000, -500, -5000, -50000, -...
1
vote
0answers
16 views

vyper no mappings allowed when adding a function to initialize a struct that has a map inside

Version Information vyper Version (output of vyper --version): 0.1.0b17+commit.eaa6754 OS: Debian GNU/Linux 10 (buster) Python Version - 3.6.2 Environment (output of pip freeze): asttokens==2.0.3 ...
0
votes
1answer
26 views

Why 'Out of gas' error when there is still a lot of gas?

Gas limit was set to 6,000,000 Tx consumed just 1,943,125 Yet is still failed with Out of gas error. If it makes any difference, this is my contract which calls other contracts with raw_call (in ...
1
vote
2answers
432 views

Vyper vs. Solidity - benefits and differences

What are the benefits and differences of using Vyper over Solidity for smart contracts? Are there any other differences besides syntax? Are there any features for better developer experience (...
0
votes
0answers
17 views

How is contract code executed in Vyper?

I'm trying to execute my first contract on Ethereum. I've been able to compile and deploy one of Vyper's test examples of an auction. I believe the contract is executed when a transaction is sent to ...
0
votes
1answer
33 views

Bytecode: Does it Reveal What Language it Was Programmed In?

Does EVM bytecode have some indication to what high-level language it was programmed in?
1
vote
0answers
32 views

How to use raw_call in Vyper?

I am new to Vyper and am trying to use the raw_call built in function as defined in the official documentation. I am getting the error where the vyper compiler says that the raw_call function expects ...
3
votes
0answers
24 views

does vyper support contracts making contracts?

I am trying to create manager contract that generates player contracts for a game. Right now I am using vyper to try and generate new contracts but that seems to be failing. I know you can have a ...
1
vote
1answer
71 views

Vyper fundraising smart contract: 'Attribute' object has no attribute 'func'

[SOLVED]: See below. I am taking a blockchain and security class and we are working with vyper. We have been tasked with rewriting a fundraising smart contract. However, the compilers do not seem to ...
2
votes
1answer
83 views

How to setup an oracle in Vyper?

I need an ETH-USD price oracle for my vyper contract. So far, the oracle services I've found, like chainlink, are written in solidity. Is it possible to use a solidity oracle in a vyper contract? How ...
0
votes
0answers
37 views

How to correctly send Ether between contracts in vyper?

I have a user, Contract A, and Contract B. I want user to call a function A of Contract A, that function executes function B from Contract B, which sends ether from Contract B to Contract A. Here is ...
0
votes
1answer
22 views

Truffle Contract Abstraction Contract.at() not returning logs when methods are called

In my test file I have this set up: let acc = await Account.deployed() Then when I call a method, I can get the logs in the receipt: let deposit = await acc.deposit() console.log(deposit.receipt....
2
votes
1answer
64 views

Reference contract own address in vyper

how do you reference your own contract address in vyper, for example in solidity you would do something like that: address(this) Is there a way to do the same in vyper? Thanks.
0
votes
0answers
91 views

Transfer ERC20 Token with vyper

Hello i m learning vyper and i have this issue: I deployed a standard ERC20 token contract using vyper default contract: https://github.com/ethereum/vyper/blob/master/examples/tokens/ERC20.vy When i ...
1
vote
1answer
112 views

Vyper mapping inside a struct

Is it possible to have a mapping inside a struct for vyper? For example: struct Teddy: id: uint256 year: uint256 component: map(uint256, uint256) teddies: private(map(uint256, Teddy)) ...
1
vote
2answers
163 views

Transaction always failing - Vyper

I've been trying to teach myself how to program smart contracts in Vyper and I was trying out a toy problem where the contract transfers USDC to itself and then mints some Compound USDC on Compound ...
1
vote
2answers
78 views

How to check if an address is an active contract in Vyper?

Often for security reasons I want to limit certain address parameters to non-contract addresses for certain functions in my contracts, ie. there are no code stored on the addresses passed in as ...
1
vote
1answer
157 views

What's the equivalent of Vyper's create_forwarder_to in Solidity?

In Vyper, there's a built-in function called create_forwarder_to, which Duplicates a contract’s code and deploys it as a new instance, by means of a DELEGATECALL. If my understanding is correct, ...
0
votes
1answer
54 views

Can't import a contract interface in vyper

I need to import a contract interface using the JSON ABI but I get syntax error when trying to import the interface. I have created the JSON file in remix and named it IERC1620.json then I am trying ...
1
vote
1answer
119 views

How to declare a storage variable in vyper?

I am trying to convert my solidity code into vyper but I can't find a way to declare a storage variable. My solidity function was this: struct Account { uint256 balance; // Account's balance uint256 ...
1
vote
1answer
97 views

Cannot use external contract addresses as function arguments in Vyper contract interface

I'm trying to compile the Uniswap Exchange contract using the latest vyper compiler. I first updated the ERC20 references to the new token: ERC20 definition and set up an import from vyper.interfaces ...
1
vote
1answer
67 views

Cannot use abigen to make vyper bindings

using the command abigen --vy=uniswap_exchange.vy --pkg=uniswap --out=UniswapExchange.go results in the error: flag provided but not defined: -vy support for the vyper compiler was just added a ...
5
votes
1answer
1k views

Solidity Vs Vyper

What is the key differences between Solidity and Vyper? In present and future which one can more acceptable for making smart contracts and why?
1
vote
1answer
177 views

Uint256 division in vyper (and solidity)

Floating point division is not supported in solidity as mentioned here: How can I perform float type division in solidity? I want to divide two uint256 numbers and save them as a decimal, retaining ...
0
votes
2answers
168 views

Vyper and ethereum: how do I read a public constant function on another contract?

I'd like to call a constant function on one contract (X) from another contract (Y). I have the ABI and address for X. X and Y are both on Ropsten. I can interact with X fine using, for example, MEW. ...
2
votes
0answers
59 views

query about function call in ethereum vyper [closed]

How the function will be called in vyper while compiling?, how the variables will be declared and how the data will be mapped to that variables?
0
votes
1answer
229 views

Vyper: Truffle test read mapping value inside struct

I have the following struct inside my vyper file: races: public({ start: timestamp, end: timestamp, racersBetHash: bytes32[address], racersBetAmount: wei_value[address] }[int128]) Then I ...
1
vote
0answers
33 views

Vyper OPCODES gas estimate at compile time

I am trying to dissect Vyper at lower levels to understand how the gas estimates are generated. I tried following the yellow paper and I searched every single line of the compiler but I can't get it ...
1
vote
0answers
195 views

What are the downsides of using vyper and truffle together

Recently I read an article Vyper+Truffle and wanted to build a token deployer using vyper contracts. I was wondering if anyone knew the current downsides of using Vyper and truffle together? Is it ...
3
votes
1answer
134 views

When is Vyper going to be production ready?

At a high level, Vyper seems like a much more adoptable language compared to Solidity. Everywhere I look, Vyper is still considered to be "experimental". Any idea of when it will be production ready? ...
2
votes
1answer
157 views

Anyway to tell what Vyper can and cannot accomplish compared to Solidity?

After studying both Solidity and Vyper, I really like Vyper's strong security and simplicity. However one thing got me somehow worried, is that unlike Solidity, Vyper is not a Turing Complete language....
1
vote
1answer
240 views

Vyper and strings

How can I manipulate strings in Vyper? In solidity I could use Nick Johnson's string library. He's using assembly to do that. But that's not possible with Vyper as far as I know.
0
votes
1answer
383 views

How to resolve Vyper installation error: fatal error: leveldb/db.h

Created a virtualenv with python3.6 and performed the following steps git clone https://github.com/ethereum/vyper.git cd vyper make I see following error(s): Downloading https://files.pythonhosted....
0
votes
1answer
100 views

How to fix an error with Vyper: invalid syntax (, line 168)

I'm trying to figure out why the following line is giving the error at https://vyper.online/: invalid syntax (, line 168). Line 168 is self.collator_pool.empty_slots_stack_top] = index). @internal ...
1
vote
1answer
142 views

How to launch test with Viper?

I would like to switch the smart contract compiler from Solidity to Viper. I'm following the Viper support page found in Populus documentation. This is what I get at the final step: Mac:tutorial ...
10
votes
2answers
8k views

Solidity vs Viper? [closed]

I am new to smart contract development and I really want to understand how it all works, and start programming smart contracts. I don't care for JavaScript syntax, but I love Python. I know Serpent ...
2
votes
1answer
537 views

How to call the functions of Ethereum Smart Contract from Android/iOS application?

I've been learning solidity & viper for some time now but i am wondering if it's possible to call the functions/methods of a smart contract (already deployed on Ethereum Network) from an Android/...
5
votes
3answers
9k views

Are there any implementations of smart contracts in Python?

I want to implement some smart contracts and I am strongest in python.
7
votes
1answer
535 views

How to install and test Viper programming language?

Viper is a new functional, strongly typed, bounds/overflow-checking, fixed-point-decimal python syntax-based HLL. The repository does not inlcude any documentation yet. I built and installed ...