Giter Site home page Giter Site logo

patrickalphac / chainlink_defi Goto Github PK

View Code? Open in Web Editor NEW
173.0 5.0 83.0 990 KB

Build a defi yield farmable dApp. Get started here.

Solidity 17.67% JavaScript 76.80% HTML 5.46% CSS 0.07%
chainlink staking defi yield-farming stake decentralized-applications decentralized-oracles price-feeds

chainlink_defi's Issues

Several questions

Hello sir! When calling the get-stats.js file in the terminal, it always returns 0 for price. Not sure how this really works as in the tutorial there is no example of the function returning and what it is supposed to display.

Another problem I have is when I call issue-token.js, there is no response from Kovan. It states "using network Kovan" but there is never a return output. It just sits there.

The tutorial could also be clearer on this statement: "And then the getTokenEthPrice is where we make the call to the Chainlink price feeds. You’ll have to add the mapping of the token -> Eth price feed for the token, in order to get the correct value. <- what does this mean and could you provide an example?

I realize that you don't want to hold people's hand and there are things that I need to find out on my own, but Solidity and it's related problems can be very difficult to troubleshoot.

Any help is appreciated thank you!

Error: Mnemonic invalid or undefined

I've created an account at https://infura.io/ and made a project where under keys I've selected the kovan endpoint to use in the following commands:

export MNEMONIC="apple, cheese, etc...." export RPC_URL="https://kovan.infura.io/v3/adfdsfasdfadsfasdfadfadfadf"

...replacing the RPC_URL with mine from Infura.

Now for the MNEMONIC. I've just made up a string of words for this: (prevent indoor veteran upgrade salad limit prefer sausage december write giggle battle wisdom remind giant).

I run:
truffle migrate --network live --reset

I get:
Error: Mnemonic invalid or undefined at checkBIP39Mnemonic (/Users/User1/Desktop/chainlink_defi/node_modules/@truffle/hdwallet-provider/src/index.ts:79:15) at new HDWalletProvider (/Users/User1/Desktop/chainlink_defi/node_modules/@truffle/hdwallet-provider/src/index.ts:109:23) at Object.provider (/Users/User1/Desktop/chainlink_defi/truffle-config.js:14:16) at Object.getProvider (/usr/local/lib/node_modules/truffle/build/webpack:/packages/provider/index.js:20:1) at Object.create (/usr/local/lib/node_modules/truffle/build/webpack:/packages/provider/index.js:13:1) at TruffleConfig.get [as provider] (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/dist/configDefaults.js:204:1) at Object.detect (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:19:1) at /usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:206:1

I am missing something obviously. Any idea?

Error when approving metamask tx quickly while trying to stake

Hi Patrick,

thanks for this awesome repo and accompanying tutorial.
I noticed a bug while trying to use your app, which I'm not 100% sure how to fix so decided to submit this issue.

When I click on STAKE!, the app first asks to approve the LINK token, and then sends the staking transaction.
If I approve the first metamask tx very very fast after the "confirm" buttons becomes available:
image

I get this error
image

Potential Solution

Even if the stack traces are useless (or at least I don't understand them), I figured the error happens in the stakeTokens function:

  stakeTokens = (amount, tokenAddress) => {
    this.setState({ loading: true })
    this.state.erc20.methods
      .approve(this.state.tokenFarm._address, amount)
      .send({ from: this.state.account })
      .on("transactionHash", (hash) => {
        this.state.tokenFarm.methods
          .stakeTokens(amount, tokenAddress)
          .send({ from: this.state.account })
          .on("transactionHash", (hash) => {
            this.setState({ loading: false })
          })
      })
  };

One potential solution is to change .on("transactionHash") to .on("receipt) but that makes for a much worse UI since we have to wait for the first tx to be written to a block. Is there any other way that this could be solved?

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.