Omniscia KlimaDAO Audit
wsKLIMA Code Style Findings
wsKLIMA Code Style Findings
KLI-01C: Inexistent Error Messages
Type | Severity | Location |
---|---|---|
Code Style | Informational | wsKLIMA.sol:L756 |
Description:
The linked require
checks have no error messages explicitly defined.
Example:
contracts/tokens/regular/wsKLIMA.sol
756require( _sKLIMA != address(0) );
Recommendation:
We advise them to be set so to aid in the validation of the require
's condition as well as the legibility of the codebase.
Alleviation:
The KlimaDAO team considered this exhibit but opted to retain the codebase in its current state.
KLI-02C: Redundant Usage of decimals
Type | Severity | Location |
---|---|---|
Code Style | Informational | wsKLIMA.sol:L792, L801 |
Description:
The value of decimals
is known to be equivalent to 18
as it is not adjusted in the codebase.
Example:
contracts/tokens/regular/wsKLIMA.sol
786/**787 @notice converts wKLIMA amount to sKLIMA788 @param _amount uint789 @return uint790 */791function wKLIMATosKLIMA( uint _amount ) public view returns ( uint ) {792 return _amount.mul( IsKLIMA( sKLIMA ).index() ).div( 10 ** decimals() );793}794
795/**796 @notice converts sKLIMA amount to wKLIMA797 @param _amount uint798 @return uint799 */800function sKLIMATowKLIMA( uint _amount ) public view returns ( uint ) {801 return _amount.mul( 10 ** decimals() ).div( IsKLIMA( sKLIMA ).index() );802}
Recommendation:
We advise the two instances of 10 ** decimals()
to be replaced by a contract-level constant
that holds the value of 1 ether
/ 1e18
.
Alleviation:
The KlimaDAO team considered this exhibit but opted to retain the codebase in its current state.