Releases: naddison36/sol2uml
Release v2.5.0
- 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
andtextColor
to style class and storage diagram colors. See Color Styling
Release v2.4.3
- fix
-bn --block
option for thestorage
command
For example, the following will get the storage values for the Tether contract as at block 16000000
storage -bn 16000000 -d 0xdAC17F958D2ee523a2206206994597C13D831ec7
This can be compared against the storage values using the latest
block which was around block 16497900
storage -d 0xdAC17F958D2ee523a2206206994597C13D831ec7
Release v2.4.2
- Fixed issue #126 by pinning axios to v1.1.3
Release v2.4.1
- Fixed issue #126 by downgrading axios to v1.1.3
Release v2.4.0
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
- 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 toOperator.stateMutability
- updated dependencies
Release v2.3.0
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
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.
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.
Generated from running
sol2uml -s -hsc -hp -hi -hl -hs -he 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
Release v2.2.6
- Added API key for BSC explorer
- Added support for Gnosis Safe
Release v2.2.4
- 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
- Removed space between
pragma solidity
and the solidity version forflatten