Comments (10)
What is the state of this issue? I did the following:
$ dapp install OpenZeppelin/openzeppelin-contracts
$ ln -s contracts lib/openzeppelin-contracts/src
and in Solidity, I can then import "openzeppelin-contracts/utils/cryptography/MerkleProof.sol";
. Since this issue was opened in 2019, have things improved such that this issue is maybe already resolved?
from dapptools.
If you don't like using the full relative path as @asymmetric suggested, then I think it's probably cleaner to make use of the DAPP_REMAPPINGS
environment variable.
You can run dapp remappings > remappings.txt
to get a list of the default import remappings that will be passed to solc during compilation. You can then modify the remappings.txt
to allow arbitrary custom import paths. Finally, you can then set DAPP_REMAPPINGS=$(cat remappings.txt)
, and the custom remappings will be applied.
Anyway, I agree this issue can definitely be closed.
from dapptools.
Comment by nmushegian
Saturday Jan 06, 2018 at 19:34 GMT
@dbrock can tell you whether it's possible to alias the src
dir, I'll suggest another approach though:
Have you looked at DSToken
? dapphub/dapp#70
dapp install ds-token
should give you what you need
from dapptools.
Comment by fccoelho
Saturday Jan 06, 2018 at 20:01 GMT
Sure, I could also completely give up on importing contracts from
libraries and instead write my own. But code reuse is the whole point of
open-source software: to avoid repeating the same mistakes over and over.
It seems that dapp is making unnecessary assumptions about how external
solidity code is packaged, making it harder to reuse other libraries.
Em 6 de jan de 2018 17:34, "Nikolai Mushegian" [email protected]
escreveu:
@dbrock https://github.com/dbrock can tell you whether it's possible to
alias the src dir, I'll suggest another approach though:
Have you looked at DSToken? #70 dapphub/dapp#70
dapp install ds-token should give you what you need
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
dapphub/dapp#70 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIjW9SeBQDDnQq9L__Gqx6Wq2n1Ey1zks5tH8rMgaJpZM4RM7Qr
.
from dapptools.
Comment by dbrock
Sunday Jan 07, 2018 at 16:15 GMT
Thanks for opening this issue.
This is not currently directly supported, as dapp
expects all source directories to have the same name ($DAPP_SRC
, which defaults to src
).
The following is probably the easiest workaround:
ln -s contracts lib/zeppelin-solidity/src
echo /src >>.git/modules/lib/zeppelin-solidity/info/exclude
There is no reason why this shouldn't be supported out-of–the-box (or with some configuration). We simply haven't had enough need for it yet, and you are one of the first users to want to do it.
from dapptools.
Comment by fccoelho
Sunday Jan 07, 2018 at 17:48 GMT
Thanks for responding. Even though I know dapphub is offering their own set
of base contracts, I believe interoperability with other projects is an
important feature.
Em 7 de jan de 2018 14:15, "Daniel Brockman" [email protected]
escreveu:
Thanks for opening this issue.
This is not currently directly supported, as dapp expects all source
directories to have the same name ($DAPP_SRC, which defaults to src).The following is probably the easiest workaround:
cd lib/zeppelin-solidity
ln -s contracts src
echo /src >>.git/info/excludeThere is no reason why this shouldn't be supported out-of–the-box (or with
some configuration). We simply haven't had enough need for it yet, and you
are one of the first users to want to do it.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
dapphub/dapp#70 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIjW1cvkP1xuiBQwZhySrLl0ecIjznRks5tIO26gaJpZM4RM7Qr
.
from dapptools.
Comment by wjmelements
Monday Mar 12, 2018 at 09:23 GMT
To add on to @fccoelho, many repos use contracts
instead of src
for their solidity. Prominently:
- omisego
- OpenZepplin
- DigixGlobal
- Populous
- VeChain
Using src
:
- EOSIO
- MakerDAO
from dapptools.
Comment by fccoelho
Monday Mar 12, 2018 at 12:00 GMT
The root path for the solidity code could become a configuration variable,
facilitating the integration of other codebases.
On Mon, Mar 12, 2018 at 6:23 AM, William Morriss [email protected]
wrote:
To add on to @fccoelho https://github.com/fccoelho, many repos use
contracts instead of src for their solidity. Prominently:
- omisego
- OpenZepplin
- DigixGlobal
- Populous
- VeChain
Using src:
- EOSIO
- MakerDAO
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
dapphub/dapp#70 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIjWxqyZWSLF2u34PtOIQTaGOnSXsogks5tdj57gaJpZM4RM7Qr
.
--
Flávio Codeço Coelho
+55(21) 3799-5551
Professor
Escola de Matemática Aplicada
Fundação Getulio Vargas
Praia de Botafogo, 190 sala 312
Rio de Janeiro - RJ
22250-900
Brasil
from dapptools.
Comment by rainbreak
Monday Mar 12, 2018 at 14:51 GMT
The root path is configurable, via the DAPP_SRC
environment variable. Have you tried the workaround above to see if it works? That would be a good starting point so we can figure out how to do this.
from dapptools.
Alternatively, you can just use a git submodule to get the contract's code where dapp
expects it, and import it into your contracts the traditional way, i.e. by its relative path.
from dapptools.
Related Issues (20)
- License seems very ambiguous. HOT 1
- hevm VMFailure when following dapp tutorial symbolic execution HOT 5
- seth output error HOT 5
- Ledger -- ethsign: failed to sign tx HOT 1
- contract not found HOT 1
- hevm: XXXX: openBinaryFile: does not exist (No such file or directory)
- Octo-dapp
- error: Please run this script as a regular user when installing in an Image via Dockerfile
- stuck installing "EVM.FeeSchedule" on OSX at 100% CPU HOT 3
- Slow symbolic execution of the first example for `PrimalityCheck` HOT 1
- ethsign import error HOT 1
- Dapptools on Raspberry Pi 4
- Incorrect logs emitted when downcasting to `bytes2` or `bytes1` HOT 1
- Can not install dapp by nix on mac HOT 1
- Is it possible to deploy a bin file directly and easily with dapptools?
- Insufficient funds for gas * price + value HOT 4
- No support for aarch64 darwin via flakes
- Getting `Internal Error` For Different Commands When Trying To Execute Symbolic On Live Contracts
- tool
- release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapptools.