solidity

Web3 python crypto cypher issue on M1 Mac

Web3 python crypto cypher issue on M1 Mac Question: When I try to build a blockchain transaction using Web3 on python, I’m getting an error that is apparently because I’m using an Apple Silicon computer (2020 M1 MacBook Pro). I’m following a popular Solidity, Blockchain, and Smart Contract course on YouTube and I’m unable to …

Total answers: 2

How do i upload a folder containing metadata to pinata using a script in python-brownie?

How do i upload a folder containing metadata to pinata using a script in python-brownie? Question: I’ve been trying for the past 24 hours but can’t find a solution. This is the code: import os from pathlib import Path import requests PINATA_BASE_URL = "https://api.pinata.cloud/" endpoint = "pinning/pinFileToIPFS" # Change this filepath filepath = "C:/Users/acer/Desktop/Ciao" filename …

Total answers: 1

Hedera-sdk-py Smart Contract Deployment and Querying

Hedera-sdk-py Smart Contract Deployment and Querying Question: I am creating a DApp on the Hedera Blockchain using Hedera-sdk-py, a python wrapper of Hedera SDK in Java. I want to create a smart contract, deploy and query it, but I can not seem to understand the stateful.json file in the documentation (https://github.com/wensheng/hedera-sdk-py). Is the stateful.json a …

Total answers: 2

How to install web3 on vscode without having all these issues?

How to install web3 on vscode without having all these issues? Question: here is the code I’m trying to run (from Patric’s course), please consider that this is my first time into coding and it has been two weeks trying to solve this issue ! from solcx import compile_standard from web3 import Web3 import json …

Total answers: 2

How to get the price of BSC token directly the token pool contract in web3.py

How to get the price of BSC token directly the token pool contract in web3.py Question: I’m trying to get the price of some BSC token directly from the contract. Doing some searches, I found a mix of ideas with the snippet below. I’m sure the code is off because when I checked on https://pancakeswap.finance/swap …

Total answers: 1

smart contract with brownie gives VirtualMachineError

smart contract with brownie gives VirtualMachineError Question: I encontered a problem when I test my project, any help would be greatly appreciated. All my code can be found in here: https://github.com/Karlus44/smartcontract-lottery When I type the command brownie test my script tests/test_lottery_unit.py is exectuted, and my different tests are submitted. Here some quotes of my logout: …

Total answers: 3

Brownie: CompilerError: File outside of allowed directories

Brownie: CompilerError: File outside of allowed directories Question: I’m trying to import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" to my contract but i encountered this error. CompilerError: solc returned the following errors: contracts/Lottery.sol:4:1: ParserError: Source "C:/Users/Алексей/.brownie/packages/smartcontractkit/chainlink-brownie [email protected]/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" not found: File outside of allowed directories. import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; ^————————————————————————–^ This is my contract (Lottery.sol): // SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; …

Total answers: 2

The transaction declared chain ID 5777, but the connected node is on 1337

The transaction declared chain ID 5777, but the connected node is on 1337 Question: I am trying to deploy my SimpleStorage.sol contract to a ganache local chain by making a transaction using python. It seems to have trouble connecting to the chain. from solcx import compile_standard from web3 import Web3 import json import os from …

Total answers: 6

How to create an account on Brownie

How to create an account on Brownie Question: I am looking to create accounts on Brownie for deploying contracts but I am not sure how to do this. I have looked online how to do this and I havent found it. I am running python 3.7 and have brownie installed and working as intended. I …

Total answers: 2

ParserError: Source file requires different compiler version

ParserError: Source file requires different compiler version Question: I tried all that you mentioned in the discussion here (in other questions) and at https://github.com/smartcontractkit/full-blockchain-solidity-course-py/discussions/522 , however it is not solving the issue for me, I also noticed that the current compiler version remains (current compiler is 0.6.12+commit.27d51765.Windows.msvc). But when I right click and select Solidty:Compiler …

Total answers: 5