简体   繁体   English

如何解决solidity Remix中的类型错误

[英]how to solve type error in solidity Remix

my solidity smart contract is compiling in remix with out any error .我的 Solidity 智能合约正在 remix 中编译,没有任何错误。 my contract code is below:我的合同代码如下:

   pragma solidity >=0.4.0 <0.6.0;
   contract NewConreact {
     uint storedData;

     function set(uint x) public {
        storedData = x;
     }

    function get() public view returns (uint) {
        return storedData;
    }
}

it is compiling in remix perfectly but when i run it to triger set() and get()i got:它在 remix 中完美编译,但是当我运行它以触发 set() 和 get() 时,我得到了:

"error: Failed to decode output: TypeError: Cannot read property 'length' of undefined" “错误:无法解码输出:类型错误:无法读取未定义的属性‘长度’”

this error.这个错误。

I found a closed issue in solidity git repo but didn't find any solution.我在solidity git repo 中发现了一个已解决的问题,但没有找到任何解决方案。 I also increase the gas limit but didn't work.我也增加了气体限制,但没有用。

somebody, please help me to figure out the problem.有人,请帮我找出问题所在。

This normally happens when the deployment is failing with unknown reasons - may be you tried with Injected web3 or web3 provider like Ganache-cli and it somehow failed deployment and however the contract interface was still appended to the UI.这通常发生在部署因未知原因失败时 - 可能您尝试使用注入的 web3 或 web3 提供程序,如 Ganache-cli 并且它以某种方式部署失败,但是合同界面仍然附加到 UI。 This could have made you confuse that the contract got deployed correctly.这可能会让您对合约部署正确感到困惑。

The work around is to view and expand the log output of the transaction for deploying the contract.解决方法是查看和展开交易的日志输出以部署合约。 Make sure your contract is successful before doing transactions.在进行交易之前,请确保您的合同成功。

Please provide your logs if you are still unable to do the transactions even after you have deployed the contract successfully.如果您在成功部署合约后仍然无法进行交易,请提供您的日志。

Try using Chrome, avoid Safari, and be sure to remove the "s" from the solidity Remix site > won't work > https://remix but http://remix will.尝试使用 Chrome,避免使用 Safari,并确保从 Solidity Remix 站点中删除“s”> 不起作用 > https://remixhttp://remix会。 Once I moved to Chrome it worked一旦我转移到 Chrome,它就起作用了

暂无
暂无

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

相关问题 我怎样才能解决这个声明错误? - how can i solve this declaration error in solidity? remix solidity contract如何将多个参数传递给create按钮 - remix solidity contract how to pass multiple arguments into the create button 我应该怎么做才能解决这个错误? - what should i do to solve this error in solidity? 如何在合约中设置 ETH 的接收者,以在 remix IDE 中使用solidity usign call() 从一个地址向另一个地址发送ETH - How to set the receiver of ETH in a contract to send ETH from one address to another with solidity usign call() in remix IDE 得到 parsererror 我在 remix 上写 inheritance solidity 代码我得到了错误 - getting parsererror I write inheritance solidity code on remix i got error Solidity Remix 交易恢复到初始状态 - Solidity Remix transaction reverted to initial state 在 Remix 中部署 solidity 合约时如何修复/调试错误(无效的 arrayify 值) - How to fix / debug errors (invalid arrayify value) when deploying a solidity contract in Remix 无法解决 Solidity 错误 - ParserError: Expected &#39;;&#39; 但得到了“数字”-&gt; first.sol:2:17: | 2 | Pragma 坚固性 0.8.7; | ^^^ - Unable to solve solidity error- ParserError: Expected ';' but got 'Number' --> first.sol:2:17: | 2 | Pragma solidity 0.8.7; | ^^^ 使用 Remix IDE 在 Solidity 中购买代币交易时出现“资金不足” - "Not Enough Fund" when doing buying token transaction in Solidity with Remix IDE Remix solidity 不会在私有以太坊链上返回结果 - Remix solidity does not return result on private ethereum chain
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM