Giter VIP home page Giter VIP logo

Comments (10)

TimDaub avatar TimDaub commented on August 22, 2024 1

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.

d-xo avatar d-xo commented on August 22, 2024 1

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.

mbrock avatar mbrock commented on August 22, 2024

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.

mbrock avatar mbrock commented on August 22, 2024

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.

mbrock avatar mbrock commented on August 22, 2024

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.

mbrock avatar mbrock commented on August 22, 2024

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/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.


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.

mbrock avatar mbrock commented on August 22, 2024

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.

mbrock avatar mbrock commented on August 22, 2024

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.

mbrock avatar mbrock commented on August 22, 2024

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.

asymmetric avatar asymmetric commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.