Skip to content

Releases: naddison36/sol2uml

Release v2.5.0

18 Feb 10:10
249cdda
Compare
Choose a tag to compare
  • Parse storage variable values from slot values. See Storage diagram examples
  • Get storage slot values for structs and arrays.
  • Added a new -a --array option to limit the displayed slots for arrays.
  • Etherscan file remappings applied to Solidity imports.
  • Added options backColor, shapeColor, fillColor and textColor to style class and storage diagram colors. See Color Styling

Release v2.4.3

27 Jan 11:57
Compare
Choose a tag to compare
  • fix -bn --block option for the storage command

For example, the following will get the storage values for the Tether contract as at block 16000000

storage -bn 16000000 -d 0xdAC17F958D2ee523a2206206994597C13D831ec7

TetherTokenBlock

This can be compared against the storage values using the latest block which was around block 16497900

storage -d 0xdAC17F958D2ee523a2206206994597C13D831ec7

TetherToken

Release v2.4.2

19 Dec 22:23
Compare
Choose a tag to compare
  • Fixed issue #126 by pinning axios to v1.1.3

Release v2.4.1

19 Dec 11:13
Compare
Choose a tag to compare
  • Fixed issue #126 by downgrading axios to v1.1.3

Release v2.4.0

15 Dec 07:03
Compare
Choose a tag to compare

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

Release v2.3.1

12 Dec 10:33
8d7972b
Compare
Choose a tag to compare
  • fix for #122
  • refactor functions that convert AST types to UML Class types so it's easier for other developers to contribute
  • started adding TSDocs
  • Operator.isPayable changed to Operator.stateMutability
  • updated dependencies

Release v2.3.0

05 Dec 01:39
5f7f21e
Compare
Choose a tag to compare

New class diagram options added

  -s, --squash                     squash inherited contracts to the base contract(s) (default: false)
  -hsc, --hideSourceContract       hide the source contract when using squash (default: false)

Example using Uniswap V3 Router

The first diagram uses the following options which does not include the new -s squash option

  • -hp hide private and internal variables and functions
  • -hi hide interfaces
  • -hl hide libraries
  • -he hide enums

Uniswap V3 Router

Generated from running

sol2uml -hp -hi -hl -hs -he 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45

This uses the verified Solidity code loaded to Etherscan https://etherscan.io/address/0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45#code

The next diagram is the same as the previous diagram but the inherited contracts are squashed into a single class diagram with the -s, --squash option.

The last stereotype on each line is the contract the variable or function is implemented in. For example, unwrapWETH9 is implemented in the PeripheryPaymentsWithFeeExtended contract.

Uniswap V3 Router Squashed

Generated from running

sol2uml -s -hp -hi -hl -hs -he 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45

Adding the -hsc, --hideSourceContract option to the previous diagram removes the stereotype with the source contract the variable or function was implemented in.

Uniswap V3 Router Squashed no source contract

Generated from running

sol2uml -s -hsc -hp -hi -hl -hs -he 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45

Release v2.2.6

06 Nov 06:11
Compare
Choose a tag to compare
  • Added API key for BSC explorer
  • Added support for Gnosis Safe

Release v2.2.4

05 Oct 03:35
Compare
Choose a tag to compare
  • fix: do not output associations to enums or structs if they have been filtered out. eg limited by the depth
  • chore: upgraded the OpenZeppelin examples to the latest version

Release v2.2.3

29 Sep 20:06
Compare
Choose a tag to compare
  • Removed space between pragma solidity and the solidity version for flatten