1

I am writing my own smart contract in Solidity and trying to test in Remix. The main Remix site appears to be down (https://remix.ethereum.org/). I found another site: https://ethereum.github.io/browser-solidity/#optimize=false&version=soljson-v0.4.24+commit.e67f0147.js and am trying to test there. I cannot even test example code from the documentation, leave alone my own contract. I don't see a place to call the methods from the example code. Here is the example code:

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);
    }
}

Can someone help me with testing this out? My main concern is being able to test my code. Once I can verify the example code works, I can test my own contract. Thank you very much in advance.

  • 1
    Remix is loading fine for me... an alternative might be ethfiddle.com – Shawn Tabrizi Sep 10 '18 at 1:27
  • Can you send a picture of your problem? – xPain Sep 10 '18 at 4:18
0

At the moment remix is working from my side... anyway it is absolutely useful to have and use it offline if for production activities... in case of off-line servers you continue to work!

You should use Nodejs commands to install it locally.

This way: install Nodejs (if you do not have it), then from Nodejs prompt write

"npm install -g remix-ide"

and it will install the latest version, that is 0.6.4 at the moment I'm writing this.

(NOTE: If you are working on some multicontract applications, at the moment use "npm install -g remix-ide@0.6.3" in order to avoid some bugs which will be fixed in the next release).

After completion, write on the Nodejs console "remix-ide" and leave the shell opened in background.

Then from your browser go to http://127.0.0.1:8080 and you will find remix working.

(By the way using this approach give you the precious possibility to have direct access to your hard disk from remix ide, BOTH in reading and writing. When the code is modified in remix-ide window, it will be automatically updated in the relevant files. Search for "remixd" documentation to have details. It is useful and easy to use!)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.