Questions tagged [visual-studio-code]
The visual-studio-code tag has no usage guidance.
51
questions
0
votes
0
answers
16
views
ValueError: The private key must be exactly 32 bytes long, instead of 32 bytes
I am trying to run a brownie script in Visual Studio Code on a git bash terminal,
I have set up environment variables WEB3_INFURA_PROJECT_ID and PRIVATE_KEY. within a .env file
When I run my code I ...
0
votes
0
answers
17
views
facing error while compiling truffle in visual studio code
pragma solidity 0.8.4;
contract Hellowworld{
function hellow() public pure returns (string memory) {
return "hello world";
}
}
this is the simplest code I am using for ...
0
votes
0
answers
14
views
pip install web3 error
Below is my detailed query:
When i try to import web3, solcx, & dotenv, it gives me an error saying: Import "web3" could not be resolved Import "solcx" could not be resolved ...
0
votes
1
answer
28
views
How do I make sure I have enough gas for my transaction to go through. I get a value error whenever I try to deploy a contract in brownie
I am following Patrick Alphas tutorial using brownie https://youtu.be/M576WGiDBdQ
. I have a fund_and_withdrawl script that has been compiled . With that, I am trying to deploy a fundme contract on a ...
0
votes
0
answers
14
views
why vs code not recognizing the node version
when I install a "truffle for vs code" extension in vs code and try to create a new solidity project then nodejs version is not recognized but I have installed nodejs's correct version.
0
votes
1
answer
29
views
Cannot add JSDOC comments in .sol file in VS Code. Any help?
I have been trying to use JSDOC comments in my smart contract files (as many contracts already have), but my VS Code seems to be not picking up the structure using the usual commant of /** */
Although,...
0
votes
0
answers
47
views
vs code remix compiler does not work
I am using visual studio code with the remix extension. When I click compile nothing seems to happen, however truffle compile works just fine, but remix gets stuck at Remote version loaded.
Any ...
0
votes
0
answers
26
views
VS Code doesn't detect any code errors?
I installed Juan Blanco's Solidity add-on. I remember it would notify code errors, but now it just doesn't detect anything no matter what code is typed in the solidity files?
0
votes
0
answers
44
views
Etherjs intellisense vscode
I'm using hardhat along with etherjs in vscode and I'm writing some tests about my smart contracts. However, I can't make autocompletion and suggestion work regarding the different functions/...
0
votes
1
answer
35
views
Contract Development: How can I run an entire folder of scripts through Brownie?
I am trying to run my "deploy.py" file, and I was having trouble just deploying that at first, however, I figured that out. Is there a way that I can run every script under a certain folder ...
0
votes
0
answers
65
views
error Command "start" not found- Yarn
When I try to yarn start in VS code below error message shown. How to fix this?https://ethereum.stackexchange.com/users/2124/ismael
error Command "start" not found. Further, the package.json ...
1
vote
2
answers
60
views
Override Warning Showed Up in VSCode But Compile Not Error
I have a smart contract like this
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/...
2
votes
2
answers
230
views
NodeJs & Web3 having problem with VS Code IntelliSense (autocomplete)
I'm having issue with autocomplete of Web3 module members in the VS Code.
As can be noticed on the screen below web3.eth. not proposing any member of the module.
web3 module has been installed over ...
1
vote
0
answers
209
views
Solidity Formatting In VSCode
Hello everyone! Sorry for such a trivial question but after spending all day solving a pointless task I decided to ask smarter people 😅
The problem is simple.
I have a solidity extension by Juan ...
0
votes
0
answers
42
views
Is there a tool in VScode to predict optimal amount of gas price?
On MetaMask, it shows you the optimal (estimated) gas price (and you can even tweak it). Is there a similar tool for VSCode (Visual studio code) as well? Below is the screenshot of MetaMask:
0
votes
0
answers
42
views
Trouble compiling brownie with openzeppelin contracts
I have the following issue when I type "brownie compile":
New compatible solc version available: 0.6.6
Compiling contracts...
Solc version: 0.6.6
Optimizer: Enabled Runs: 200
EVM ...
0
votes
1
answer
473
views
Problem with using OpenZeppeling contracts with Hard Hat - not found: File import callback not supported
I was writing and testing my smart contracts in Remix where I was importing some contracts from OpenZeppelin, and now I want to move it to my project in VSC. But now my VSC is screaming with an error:
...
1
vote
1
answer
84
views
Brownie "No Module named"Users"" error
I keep on getting this error, following the Freecodecamp solidity tutorial. Brownie seems to be fine when making the accounts and adding private key like seen in video, and ganache-cli is installed ...
0
votes
1
answer
53
views
solc_version not working on VS Code (Mac OSX)
I tried running the code below and gave me the error message (bottom of post).
with open("./SimpleStorage.sol", "r") as file:
simple_storage_file = file.read()
print(...
0
votes
0
answers
24
views
Truffle deployment error in VS code [duplicate]
I am using Ganache and Truffle to deploy a practice smart contract from VS code. When I run:
HelloWorld.deployed().then(function(instance){return instance});
in the truffle development console, I get ...
2
votes
0
answers
244
views
VSCode Extension for auditing solidity code [closed]
I work as an auditor in the DeFi space, which means I get to dive into other people's code quite a lot in my everyday work.
I usually get to read several contracts in each project i'm working on, some ...
2
votes
2
answers
963
views
Brownie / Rinkeby ValueError: Gas estimation failed: "you must set the gas limit manually"
from brownie import AdvancedCollectible, accounts, config, network
from scripts.helpful_scripts import get_breed
import time
static_seed = 123
def main():
dev = accounts.add(config["wallets&...
0
votes
2
answers
188
views
Solidity Expected '(' but got identifier
So I am working on a flash loan arbitrage in solidity and was coding the arbitrage logic when I got hit with
Expected '(' but got identifier
here is the code for the arbitrage
function startArbitrage(
...
3
votes
3
answers
655
views
How to debug Brownie in VSCode?
How to debug Brownie program in Visual Studio Code? I suppose there should be some launch.json created but don't know which one.
0
votes
1
answer
36
views
Plugins to open deployed contract in IDE?
I can view contract code from the browser eg https://etherscan.io/address/0x8509d347caa93e7db87e0287ee51867bfcb7b9d2#code or on avax eg https://cchain.explorer.avax.network/address/...
0
votes
0
answers
66
views
Visual Studio different version of solidity compiler version
I have in my workspace different contracts and interfaces with different solidity pragram
For that, I am set in the hardhat-config.js following:
solidity: {
compilers: [
{
version: '...
0
votes
0
answers
43
views
Truffle : Source code in build/contracts/HelloWorld.json doesn't change after first migrate
build/contracts/HelloWorld.json
line 890:
"source": "// SPDX-License-Identifier: MIT\r\npragma solidity 0.8.7;\r\n\r\ncontract HelloWorld{\r\n function hello() public pure returns(...
0
votes
2
answers
272
views
Error: *** Deployment Failed *** -- Invalid number of parameters for "undefined". Got 0 expected 1!
I am trying to deploy my smart contract. Upon deployment, I get this error message.
Here is my contractToken.sol
pragma solidity ^0.5.2;
contract BPToken {
uint256 public totalSupply;
...
1
vote
2
answers
149
views
Getting an error even using the same compiler version (Visual Code)
I made a contract using Remix and it's working perfectly. When I create a project in Visual Code (in order to make a DApp) I'm getting this error when I import a source of Chainlink:
If I compile ...
0
votes
1
answer
476
views
Create and deploy NFT collectibles ERC721 collection with smart contract
I want to start developing with Solidity in my Visual Studio Code my first ERC721 Collectible NFT collection so i installed Visuall Studio Code first, then nodejs and npm and in the end Truffles and ...
1
vote
0
answers
78
views
What I have to do to write and copile solidity on VS code
I am new and I want to start build code in VS code.
So I added solidity (by Joun Blanco) to my VS and I need something else? (i mean node and npm)
I am sorry for stiupid question but I do not found ...
0
votes
1
answer
107
views
Create my first ERC721 Collectible collection (VS CODE) //Need Advice
I want to start developing with Solidity in my Visual Studio Code my first ERC721 Collectible collection so i installed Visuall Studio Code first, then nodejs and npm and in the end Truffles and ...
0
votes
3
answers
896
views
Truffle Install // npm WARN and Vulnerabilities -- How i solve that issues?
I want to start working with Solidity in my Visual Studio Code so i installed Visuall Studio Code first, then nodejs and npm and in the end i try to install Truffles.
-I work on Window 10 OS
-Nodejs ...
4
votes
3
answers
14k
views
Set up Solidity with VS Code - Beginner
I just started learning about Solidity and i want to learn more about smart contracts and all the universe about Solidity programming.
So i downloaded VS Code and i installed the Solidity extension in ...
0
votes
0
answers
47
views
Please help with Parsing Expected ',' but got ';'
I have looked far and wide for a solution and have read solidity documentation. Please help me find the parsing error in the code.
Thanks in advance.
var KiwiCoinSale = artifacts.require('KiwiCoinSale'...
9
votes
2
answers
8k
views
How to fix Solidity version missmatch from Visual Studio Code
So I have install the Solidity extension for Visual Studio.
V0.0.76
https://github.com/juanfranblanco/vscode-solidity
And when I start my Solidity code with
pragma solidity ^0.5.0;
I get the ...
2
votes
1
answer
442
views
Visual Studio Code's Solidity extension shows unecessary warnings/errors
I am using Juan Blanco's Solidity extension for VSC. I am noticing it is showing just too many warnings everywhere, including the OpenZeppelin contracts in the node_modules folder. Is there any ...
4
votes
1
answer
588
views
VS code Expected identifier, got 'LParen'solc
I keep getting this error/warning on my vscode when I emit events and build constructors.
or
After a bit of googling I understand it is something about my compiler, since solc <0.4.18 does not ...
4
votes
1
answer
805
views
VS Code and Solidity files have a lot of warnings
Every time I use VS Code to develop Solidity, files I have a lot of this weird warnings saying:
no-trailing-whitespace: Line contains trailing whitespace
I googled a bit and I understand why they ...
1
vote
1
answer
791
views
Truffle will not compile contract written in VS code. Pragma error
I'm trying to run example from https://truffleframework.com/tutorials/pet-shop, but when I run truffle compile I get error saying
Error parsing C:/WINDOWS/system32/TruffleTest/pet-shop-tutorial/...
5
votes
3
answers
2k
views
Error when calling the selfdistruct method in solidity
I am quite new to solidity, and I have not managed to find a solution for this problem.
I am passing the function an address but it says the following:
"Invalid type for argument in function call. ...
0
votes
1
answer
569
views
Data location must be "memory" for parameter in function, but none was given
I code my solidity contracts and I test in Remix Web IDE. When I test and I not get errors I copy to my project folder in my local machine. And all this errors appear in Visual Studio Code.
I can ...
7
votes
7
answers
6k
views
Solidity version error
I use Solidity Remix IDE for develop purpose. And when I finish I copy in VisualStudio Code and i attach to my project folder. But visual is telling me that i have a problem with the version. I can ...
5
votes
2
answers
3k
views
Why use VS Code IDE instead of remix?
I've seen that during the course of tutorials I am following, the intructors have gradually shifted over to Visual Studio code rather than use remix. I could not find any such explanation as to why ...
14
votes
8
answers
16k
views
Solved: How to change Solidity linter [solc] compiler version in Visual Studio Code?
Hi may I know how to change my Solidity linter compiler version in Visual Studio Code(vscode)? OR Visual studio code how to specify solidity compiler version?
The only Solidity related extensions I ...
7
votes
3
answers
804
views
VS Code Syntax error when emitting events in Solidity 0.4.21
I'm having a syntax error in VS Code in the parts where I emit events using new notation for Solidity v0.4.21.
Remix doesn’t raise any errors, though.
My User Settings in VS Code contain "solidity....
15
votes
2
answers
2k
views
How can I debug a truffle JS unit test with vscode?
I am using visual studio code and truffle and would like to easily debug my JavaScript tests.
A similar question has been asked here: how can I run a truffle test in a debugger?. This has been ...
1
vote
1
answer
408
views
Specify Token Price
I'm pretty much new on this. But I really want to learn.
I just created a contract for mintable token on Kovan test-net. But, I'm getting confused when I try to buy the token, it's always shown x000....
4
votes
2
answers
6k
views
How to use solidity extension for visual studio code?
I am new to Ethereum and I am using visual studio code as an editor for solidity.
I wrote a simple program and save it with .sol extension.
pragma solidity ^0.4.0;
contract SimpleStorage {
uint ...
1
vote
3
answers
2k
views
Syntax highlighting for Solidity VS Code extension not working on linux
Even if the extension installation completes correctly, syntax highlighting does not work.