Giter Site home page Giter Site logo

eth_swap's People

Contributors

gwmccubbin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eth_swap's Issues

Error: invalid address

Hi Everyone
Would you be able to help me find why i am getting this error below when i try to swap Dapp to Eth?
I Finish the 3 hours course from the link below and I managed to swap Eth to Dapp however cannot do the opposite
https://www.dappuniversity.com/articles/learn-blockchain#dependencies

Thank you

Error: invalid address (argument="address", value=undefined, code=INVALID_ARGUMENT, version=address/5.1.0) (argument="_spender", value=undefined, code=INVALID_ARGUMENT, version=abi/5.0.7)

Logger.makeError
C:/Program Files/Git/eth_swap/node_modules/@ethersproject/logger/lib.esm/index.js:219
Logger.throwError
C:/Program Files/Git/eth_swap/node_modules/@ethersproject/logger/lib.esm/index.js:230
Logger.throwArgumentError
C:/Program Files/Git/eth_swap/node_modules/@ethersproject/logger/lib.esm/index.js:235
AddressCoder._throwError
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js:54
AddressCoder.encode
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/coders/address.js:28
(anonymous function)
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/coders/array.js:67
pack
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/coders/array.js:53
TupleCoder.encode
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js:38
AbiCoder.encode
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/@ethersproject/abi/lib.esm/abi-coder.js:131
ABICoder.push../node_modules/web3/node_modules/web3-eth-abi/lib/index.js.ABICoder.encodeParameters
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/web3-eth-abi/lib/index.js:145
(anonymous function)
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/web3-eth-contract/lib/index.js:498
_encodeMethodABI
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/web3-eth-contract/lib/index.js:497
_processExecuteArguments
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/web3-eth-contract/lib/index.js:806
_executeMethod
C:/Program Files/Git/eth_swap/node_modules/web3/node_modules/web3-eth-contract/lib/index.js:825
App._this.sellTokens
C:/Program Files/Git/eth_swap/src/components/App.js:71
onSubmit
C:/Program Files/Git/eth_swap/src/components/SellForm.js:20
HTMLUnknownElement.callCallback
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:147
invokeGuardedCallbackDev
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:196
invokeGuardedCallback
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:250
invokeGuardedCallbackAndCatchFirstError
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:265
executeDispatch
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:571
executeDispatchesInOrder
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:596
executeDispatchesAndRelease
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:695
executeDispatchesAndReleaseTopLevel
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:704
forEachAccumulated
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:676
runEventsInBatch
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:844
runExtractedEventsInBatch
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:852
handleTopLevel
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:5030
batchedUpdates$1
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:21425
batchedUpdates
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:2247
dispatchEvent
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:5110
(anonymous function)
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:21482
unstable_runWithPriority
C:/Program Files/Git/eth_swap/node_modules/scheduler/cjs/scheduler.development.js:255
interactiveUpdates$1
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:21481
interactiveUpdates
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:2268
dispatchInteractiveEvent
C:/Program Files/Git/eth_swap/node_modules/react-dom/cjs/react-dom.development.js:5086
▲ 36 stack frames were expanded.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

× Unhandled Rejection (TypeError): Cannot read property 'toString' of null

`
const networkId = await web3.eth.net.getId()

const tokenData = Token.networks[networkId]
if(tokenData) {
  const token = new web3.eth.Contract(Token.abi, tokenData.address)
  this.setState({ token })
  let tokenBalance = await token.methods.balanceOf(this.state.account).call()
  this.setState({ tokenBalance: tokenBalance.toString() })
} else {
  window.alert('Token contract not deployed to detected network.')
}`

Unhandled Rejection (TypeError): token.methods.balanceOf is not a function

const networkId =  await web3.eth.net.getId()
const tokenData = Token.networks[networkId]
if(tokenData) {
  const token = new web3.eth.Contract(Token.abi, tokenData.address)
  this.setState({ token })
  let tokenBalance = await token.methods.balanceOf(this.state.account).call()
  this.setState({ tokenBalance: tokenBalance.toString() })
} else {
  window.alert('Token contract not deployed to detected network.')
}

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.