Skip to content

Release v2.4.0

Compare
Choose a tag to compare
@naddison36 naddison36 released this 15 Dec 07:03
· 59 commits to master since this release

New diff command was added that downloads the verified Solidity code of two contracts from Etherscan, flattens the source files and compares the code.

Usage: sol2uml diff [options] <addressA> <addressB>

The results show the comparison of contracts A to B.
The green sections are additions to contract B that are not in contract A.
The red sections are removals from contract A that are not in contract B.
The line numbers are from contract B. There are no line numbers for the red sections as they are not in contract B.

Compare verified Solidity code differences between two contracts.

Arguments:
  addressA                  Contract address in hexadecimal format with a 0x prefix.
  addressB                  Contract address in hexadecimal format with a 0x prefix.

Options:
  -l, --lineBuffer <value>  Minimum number of lines before and after changes (default: "4")
  -s, --saveFiles           Save the flattened contract code to the filesystem. The file names will be the contract address with a .sol extension. (default: false)
  -h, --help                display help for command

Some examples

The last USDC upgrade

sol2uml diff 0xb7277a6e95992041568d9391d09d0122023778a2 0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf

cUSDT upgrade

sol2uml diff 0xa035b9e130f2b1aedc733eefb1c67ba4c503491f 0x3363bae2fc44da742df13cd3ee94b6bb868ea376

mStable's upgrade of its interest-bearing mUSD (imUSD) on Polygon

sol2uml -n polygon diff 0x4f59cb6db6020c5553a5c856aba0a7e477aad1ee 0x25D1e7f9B306fb6502D3748490cfCBe0CCB546E7