Questions tagged [vyper]

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

31 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
28 views

How to make a multiplication and division without overflow and any loss of precision in Vyper

How can I calculate X * Y / Z in vyper uint256 without overflow and any loss of precision? I want to build Vyper FullMath library functions similar to the Uniswap V3 FullMath library written in ...
3
votes
0answers
32 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 ...
2
votes
0answers
149 views

How to get the error message from a failed transaction with web3?

My smart contract has the following piece of code: # check if the election has begun. begin and end time must be in the future and in unix timestamp assert block.timestamp < self.elections[...
2
votes
1answer
563 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/...
1
vote
2answers
37 views

Swapping my own ERC20 token for USDC and back - Vyper contract

I want to create a very simple swap between my own ERC20 and USDC. I'm coding this all in Vyper and Python. One way I have envisaged this working is by monitoring the USDC Transfer events on the ...
1
vote
0answers
13 views

raw_call issues vyper

I am trying to do a swap using quickswap on polygon network with my contract below. After deploying my contract I get this error when executing the function: Internal JSON-RPC error. { "code"...
1
vote
1answer
166 views

How to input decimal parameter in web3.py?

I have a contract with this abi [ { "stateMutability": "nonpayable", "type": "constructor", "inputs": [ {"name": "...
1
vote
1answer
15 views

Simple Remix Fail

has anybody any idea why the following code cannot be compiled on REMIX with the VYPER COMPILER? @public @constant def hello() -> string[100]: return "hello world" Thanks!
1
vote
0answers
31 views

Convert uint256 to String[x] in vyper?

The documentation contains, as one of the Data Manipulation built in functions, the function concat(); the example given is @external @view def foo(a: String[5], b: String[5], c: String[5]) -> ...
1
vote
0answers
56 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 ...
1
vote
1answer
119 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 ...
1
vote
1answer
339 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, ...
1
vote
0answers
46 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
210 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 ...
0
votes
0answers
5 views

Can not send tokens to contract - Vyper

I have deployed a normal Vyper ERC20 contract and also created the below contract to interact with this. What I would like to do, is to transfer my ERC20 tokens to this contract (by calling the ...
0
votes
0answers
28 views

msg.sender and msg.value - do they work only for sent Etherum or do they work for ERC20 tokens sent to the contract too?

I'm starting to learn Vyper and I wanted to ask a question regarding msg.sender and msg.value If I created a simple contract that simply returns msg.sender and msg.value I understand that if I sent ...
0
votes
0answers
16 views

Best practice for ecrecover in Vyper

What is the best practice for using ecrecover in Vyper? Because of signature malleability OpenZeppelin recommends to use their version of ecrecover for Solidity https://github.com/OpenZeppelin/...
0
votes
0answers
17 views

Vyper uint256 division with decimal precision

I am aware of this question here and the answer is correct however I am struggling to understand how to actually divide uint256 values with an arbitrary decimal precision Here is the function I am ...
0
votes
0answers
19 views

Executing functions from a contract address

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol#L57 Line #57 of Address.sol is used to execute a transaction that transfers ether from the contract ...
0
votes
0answers
213 views

Remix: Gas estimation errored with the following message (see below). (...) execution reverted

I am trying to deploy a smart contract on remix written in VYPER. The code for the simple open auction comes from the vyper documentation website. Remix compiles the code perfectly fine. However, when ...
0
votes
0answers
37 views

Vyper Smart Contract deployment using web3.py, Clique PoA

I am new to Blockchain Dapp development so bear with me if I sound a bit out of court. Coming from a Python background, I am trying to use web3.py to create, deploy and interact with vyper ^0.2.0 ...
0
votes
1answer
33 views

full stack dapp clone example elastic supply algorithmic stablecoin

I'm new to vyper (but have some python experience), I would like to clone a very simple dapp to have a look at the full stack of an ethereum dapp from back end (write compile and deploy a simple ...
0
votes
0answers
24 views

try except in Vyper language

I want to call a function on an external contract from a Vyper contract. I want to handle a potential revert of this call. Python try...except is not implemented in Vyper. What should i do instead ? ...
0
votes
0answers
10 views

External call with Vyper

I want to call another contract from my vyper contract. I have read several tutorials and documentations and there is 2 ways to do that: First method: interface MyExternalContract: def ...
0
votes
1answer
43 views

Only int128 and uint256 int types in vyper

I have read vyper documentation and there is something strange: I only see uint256 and int128 data types for integer values. There is no way to create an uint8 for example in vyper ? Thanks
0
votes
0answers
96 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 ...
0
votes
1answer
38 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 ...
0
votes
0answers
54 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
23 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....
0
votes
0answers
227 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 ...
0
votes
1answer
378 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 ...