How to use MythX and Remix to secure your smart contracts

MP
MythX
Published in
2 min readNov 26, 2019

A detailed, step-by-step howto guide on how to use MythX with Remix, showing as well as the differences between MythX and MythX Pro.

MythX is a tool for finding smart contract weaknesses. For our single developers and dev teams, we offer two plans: MythX and MythX Pro.

(We also offer custom plans too; contact us for details.)

We recently posted about the differences between MythX and MythX Pro. But you may find it more useful to see an actual scenario involving testing a smart contract using MythX.

Let’s meet Sam.

Contract and scenario

Sam is a smart contract developer, who is working on a project that will pay out multiple people at once based on balances stored in a contract.

After some research and testing, Sam has come up with this:

pragma solidity 0.5.11;contract Demo {
address payable owner;
address payable[] receivers;
mapping (address => uint256) balance;
constructor() public {
owner = msg.sender;
}
function setReceivers(address payable[] memory _receivers) public {
receivers = _receivers;
}
function deposit() public payable {
balance[msg.sender] += msg.value;
receivers.push(msg.sender);
}
function payReceivers() public {
for(uint256 i = 0; i < receivers.length; i++) {
(bool success,) = receivers[i].call.value(balance[receivers[i]])("");
require(success);
}
}
function die(address caller) public {
require(caller == msg.sender);
selfdestruct(msg.sender);
}
}

As a work in progress, Sam isn’t quite ready for a manual audit yet, but wants to check the contract for weaknesses now. This way, one can fix the most obvious problems before getting to the audit.

To read the full story, go to A beginner’s guide to MythX.

--

--

MP
MythX
Editor for

Marketing and Brand Manager at MythX, a division of ConsenSys.