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
3 votes
1 answer
39 views

Can I import solidity code (or ABIs) into vyper?

Let's say I have a contract in solidity: pragma solidity 0.8.8; contract MyContract{ function getFive() public pure returns (uint256){ return 5; } } Could I import, inhert, etc in ...
user avatar
0 votes
1 answer
20 views

importing qs to a html/javascript page

I'm experimenting with 0x samples. I'm not a back-end dev so I'm NOT running NodeJS. I don't want to go full blown ReactJS on it so I built this html wrapper for the example 0x code for retrieving a ...
user avatar
0 votes
0 answers
30 views

How to import struct members from Solidity Library

Trying to implement the diamond upgrade following Nick Mudge implementation in aave. Been getting this error (struct member not found or not visible after argument dependent lookup in struct) ...
user avatar
0 votes
1 answer
26 views

How to import Openzep ERC20: Identifier not found

Can I get someone's perspective on why I'm unable to find the ERC20 contract I've npm install @openzeppelin/contracts. After import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; I get a ...
user avatar
  • 107
0 votes
0 answers
42 views

Importing: Identifier not found or not unique

Practicing to import some simple contracts from 2 other files ERC20_STD and NewGameOwner As you can see when I inherit from both contract NewGame is ERC20_STD, NewGameOwner{} VSC flags NewGameOwner ...
user avatar
  • 107
0 votes
1 answer
53 views

unbale to import smart contract into brownie scripts

I was trying to run a deploy script with brownie but i couldnt import required .sol smartContract into my scripts This is my folder structure My code in deploy.py from brownie import Fundme, accounts,...
user avatar
0 votes
0 answers
33 views

DeclarationError: "Identifier already declared" when compiling SmartContract with solc

I have a Smart Contract "MyCoin". It has another SmartContract "Dex" as dependency. MyCoin: import "./openzeppelin/contracts/token/ERC721/IERC721.sol"; // import "./...
user avatar
  • 29
0 votes
0 answers
16 views

Brownie import file that has imports with '@...' [duplicate]

I have this contract: pragma solidity >=0.8.0; import "Uniswap/v3-core@1.0.0/contracts/interfaces/IUniswapV3Pool.sol"; import "Uniswap/v3-periphery@1.3.0/contracts/interfaces/...
user avatar
0 votes
2 answers
166 views

Why does OpenZeppelin import interfaces to its own contracts?

I've noticed that all OpenZeppelin's token contracts import their interfaces into them. Why does OpenZeppelin import and inherit its own contract interface to the contract? Does importing a contract'...
user avatar
  • 372
0 votes
0 answers
12 views

How can i prevent created token use another account?

I have 2 account diferent metamask. Account A and account B. i deploy SimpleToken contract with account A and i get contract address on mumbai. Miner contract is import SimpleToken for mint and ...
user avatar
  • 1
0 votes
0 answers
179 views

how can I test add/remove owner to gnosis-safe wallet?

Related to How can I add/remove an owner to gnosis-safe wallet from solidity smart contract? I'm creating a module contract How can I test it now? With module contract. Any examples? I tried to do ...
user avatar
  • 33
0 votes
0 answers
19 views

Studying Alchemix's code base.. Why would they comment out the import ERC20 line?

I'm going over the Alchemix contracts on Github, the principle contract 'Alchemist.sol' contains a commented-out import at the beginning of the contract, what (if any) would be the reasoning behind ...
user avatar
0 votes
2 answers
111 views

having trouble importing web3

getting this import web3 error although pip install web3 was a successs
user avatar
  • 11
0 votes
0 answers
14 views

Check which imported functions are not used?

Openzepplin contracts are usually linked to multiple other contracts and there are usually multiple layers too. However, some imported functions are just not used. Is there a fast way to check which ...
user avatar
  • 13
0 votes
1 answer
23 views

What does import {} do?

For example, import { FlashLoanReceiverBase } from "./FlashLoanReceiverBase.sol"; FlashLoanReceiverBase.sol is here: https://github.com/aave/aave-protocol/blob/master/contracts/flashloan/...
user avatar
  • 1
1 vote
1 answer
343 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. ...
user avatar
  • 111
1 vote
1 answer
33 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 ...
user avatar
3 votes
1 answer
185 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
1 vote
1 answer
78 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 ...
user avatar
  • 230
0 votes
0 answers
216 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 ./...
user avatar
2 votes
1 answer
936 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 ...
user avatar
  • 31
0 votes
0 answers
51 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 ...
user avatar
  • 181
0 votes
0 answers
58 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?
user avatar
1 vote
0 answers
35 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 ...
user avatar
  • 11
0 votes
1 answer
63 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? ...
user avatar
0 votes
3 answers
485 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 &...
user avatar
1 vote
1 answer
452 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....
user avatar
0 votes
1 answer
30 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'...
user avatar
1 vote
1 answer
167 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 ...
user avatar
  • 35
0 votes
1 answer
75 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 ...
user avatar
4 votes
2 answers
2k 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. ...
user avatar
  • 709
2 votes
1 answer
80 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 ...
user avatar
  • 103
0 votes
0 answers
137 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 ...
user avatar
  • 212
0 votes
0 answers
11 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 ...
user avatar
  • 31
0 votes
1 answer
473 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&...
user avatar
  • 31
1 vote
1 answer
31 views

ParseError after a previously successful compile

I received a successful compile message: Compiling your contracts... =========================== > Compiling .\contracts\coffeeAccessControl\ConsumerRole.sol > Compiling .\contracts\...
user avatar
  • 31
1 vote
0 answers
53 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 ...
user avatar
0 votes
1 answer
403 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 ...
user avatar
0 votes
1 answer
578 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 ...
user avatar
2 votes
1 answer
1k 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-...
user avatar
  • 121
1 vote
0 answers
274 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 ...
user avatar
  • 113
0 votes
1 answer
840 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. ...
user avatar
0 votes
1 answer
66 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....
user avatar
0 votes
0 answers
591 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
  • 1,353
3 votes
2 answers
202 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 ...
user avatar
  • 400
1 vote
0 answers
189 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 ...
user avatar
  • 51
2 votes
1 answer
1k 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: ...
user avatar
  • 646
2 votes
1 answer
99 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 ...
user avatar
  • 646