Git Product home page Git Product logo

theta-hardhat-demo's People

Contributors

jieyilong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

exced rodrigoieh

theta-hardhat-demo's Issues

How to send theta or tfuel from theta browser wallet to smart contract in the dapp when I call smart contract function

Hello,
I am glad to write this issue and I am also very happy for writing message here now.
I am basically Ethereum blockchain developer with 5+ years of experience in Solidity/Web3, but I am developing Theta Dapp like yield farming 2 months ago.
I am referencing the following document provided thetatoken.org for development.
https://docs.thetatoken.org/docs/theta-js-sdk-getting-started
The reason I am sending you this message is because there is one problem during I am developing dapp.
The approximate features of this dapp are:
In my dapp, each users will stake their Theta token to the smart contract, then smart contract will mine and transfer token to users.
Next, smart contract will stake staked theta token to the GNode.
Once smart contract get Tfuel as reward from the GNode, it will disperse this tfuel to users.

The guide document on the above mentions the ability to transmit THETA between addresses.
However, in the WEB3.JS library, there is a function to send ETH when calling a smart contract.(i.e: {value: weiAmount}).
But I couldn't find this feature in the theta developer guidance.
I'm sending this because I need your help with this feature, and I'd appreciate it if anyone could reply to it.
Thanks

ProviderError: method handler crashed for theta

I am trying to test this given repository, and following the steps in the readme, I am trying to execute the following line of code after starting the theta with the privatenet and the theta-eth-rpc-adapter

npx hardhat run scripts/deploy.js --network theta_privatenet

I am getting the following error in the console:

Deploying the contracts with the account: 0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A
Account balance: 49999981907884000000000000
ProviderError: method handler crashed
    at HttpProvider.request (.../theta-hardhat-demo/node_modules/hardhat/src/internal/core/providers/http.ts:46:19)
    at LocalAccountsProvider.request (.../theta-hardhat-demo/node_modules/hardhat/src/internal/core/providers/accounts.ts:131:34)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at EthersProviderWrapper.send (.../theta-hardhat-demo/node_modules/@nomiclabs/hardhat-ethers/src/ethers-provider-wrapper.ts:13:20)

On the section where the theta-eth-rpc-adapter is running, I am getting the following error:

INFO[1295] web3_clientVersion called                     prefix=web3rpc
INFO[1295] web3_clientVersion called                     prefix=web3rpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_getBalance called                         prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_estimateGas called                        prefix=ethrpc
gas: 10000000
INFO[1295] eth_getTransactionCount called, address: 0x19e7e376e7c213b7e7e7e46cc70a5dd086daff2a, tag: pending  prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_sendRawTransaction called                 prefix=ethrpc
INFO[1295] eth_sendRawTransaction, result: 0x3a966cb6122cb267015814b7eab37f2b2d399438d0be2a6015761f72fe19d174  prefix=ethrpc
INFO[1295] eth_chainId called                            prefix=ethrpc
INFO[1295] eth_getTransactionByHash called, txHash: 0x3a966cb6122cb267015814b7eab37f2b2d399438d0be2a6015761f72fe19d174  prefix=ethrpc
RPC method eth_getTransactionByHash crashed: runtime error: invalid memory address or nil pointer dereference
goroutine 423 [running]:
github.com/ethereum/go-ethereum/rpc.(*callback).call.func1(0xc0001208e0, 0x18, 0xc00024dda8)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/service.go:200 +0xbb
panic(0x4ab29e0, 0x5533290)
	/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/thetatoken/theta-eth-rpc-adaptor/rpc/ethrpc.(*EthRPCService).GetTransactionByHash.func1(0xc0000b4fc0, 0x11d, 0x207, 0x0, 0x4bee5e8, 0x4, 0xc0000b4fc0)
	/Users/jieyilong/Theta/go/src/github.com/thetatoken/theta-eth-rpc-adaptor/rpc/ethrpc/eth_get_transaction_by_hash.go:50 +0x14d
github.com/thetatoken/theta-eth-rpc-adaptor/common.HandleThetaRPCResponse(0xc0105f42a0, 0x0, 0x0, 0x4c368a8, 0x1, 0x1, 0xc0105f42a0, 0x0)
	/Users/jieyilong/Theta/go/src/github.com/thetatoken/theta-eth-rpc-adaptor/common/utils.go:51 +0x23e
github.com/thetatoken/theta-eth-rpc-adaptor/rpc/ethrpc.(*EthRPCService).GetTransactionByHash(0x55868a8, 0x4e46100, 0xc00046f3c0, 0xc0001a26e0, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/jieyilong/Theta/go/src/github.com/thetatoken/theta-eth-rpc-adaptor/rpc/ethrpc/eth_get_transaction_by_hash.go:53 +0x326
reflect.Value.call(0xc00030c680, 0xc00011e2e8, 0x13, 0x4bee74c, 0x4, 0xc000091040, 0x3, 0x3, 0xc000073c40, 0x4051cec, ...)
	/usr/local/go/src/reflect/value.go:460 +0x8ab
reflect.Value.Call(0xc00030c680, 0xc00011e2e8, 0x13, 0xc000091040, 0x3, 0x3, 0x1, 0x1, 0x0)
	/usr/local/go/src/reflect/value.go:321 +0xb4
github.com/ethereum/go-ethereum/rpc.(*callback).call(0xc00011cea0, 0x4e46100, 0xc00046f3c0, 0xc0001208e0, 0x18, 0xc00010e2e0, 0x1, 0x1, 0x0, 0x0, ...)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/service.go:209 +0x2b7
github.com/ethereum/go-ethereum/rpc.(*handler).runMethod(0xc0004c74d0, 0x4e46100, 0xc00046f3c0, 0xc0000ab420, 0xc00011cea0, 0xc00010e2e0, 0x1, 0x1, 0x1)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:369 +0x8a
github.com/ethereum/go-ethereum/rpc.(*handler).handleCall(0xc0004c74d0, 0xc0002ec000, 0xc0000ab420, 0x9291c60)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:331 +0x22d
github.com/ethereum/go-ethereum/rpc.(*handler).handleCallMsg(0xc0004c74d0, 0xc0002ec000, 0xc0000ab420, 0x4e36401)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:298 +0x1bd
github.com/ethereum/go-ethereum/rpc.(*handler).handleMsg.func1(0xc0002ec000)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:139 +0x46
github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc.func1(0xc0004c74d0, 0xc00010e2a0)
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:226 +0xcd
created by github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc
	/Users/jieyilong/Theta/go/pkg/mod/github.com/ethereum/[email protected]/rpc/handler.go:222 +0x66

Not sure, where the issue is happening. Can someone please help?

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.