简体   繁体   English

智能合约:通过将 HTML 中的信息发送到 MetaMask 中,在 Javascript 中动态创建和填充变量

[英]Smart Contracts: Dynamically make and fill variables in Javascript by taking informations from HTML to send in MetaMask

图片

As you can see, i am working on smart contracts.如您所见,我正在研究智能合约。

I have a parsing function that when i give an ABI/JSON it is showing up the function with is variable.我有一个解析函数,当我给出 ABI/JSON 时,它显示的函数是可变的。

Now, i want the informations that getting out from the parsing to sending them to the MetaMask, but i don't know how is proper to get them and i need help with the source code.现在,我想要从解析中得到的信息将它们发送到 MetaMask,但我不知道如何正确获取它们,我需要有关源代码的帮助。

I want to have in one variable the function type as it is shown at the picture with the arrow.我想在一个变量中包含函数类型,如带箭头的图片所示。

And i want making variables name with the names that are shown (_startTime as an example) with the value from the input box that the user will give.我想使用显示的名称(以_startTime为例)使用用户将提供的输入框中的值制作变量名称。

Metamask is a plugin used to execute the transaction. Metamask 是一个用于执行交易的插件。 You can also send data with the transaction to the Metamask.您还可以将交易数据发送到 Metamask。 To initiate the transaction first you have to login into the Metamask.要首先启动交易,您必须登录到 Metamask。 Later you have to select the Network in the metamask and use Web3 wrapper to execute the transaction.稍后您必须在元掩码中选择网络并使用 Web3 包装器来执行交易。 I did that using Truffle and running local blockchain on my PC.我使用 Truffle 并在我的 PC 上运行本地区块链来做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM