首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法测试坚固性Remix

无法测试坚固性Remix
EN

Ethereum用户
提问于 2018-09-09 23:24:03
回答 1查看 427关注 0票数 1

我正在撰写我自己的可靠的智能合同,并试图在Remix中测试。主要的Remix站点似乎正在下降(https://remix.ethereum.org/)。我找到了另一个网站:https://ethereum.github.io/browser-solidity/#optimize=false&version=soljson-v0.4.24+commit.e67f0147.js,并且正在尝试在那里进行测试。我甚至不能测试文档中的示例代码,更不用说我自己的合同了。我看不到从示例代码中调用这些方法的地方。下面是示例代码:

代码语言:javascript
复制
pragma solidity ^0.4.24;

contract Coin {
    // The keyword "public" makes those variables
    // readable from outside.
    address public minter;
    mapping (address => uint) public balances;

    // Events allow light clients to react on
    // changes efficiently.
    event Sent(address from, address to, uint amount);

    // This is the constructor whose code is
    // run only when the contract is created.
    constructor() public {
        minter = msg.sender;
    }

    function mint(address receiver, uint amount) public {
        if (msg.sender != minter) return;
        balances[receiver] += amount;
    }

    function send(address receiver, uint amount) public {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        emit Sent(msg.sender, receiver, amount);
    }
}

有人能帮我测试一下吗?我主要关心的是能够测试我的代码。一旦我能够验证示例代码是否有效,我就可以测试我自己的合同。先谢谢你。

EN

回答 1

Ethereum用户

发布于 2018-09-10 09:52:26

现在我身边的混音在起作用..。不管怎么说,如果用于生产活动,离线使用它是绝对有用的.如果离线服务器,你继续工作!

您应该使用Nodejs命令在本地安装它。

这样:安装Nodejs (如果没有),然后从Nodejs提示符写

"npm安装-g混合-ide“

它将安装最新版本,即0.6.4,目前我正在编写这篇文章。

(注意:如果您正在处理一些多合同应用程序,现在使用"npm安装-g remix-ide@0.6.3“,以避免在下一个版本中修复的一些bug)。

完成后,在Nodejs控制台上写“remix”,然后在后台打开shell。

然后从您的浏览器转到http://127.0.0.1:8080,您将发现混合工作。

(顺便说一句,这种方法为您提供了从remix直接访问硬盘的宝贵可能性,无论是在读写方面。当代码在remix-ide窗口中被修改时,它将在相关文件中自动更新。搜索“混合”文档以获得详细信息。它很有用,而且很容易使用!)

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/58410

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档