question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploying vyper contract throws InvalidType

See original GitHub issue

Environment information

  • brownie Version: 1.19.1
  • ganache-cli Version:
  • solc Version: 7.0.4
  • Python Version: 3.8.10
  • OS: linux (ubuntu 20.*)
  • Vyper: 0.3.4+commit.ac8cb6e6

What was wrong?

When trying to deploy a vyper contract using brownie, it throws an error

ethbox@ethbox-VirtualBox:~/Vyper-Main/ERC1155$ brownie run deploy1155.py
Brownie v1.19.0 - Python development framework for Ethereum

Compiling contracts...
  Vyper version: 0.3.4
Unhandled exception in 'contracts/ERC1155ownable.vy':
InvalidType: Subscript must be a literal integer
  contract "contracts/ERC1155ownable.vy", line 35:16 
       34 # the contracts URI to find the metadata
  ---> 35 baseuri: String[MAX_URI_LENGTH]
  ------------------------^
       36 contractURI: public(String[MAX_URI_LENGTH])

MAX_URI_LENGTH is an uint256 with value 300

MAX_URI_LENGTH: constant(uint256) = 300 

When compiling directly with Vyper, the compilation is successful.

ethbox@ethbox-VirtualBox:~/Vyper-Main/ERC1155$ vyper ./contracts/ERC1155ownable.vy -f combined_json
{"contracts/ERC1155ownable.vy": {"bytecode": "0x602061281e600039600051600001608060208261281e0160003960005

How can it be fixed?

I don’t know

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
Doc-Pixelcommented, Jul 6, 2022

I’ll create an issue on the vyper repo

0reactions
Doc-Pixelcommented, Jul 6, 2022

Closed, is a vyper issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vyper Documentation
to deploy the contract on the blockchain, which is not returned. We assert that the deposit is divisible by 2 to ensure.
Read more >
Solidity vs Vyper explained - step-by-step beginners guides
One hard rule about developing on the blockchain is that any smart contracts that are deployed cannot be altered. Smart contracts are often...
Read more >
Hardhat errors | Ethereum development environment for ...
You tried to run Hardhat from a global installation or not installing it at all. ... One of your Hardhat or task arguments...
Read more >
Value must be a literal - Vyper Ethereum smart contract - Stack ...
this call of a for loop: for i in range(self.some_uint256): # do something... is throwing the error: StateAccessViolation: Value must ...
Read more >
Ethereum - Bountysource
VIP: `msg.data` $ 0. Created 3 years ago in vyperlang/vyper with 8 comments. ... When trying to deploy a vyper contract using brownie,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found