patrickalphac / chainlink_defi Goto Github PK
View Code? Open in Web Editor NEWBuild a defi yield farmable dApp. Get started here.
Build a defi yield farmable dApp. Get started here.
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!
What would cause the dapp to stay on loading?
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?
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:
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?
running yarn
after cloning the repo throws the error in the subject.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.