contract CurveStakingAdapter is ProtocolAdapter, Ownable {

    string public constant override adapterType = "Asset";

    string public constant override tokenType = "ERC20";

    // Returns the gauge where the given token is a staking token
    mapping(address => address) internal gauge_;

    event GaugeSet(
        address indexed gaugeAddress,
        address indexed stakingToken
    );

    function setGauges(Gauge[] calldata gauges) external onlyOwner {
        uint256 length = gauges.length;

        for (uint256 i = 0; i < length; i++) {
            setGauge(gauges[i]);
        }
    }

    /**
     * @return Amount of staked tokens for a given account.
     * @dev Implementation of ProtocolAdapter interface function.
     */
    function getBalance(address token, address account) external view override returns (uint256) {
        return ERC20(gauge_[token]).balanceOf(account);
    }

    function getGaugeAddress(address token) external view returns (address) {
        return gauge_[token];
    }

    function setGauge(Gauge memory gauge) internal {
        gauge_[gauge.stakingToken] = gauge.gaugeAddress;

        emit GaugeSet(gauge.gaugeAddress, gauge.stakingToken);
    }
}
/**
 * @title Adapter for Curve protocol (liquidity gauges).
 * @dev Implementation of ProtocolAdapter interface.
 * @author Igor Sobolev <sobolev@zerion.io>
 */
function getBalance(address token, address account) external view override returns (uint256) {
    return ERC20(gauge_[token]).balanceOf(account);
}

/**
 * @return Amount of staked tokens for a given account.
 * @dev Implementation of ProtocolAdapter interface function.
 */