Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Webhero9297 opened this issue Aug 4, 2021 · 12 comments

Comments

@Webhero9297
Copy link

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

@Webhero9297
Copy link
Author

[email protected]

@jieyilong
Copy link
Member

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

Thanks for the question! We recently released Theta v3.1.0, which provides support for Web3.js and Ethereum DApp tools like Metamask, Truffle. Please checkout the link below for more info (some of the guides are still work-in-progess atm):

https://docs.thetatoken.org/docs/turing-complete-smart-contract-support

The feature you mentioned, i.e. staking Theta/TFuel from a smart contract, is not yet supported by the Theta smart contract virtual machine. But we believe with web3.js/Truffle support, you can develop other interesting DApps.

@Webhero9297
Copy link
Author

Thank you so much for your reply.
My name is Martin Boateng.
What I'm trying to do now is get users to stake Theta or Tfuel to the smart contract by using their theta browser wallet(not theta web wallet), when will I be able to use this feature?
I would be very grateful if you could let me know that.
I would like to use the features I mentioned to create and launch dapp like yield farming that is trending on ethereum or bsc these days.
I need help from you and your team is urgently needed in this regard.
I am confident that the THETA blockchain will be used more widely than ETHEREUM among users in the near future, so I want to use my talents to the fullest and contribute more to its growth.
If you have more details, please reply to my email, I will thank you very much.
email: [email protected]
Thanks
Best Regards

@jieyilong
Copy link
Member

Thank you so much for your reply.
My name is Martin Boateng.
What I'm trying to do now is get users to stake Theta or Tfuel to the smart contract by using their theta browser wallet(not theta web wallet), when will I be able to use this feature?
I would be very grateful if you could let me know that.
I would like to use the features I mentioned to create and launch dapp like yield farming that is trending on ethereum or bsc these days.
I need help from you and your team is urgently needed in this regard.
I am confident that the THETA blockchain will be used more widely than ETHEREUM among users in the near future, so I want to use my talents to the fullest and contribute more to its growth.
If you have more details, please reply to my email, I will thank you very much.
email: [email protected]
Thanks
Best Regards

Thanks Martin for your feedback! We may look into how to support Theta/TFuel staking through smart contract in the future. There are no set timeline yet, but we'll announce it through Twitter/Medium whenever it is ready.

In the meanwhile, even without the staking feature, I think we can already develop other interesting DApps similar to those on Ethereum/Polygon/BSC (lending, DEX, NFT, etc) using the tools you're already familiar with:

https://docs.thetatoken.org/docs/web3-stack-truffle
https://docs.thetatoken.org/docs/web3-stack-web3js

Welcome to experiment new ideas with these tools, any feedback is appreciated!

@Webhero9297
Copy link
Author

Thanks JieYiLong for your reply.
https://docs.thetatoken.org/docs/web3-stack-truffle
https://docs.thetatoken.org/docs/web3-stack-web3js
These links will help me so much.
Anyway, I would be very grateful if you and your team could resolve the issue I raised as soon as possible.
Thanks

@Webhero9297
Copy link
Author

Once more thing, how to add theta blockchain into metamask?
image
Could you post this details for mainnet and testnet how to add theta blockchain into the metamask?

@jieyilong
Copy link
Member

Yes, please check out the following links for more detail:

https://docs.thetatoken.org/docs/web3-stack-metamask
https://medium.com/theta-network/theta-blockhain-now-accessible-through-metamask-plug-in-61b278633264

@Webhero9297
Copy link
Author

Sorry for my asking. I was on the old version of theta doc. I realized above link after refreshing doc URL. Thanks for your support.
Once again, I would be very grateful if you and your team could resolve the issue I raised as soon as possible.
This function is essential to release the app I am developing. If the THETA blockchain specification does not allow it, I will have to find another way to develop the app.
Thanks for your efforts.

@Webhero9297
Copy link
Author

Dear JieYi Long
How are you?
Let me ask you again. I am preparing my project in Theta Hackathon now.
Could you let me know how to listen to smart contract execution event in theta-js library?
If you answer me quickly, I will be very happy.
Thanks

@jieyilong
Copy link
Member

It is still under development. We'll look into how to support event subscription with the ETH RPC Adapter. Once that's implemented you should be able to use web3.js or ethers.js for event listening. We'll update our documentation once that feature is released. Thanks!

@Webhero9297
Copy link
Author

Thanks for your support, Jieyi Long.
I am developing my DeFi Dapp using theta-js library. Anyway, may I ask more questions for development in while?
Thanks

@Webhero9297
Copy link
Author

Webhero9297 commented Nov 16, 2021

Hello @jieyilong
How do you do? I think that you and your team's development is going well. Let me ask you one thing more. I've installed Testnet guardian node and mainnet Guardian node on the window server. Mainnet Guardian node executed in a few hours. But Testnet Guardian is keeping the following screen for almost 1 week.
Could you support me with this? In fact, this is very important for my development now. So, I am going to test my Dapp on the Testnet first. After then, I am going to enter the Hackathon that Theta labs hosts.
And I don't know your contact details. So I am keeping the writing of the message here continue.
image_2021_11_16T15_51_20_701Z
If you reply to me asap, it will be very happy. And if theta labs need my skill, please try to hire me. I would like to contribute a little to its development.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jieyilong @Webhero9297 and others