Questions tagged [import]

This question is related to importing one file to another which means content of imported file is partially or fully accessible to this file.

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

Account Extended Private Key / BIP32 Extended Private Key need to import MetaMask?

I would withdraw ETH from my Binance account and give ETH as christmas gift to my nephew and my niece. 1: Is it any drawback in a long run if I use not the ETH network but BSC? In 10-20 years or so. ...
1
vote
1answer
19 views

Changing imports for a contract that has been deployed

I am very new to writing smart contracts and deployed one via remix.ethereum. However, during the process I imported the wrong dependency links and need to change them. I know smart contracts are ...
1
vote
1answer
53 views

Why do many Solidity projects prefer importing specific names over whole modules?

In the Solidity docs and also in OZ libaries, I mainly find this way of importing : import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol"; But in most ...
0
votes
0answers
20 views

I can't import my Geth account, where do I get the 64 hex character while my UTC file shows only the mac I've loaded and it said too short

please give a solution. I can't Import my geth account. It said: C:\Windows\system32>geth account import --datadir value 092426c0333f315bd569f279d***** Fatal: Failed to load the private key: key ...
1
vote
1answer
17 views

Does Ethereum have a builtin package manager to prevent code duplication?

Does Ethereum have a package manager that is hosted on chain to mitigate code duplication? I've been learning Solidity development in brownie and as per my understanding in the brownie-config.yaml you ...
0
votes
0answers
89 views

Brownie Compile can't resolve solidity relative imports

This was working for me earlier, and now it's failing and I don't know why. I'm able to reproduce with this simple test case. I run brownie init in a clean directory, put the following two files in ./...
2
votes
1answer
254 views

Failed brownie import when running scripts

I am trying to setup eth-brownie to get a feel of the framework but face a couple of import-related problems. Im working from a MBP running macOS with Catalina v10.15.7 $ python --version Python 3.9.9 ...
0
votes
0answers
22 views

What is the right way to put import statement when trying to import contract or library files to current contract which is inheriting other contract?

I'm confused where to put import statement when trying to import contract files or library files and use it at current contract which is inheriting other contract. It was the long words, so here is ...
0
votes
0answers
29 views

Which mobile wallets lets you sweep or import an Ethereum private key from a paper wallet?

There are so many mobile wallets now, but which ones let you sweep or import an ETH private key?
0
votes
0answers
13 views

Undeclared identifier when using function from imported file

