Giter Club home page Giter Club logo

Comments (5)

jeapostrophe avatar jeapostrophe commented on May 24, 2024

As discussed on Discord, Reach does not provide support for you launching arbitrary smart contracts on the networks we support. You got this code from examples/remote/index.mjs, which is a test case for launching a contract and then interacting with. That code relies on the developer knowing how to put things on Ethereum (it uses ethers and solc directly). I think in most real-world uses, the remote object you want to interact with will already exist.

However, if you want a quick fix, notice in the compiled output from Solidity, the compilation is named index.sol:DaiToken rather than index.sol:WeirdContract like in the original example. Change the name and it will probably work.

from reach-lang.

KBryan avatar KBryan commented on May 24, 2024

Reach does compile and deploys the smart contract. Set your contract to pragma solidity ^0.7.4; and above is required. Configure your makefile to the desired network if you want to use this approach to launch ERC20 from Reach. You can also modify the frontend to deploy the contracts VIA MetaMask. ¯_(ツ)_/¯

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 24, 2024

No, Reach does not compile and deploy the smart contract.

The examples/remote directory is an example of a /user/ program that a Reach programmer might write. So, everything inside that directory is not Reach, but a program that a Reach programmer happened to write. In other words, it is you, not Reach.

In that example, the Makefile, assumes your computer has solc on it and compiles the index.sol contract --- https://github.com/reach-sh/reach-lang/blob/master/examples/remote/Makefile#L14-L15 -- that's the compile and you did that.

Similarly, the index.mjs file, which is written by you, directly requires ethers (because you know what it is and how to use it) and it deploys the contract --- https://github.com/reach-sh/reach-lang/blob/master/examples/remote/index.mjs#L32 --- that's the deploy and you did that too. Just like how in the Rock-Paper-Scissors tutorial, you printed out a message from Bob --- https://github.com/reach-sh/reach-lang/blob/master/examples/tut-7/index.mjs#L49

from reach-lang.

KBryan avatar KBryan commented on May 24, 2024

Okay, I got it to do what I want. Although, it seems that it shouldn't happen or work.

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 24, 2024

No, it should happen and it should work; it's just that you are attributing it to "Reach", when you should attribute it to "Kwame"; or rather, "Kwame copying Jay's Makefile and JavaScript ethers code" :P

from reach-lang.

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.