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
0
votes
1answer
28 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 ...
0
votes
0answers
17 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
34 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
44 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
23 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
14 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
114 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
163 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 ...
2
votes
2answers
113 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
52 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 ...
0
votes
1answer
115 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
42 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
1answer
268 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/...
1
vote
1answer
279 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
216 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
15 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
1k 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
187 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
61 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; ...
0
votes
0answers
186 views

How to backup and restore a Geth server in full mode?

I had the experience of losing a Geth server due to some unknown software issues and whatever I could do for that time was moving keystore files to a new server. But it was a Geth server in fast mode. ...
2
votes
1answer
1k 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
519 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
52 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
204 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
197 views

What are remappings and how do they work in solidity?

How can they be used with solc?
0
votes
1answer
1k 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
75 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 ...
0
votes
1answer
85 views

Can't import a contract interface in vyper

I need to import a contract interface using the JSON ABI but I get syntax error when trying to import the interface. I have created the JSON file in remix and named it IERC1620.json then I am trying ...
0
votes
0answers
304 views

Node: How Can I Import Web3 To Node.js?

I'm trying to import the web3 library in Node.js so that I can handle Ethereum smart contract events, however I can't get the import to work. I'm running Babel on each file to convert to es5, and the ...
0
votes
1answer
121 views

Import dependencies which rely on additional dependencies

I'm using truffle to create a contract that extends another contract in a GitHub repository e.g. contract Consumer is Chainlinked { } My first problem is that I an unable to import directly from a ...
2
votes
0answers
41 views

Can I import a Library from a Library?

Is it possible to import a library into another library? I give a simplified example below of what I'd like to achieve: library structLib { struct Point { uint X; uint Y; } } ...
1
vote
1answer
446 views

“Cannot import url”, “File outside of allowed directories” using --standard-json

I'm trying to understand how to use solidity's JSON input-output API. Here's my json file; { "language": "Solidity", "sources": { "StandardToken.sol": { "urls": [ "file:///home/...
0
votes
1answer
635 views

Call to a external function

I have two solidity files. Im trying to get access to one function that is in the second solidity file. I the first contract I import the file. import "./DateTime.sol"; How can now acced to one ...
1
vote
3answers
3k views

How can import one contract functions in solidity

Looking at the solidity documentation i don´t find a date type. Searching in the web I find a GitHub repo that appear one contract that give the posibility to work with date. https://github.com/...
0
votes
1answer
3k views

how to import multiple files on remix IDE using github url?

i'm using the following way! but got error URL not parseable: Ownable.sol!! import "github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol";
0
votes
1answer
105 views

While compiling contract i got an error “Error: Could not find path from any sources; imported from path”

pragma solidity ^0.4.22; import './NewToken.sol'; import 'zeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol'; import 'zeppelin-solidity/contracts/crowdsale/validation/...
2
votes
2answers
3k views

How do I import from / install OpenZeppelin properly?

I'm a newb dev and want to play with smart contracts, and was trying to figure this out. Ive installed truffle and openzeppelin, everything seems to check out, but in Mist I still get an error when I ...
1
vote
1answer
1k views

Error compiling OpenZeppelin imported contracts

I'm running a truffle project and have imported OpenZeppelin contracts. While running truffle compile I'm facing following error: github.com/OpenZeppelin/openzeppelin-solidity/contracts/crowdsale/...
2
votes
1answer
2k views

DeclarationError: Identifier already declared. Two imports import the same ERC721 contract

Im building a contract that uses two contracts that both use the ERC721 zeppelin contract, when I import the two as such: import nonFungableWidthAddedFunctionality1.sol; import ...
0
votes
2answers
631 views

How does an Import Wallet work in Ethereum?

How to provide import wallet option in Ethereum bloackchain? How does is imports/ how import wallet works?
0
votes
1answer
880 views

Import account from one geth node to another geth node

I had a geth node where i created an account. Then i backed up the keystore folder just in case. I had to format the pc and install geth again. So i would like to know how can i import my old account ...
1
vote
2answers
273 views

Solidity import Tensor Flow Libraries?

Like how we import oraclize in Solidity (as follows), is there some way to import tensorflow libraries for machine learning purpose? import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
0
votes
1answer
2k views

Restore wallet in Exodus using JSON file

I've a wallet file in the JSON format with address, cipher, ciphertext, salt, etc (version 3). How can I restore it into Exodus wallet? In Developer menu I can only see Restore from 12-word phrase......
0
votes
1answer
94 views

Best practices for importing contracts (Github vs. Including in project)?

On the remix docs, it gives examples of importing contracts from source either locally or from github. I'm wondering for importing standard contracts (like say, OpenZeppelin's ERC20 StandardToken) ...
2
votes
3answers
2k views

How to use Solidity solc to compile A.sol that imports B.sol file?

I know how to install solc via "npm install --save solc" then use solc.compile to compile one sol file. But now I've got A.sol file that imports B.sol file, and when I run node compile.js, no error in ...
0
votes
1answer
419 views

How can I import Rinkeby account to metamask after deploying my contract to Rinkeby test network? [duplicate]

I finished deploying(compiled and migrated) my contract to Rinkeby test network. So, now I'm trying to go to MetaMask and clicked on Rinkeby TestNet and don't know what to do after. How do I get my ...
0
votes
1answer
349 views

how to import UTC-JSON file through web3-eth methods

hey I am working on ethereum wallet. in this i want to import my account through UTC json file, but i didn't find any solution for this in web3-eth command someone can please help to find out the ...
3
votes
0answers
262 views

Backup blockchain from a running geth fullnode

I need to make backups from my running node to be able to start a second node quickly or to restore the node quickly if it gets corrupted. Does geth export work on a running node? is it a good option ...
2
votes
0answers
915 views

Importing files from an “outside” folder

I am trying to import files from a relative path outside of my Truffle-project folder: import '../../../common/solidity/contracts/token/ERC20/BurnableToken.sol'; import '../../../common/solidity/...
4
votes
2answers
594 views

Importing private key: Why is it so fast?

I've just imported two private keys with both, geth and the zcash-cli. While the zcash-cli (a public t.* address) took more than 15 minutes* (I guess it scanned the whole blockchain), geth was ...