April 1, 2026

Capitalizations Index – B ∞/21M

Automation of smart contract auditing with MythX and CircleCi for continuous integration

Automation of smart contract auditing with mythx and circleci for continuous integration

Automation of smart contract auditing with MythX and CircleCi for continuous integration

Automation of smart contract auditing with mythx and circleci for continuous integration

So you have a project involving smart contracts that are being continuously worked on and updated. How do you implement continuous integration to automate testing and auditing of these smart contracts? That is what I am going to cover.

Using an existing MythX CLI tool called Mythos we are going to automate test of a specific smart contract every time an automated build is completed by CircleCi

Step 1— Create a MythX account

First step is create an account at https://mythx.io

Step 2 — Open your project config.yaml file

I am assuming you already have your project setup with CircleCi. If not there are plenty of guides on that. Add the following run step.

- run: yarn mythx

Step 3 — Open the project package.json file

We are going to update scripts section to include the MythX command and the dependencies to include Mythos.

Install Mythos a MythX CLI client
npm install -D @cleanunicorn/mythos --save

For this example I am using an example Token sale contract but you can use a flattener like truffle-flattener for files with imports included. You can automate the flattening as well by including the flatten call in your config.yaml.

Update scripts section of package.json
"mythx": "mythos analyze ./test.sol Tokensale"

Step 4 — Configure Circle CI

Now configure CircleCli to store environment. Look inside your project settings for environment variables

Select Add Variable to add the MythX credentials:
MYTHX_ETH_ADDRESS
MYTHX_PASSWORD

Step 4 — Deploy your new build

When the CircleCI build process calls yarn MythX you should see the console output if it finds any issues. Note that warnings do not stop the build but errors do.

That’s it. Now you have MythX integrated into your automated deployment build!

Note: I haven’t tested all scenarios to know if it will always stop the build if there is an error.

Covering test across multiple smart contracts
You can group multiple smart contracts to check in the package.json using && and multiple scenarios by tagging them in the package.json
Test two smart contracts with “yarn mythx”:

"mythx": "mythos analyze ./test.sol Tokensale && mythos analyze ./token.sol MyToken"

Also skip testing specific smart contract with flag “yarn mythx:nosale”:

"mythx:nosale": "mythos analyze ./token.sol MyToken"

You can add multiple scenarios to your config.yaml and package.json. Depending on what test coverage you want.

Disclaimer: MythX provides a toolset and API for auditing smart contracts but it does not replace or augment getting a professional audit of your smart contracts completed. Any smart contract you publish for public use or even private for that matter should go through a professional audit. These tools are simply a way to help point out common known issues and help avoid them. It may not cover everything which is why any smart contract should go through a professional audit.

Published at Wed, 17 Apr 2019 00:07:53 +0000

Previous Article

Bitcoin SV Continues to Plummet Amidst Delisting Trend: Bitcoin Cash Hodlers Celebrate

Next Article

Claim $50 of KryptEd tokens in a $2.3 million airdrop on Nauticus Exchange!

You might be interested in …

Bitcoins

bitcoins

bitcoinsBy fdecomite on 2014-01-17 14:21:54

Day 84: Trump Flexes Military Muscle, Causes More Uncertainty

schiffgold.com / BY SCHIFFGOLD / APRIL 14, 2017

This week, Trump made military moves on two fronts, positioning ships off the coast of North Korea, and firing missiles into a key target in Syria. These quick, emotional moves sent ripples throughout the world markets. Uncertainty in the economy has been further amplified by an ever-extending timeline for tax reform.

Global Political Climate on Edge After Syria Strike

  • Tensions with Moscow were at a high point following the US strike against Syira’s self-inflicted gas attack, according to Bloomberg.
  • The attack was initiated as more of a warning than a major strategy change.
  • Russia had harsh words. A spokesperson stated the US “is the most unpredictable state.”

Officials have stated that the strike from the US was retaliation for using horrifying gas weapons, but did not plan on further strikes or military involvement unless provoked in that way again. The damage and political waves have already been made, however, as the US condemned Russia for not doing a better job of clearing the dangerous sarin gas weapons out of Assad’s hands.

Russia in return called the US strike an “act of aggression against a sovereign state.” These words put a damper that Trump might be the bridge to create a more positive environment with Russia. It seems there are more uncertain and thin ice encounters to be expected in the Trump era.

READ MORE

The post Day 84: Trump Flexes Military Muscle, Causes More Uncertainty appeared first on Silver For The People.