Omniscia KlimaDAO Audit

wsKLIMA Code Style Findings

wsKLIMA Code Style Findings

KLI-01C: Inexistent Error Messages

TypeSeverityLocation
Code StyleInformationalwsKLIMA.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

TypeSeverityLocation
Code StyleInformationalwsKLIMA.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 sKLIMA
788 @param _amount uint
789 @return uint
790 */
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 wKLIMA
797 @param _amount uint
798 @return uint
799 */
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.