The Element Group team asked us to review and audit their ERC20 Element Token contract. We looked at the code and now publish our results.
The audited code is located in the element-group/element-erc20-smart-contract repository. The version used for this report is commit 6a7b48cec1aa8a823b7ec4a03adadc5ca9d22e29
.
Here is our assessment and recommendations, in order of importance.
No critical severity issues were found.
No high severity issues were found.
No medium severity issues were found.
The ElementToken
constructor does not perform any precondition checks on the tokens argument. Based on how totalSupply is being calculated, this could result in an overflow in the calculation of totalSupply, setting an invalid total supply of tokens.
Consider using the OpenZeppelin SafeMath library to calculate the totalSupply, or performing a precondition check to prevent an overflow.
public
to the ElementToken
constructor function.No critical or high severity issues were found. Some changes were proposed to follow best practices and reduce potential attack surface.
Note that as of the date of publishing, the above review reflects the current understanding of known security patterns as they relate to the ERC20 ElementToken contract. We have not reviewed the related Element project. The above should not be construed as investment advice. For general information about smart contract security, check out our thoughts here.