I want to import this function in another contract but I received the error from the screenshot below. This is the function I want to import: function assetTransfer (string memory order_id,string ...
0
votes
1answer
28 views

Relative import issue while testing brownie

I am using brownie to interact with my Ethereum smart contracts. The scripts and tests are located in parallel scripts/ and test/ folders. How can I access the functions from scripts/ in test/ files? ...
0
votes
2answers
162 views

Can't compile Truffle project that imports a .sol with different pragma version

I have a contract pragma solidity 0.6.12 version that imports several 0.6.12 version contracts and one pragma solidity 0.8.0. My truffle-config: compilers: { solc: { version: "^0.6.12 &...
1
vote
1answer
158 views

Getting a compile error every time I try to compile a contract with Brownie that includes an import statement from the web

I have a contract that starts with the following import statements: import 'https://github.com/aave/protocol-v2/blob/master/contracts/flashloan/base/FlashLoanReceiverBase.sol'; import 'https://github....
0
votes
1answer
18 views

I staked ZRX through Metamask on OX Protocol and it was an account linked to my Exodus Wallet. now I can't link to my staking

ok connected metamask to stake ZRX on OX protocol. imported OX keys from my exodus wallet to a new account in metamask. seemed to work for a bit then one day i tried to check on things and it wouldn'...
0
votes
0answers
20 views

Where to find SafeMath pragma solidity ^0.6.6?

While trying to use SafeMath to compute the modulo of a uint256 like shown in this video:https://www.youtube.com/watch?v=JqZWariqh5s (without SafeMath) I'm having some trouble finding a pragma ...
0
votes
1answer
41 views

OpenZeppelin import problem

I am trying to import a couple of OpenZeppelin contracts to my project, but each time I am given an error related to unsuccessful imports from sources. I'm gonna attach a screenshot of my code. I have ...
4
votes
2answers
809 views

How to use contracts from project dependencies in Brownie scripts?

I want to deploy a contract directly accessible in OpenZeppelin/openzeppelin-contracts@4.2.0 Brownie package without changes, namely ERC1967Proxy and other non-abstract contracts from Brownie console. ...
2
votes
1answer
41 views

searching for an elegant solc compiler solution

I firstly had a problem with import statement inside my contracts, I figured out that the solc compiler didn't handle import statement, and that we needed to make out own. With the help of some nice ...
0
votes
0answers
90 views

Import Open Zepplin Contracts from Github

I'm trying to write a simple aggregator for aave, (I couldn't find a good example for one which uses aave V2) So I decided to cheat, and piece meal things together off of Polycats Github I noticied ...
0
votes
0answers
10 views

Checking the Host Filesystem

I'm unable to compile using truffle in WebStorm due source not found during an import. I've replicated and successfully compiled the file structure in Remix, as well as from a very kind user who test ...
0
votes
1answer
138 views

DeclarationError: Identifier already declared

I'm getting the below compile error message: DeclarationError: Identifier already declared. --> contracts/coffeeBase/SupplyChain.sol:9:1: | 9 | import "../coffeeAccessControl/ConsumerRole.sol&...
1
vote
1answer
26 views

ParseError after a previously successful compile

I received a successful compile message: Compiling your contracts... =========================== > Compiling .\contracts\coffeeAccessControl\ConsumerRole.sol > Compiling .\contracts\...
1
vote
0answers
32 views

Openethereum/parity import export

anyone has used export to take a backup and import to load data in openethereum(parity) blockchain? please provide information I have tried export .rlp file and it works but when trying to import ...
0
votes
1answer
147 views

Is it possible to import smart contracts with different compiler versions?

I'm using hardhat to compile my contracts. I am aware that hardhat is good at compiling contracts with different pragma versions, however, the contracts can't compile because they're importing ...
0
votes
1answer
469 views

restore a deleted imported metamask account

i had my metamask wallet stoled, and my first reaction was delete the stole account. But this account has some pools os pancakeswap, and i need to restore it to save my tokens. I have the seed phrase ...
2
votes
1answer
721 views

ImportError: cannot import name 'Accounts' from 'brownie.network.account'

Setup MacOS Catalina v10.15.6 IntelliJ Ultimate v2020.1.1 Python v3.7 eth-brownie v1.14.6 Ganache CLI v6.12.2 I created a VENV using my Python 3.7. Following Patricks tutorial, I have installed eth-...
1
vote
0answers
134 views

Event name conflicts and data out-of-bounds error in Remix

I have been getting a weird errored: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.1.2) error when testing contract functions in Remix, even though it goes through ...
0
votes
1answer
434 views

Inheritance, Imports and Remix

This is the LSP3Account contract: https://github.com/lukso-network/standards-implementations/blob/master/contracts/Accounts/LSP3Account.sol I want to create a contract on Remix that inherits from it. ...
0
votes
1answer
46 views

1INCH Version error

I got error importing and using 1INCH. The problem is in the versions. In IOneSplit.sol version is 0.5.0 (pragma solidity ^0.5.0). And IOneSplit imports IERC20 which is in 0.8.0 (pragma solidity ^0.8....
0
votes
0answers
24 views

Simple Factory Contract is much Larger than its Child Contract

I coded a very simple factory contract: pragma solidity ^0.7.3; import "hardhat/console.sol"; import "./Pair.sol"; contract Factory{ mapping(address => mapping(address =&...
0
votes
0answers
461 views

Private key opens a different address than the one that it "should"

I have a small problem (hope it doesn't prove to be huge) with importing wallets using private keys. I am not the most knowledgeable when it comes to Ethereum, and was hoping you guys could maybe help ...
0
votes
1answer
1k views

How to import and compile contracts of different versions solidity

How to import and compile contracts of different versions using solidity in remix? When I import a contract I get this error: ParserError: Source file requires different compiler version (current ...
3
votes
2answers
161 views

What happens if GitHub path for import changes?

I wondered what happens if for example OpenZeppelin changes the path of a contract I have imported like this: import "@openzeppelin/contracts/token/ERC721/ERC721.sol";? Will my contract ...
1
vote
0answers
143 views

Able to Import my Account from Geth to MetaMask but No Balance Shown

I'm able to mined to my Accounts in Geth and have successfully imported to MetaMask. Problem, is in my Geth Console, I have the balance of the Mined Accounts but after imported to MetaMask, the ...
1
vote
1answer
611 views

Why use the Interface (IERC20), instead of the implementation contract (ERC20)?

I'm playing with a contract that uses an ERC20 token, and I can see basically 2 options to init the token: Use the interface contract (IERC20) Use the implemented contract (ERC20) Interface version: ...
2
votes
1answer
82 views

How can Uniswap instance ERC20 tokens without importing code?

I was checking Uniswap contracts github repo and I don't understand exactly how can they dynamically use any ERC20 tokens without importing the code or having the ERC20 token smart contract address. I ...
0
votes
2answers
1k views

Troubles with import in Remix IDE

I have the following error when try to compile: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol:5:1: ParserError: Source "https://github.com/...
2
votes
1answer
714 views

Way to import library in a solidity smartcontract

I am studying smart contracts and I have looked at some popular projects on GithHub. I have seen imports like this: import "@openzeppelin/contracts/math/SafeMath.sol"; and like that: ...
0
votes
1answer
357 views

Import wants >=0.6.0 but the import of the import is ^0.5.0

that solidity compiling is a mess :frowning: I’m trying hours to find out why my contracts sometime compile and sometimes not … Now I got it … I'm using a local ganache server and the online IDE remix....
0
votes
1answer
25 views

theres a way to automatically import all imports you need in contract (that are on your computer) to remix ide

I have a remix ide contract and somehow I added all the imports automatically from my computer files im assuming. Does anyone know how to replicate this as i am trying to do it again and cannot find ...
0
votes
0answers
3k views

Unable to import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol": File not found

Am trying to comply this code on remix and then deploy it. But am getting this error when trying to compile the code. i might need your help please. Here is the error am having "'Unable to import ...
1
vote
1answer
729 views

Why does the creationCode of this contract change if a change is made in the importing contract?

For the following: pragma solidity >=0.5.0; contract Include { uint z = 1; } contract CreationCode { uint k = 1; function get() external returns (bytes32) { return keccak256(...
2
votes
1answer
106 views

How can I use "@" (at sign) syntax with Remix?

I've seen multiple times Solidity contracts, which are using import "@somename/.../SomeContract.sol" syntax. Here's the example: pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; ...
2
votes
1answer
2k views

Geth light keeps showing "Looking for peers"

My Geth server in light mode was running without any issue up to yesterday. But after that, I only receive these messages continuously! INFO [04-19|12:59:22.181] Looking for peers ...
0
votes
1answer
716 views

Contract import from GitHub gives an error "Unable to import "undefined": TypeError: Failed to fetch"

This would be an old issue, but the solutions I have seen on this site aren't working. I'm trying to import a contract of OpenZeppelin to my Remix IDE. import "https://github.com/OpenZeppelin/...
1
vote
0answers
69 views

Migration from PoW to PoA Clique on geth

After reading chapter "Repurposing header fields for signing and voting" at https://eips.ethereum.org/EIPS/eip-225 I've understood the nonce field of blocks in PoW consensus blockchain is reused for ...
1
vote
0answers
318 views

Contract can't import remote repository locally

I made a compiler script that takes all contracts in folder ./contracts/ and produces a .json for each contract, containing an ABI and Bytecode. This worked fine for a while. However, I added some ...
3
votes
1answer
532 views

What are remappings and how do they work in solidity?

How can they be used with solc?
0
votes
1answer
3k views

"onlyOwner" Function restrict the call from child contract

I have a basic knowledge of solidity. I am trying to create an upgradable ERC20 Token. For that, I create TokenStorage contract and Logic contract and trying to write the Proxy contract. In the Logic ...
0
votes
1answer
129 views

Importing Ethereum Account Private Key and Using on Different Servers

Let's suppose i have a wallet on one remote server, R-1. Is it possible to get the private key of that wallet/account and use it on different remote server R-2? I know, i can copy/paste files under ...