contract wsSQUID is ERC20 {
    using SafeERC20 for ERC20;
    using Address for address;
    using SafeMath for uint;

    address public immutable sSQUID;

    constructor( address _sSQUID ) ERC20( 'Wrapped sSQUID', 'wsSQUID' ) {
        require( _sSQUID != address(0) );
        sSQUID = _sSQUID;
    }

    /**
        @notice wrap sSQUID
        @param _amount uint
        @return uint
     */
    function wrapFromsSQUID( uint _amount ) external returns ( uint ) {
        IERC20( sSQUID ).transferFrom( msg.sender, address(this), _amount );

        uint value = wsSQUIDValue( _amount );
        _mint( msg.sender, value );
        return value;
    }

    /**
        @notice unwrap sSQUID
        @param _amount uint
        @return uint
     */
    function unwrapTosSQUID( uint _amount ) external returns ( uint ) {
        _burn( msg.sender, _amount );

        uint value = sSQUIDValue( _amount );
        IERC20( sSQUID ).transfer( msg.sender, value );
        return value;
    }

    /**
        @notice converts wsSQUID amount to sSQUID
        @param _amount uint
        @return uint
     */
    function sSQUIDValue( uint _amount ) public view returns ( uint ) {
        return _amount.mul( IsSQUID( sSQUID ).index() ).div( 10 ** decimals() );
    }

    /**
        @notice converts sSQUID amount to wsSQUID
        @param _amount uint
        @return uint
     */
    function wsSQUIDValue( uint _amount ) public view returns ( uint ) {
        return _amount.mul( 10 ** decimals() ).div( IsSQUID( sSQUID ).index() );
    }

}
function wrapFromsSQUID( uint _amount ) external returns ( uint ) {
    IERC20( sSQUID ).transferFrom( msg.sender, address(this), _amount );

    uint value = wsSQUIDValue( _amount );
    _mint( msg.sender, value );
    return value;
}

/**
 @notice wrap sSQUID
 @param _amount uint
 @return uint
 */