* @dev Converts `buyWith` tokens to GD tokens and updates the bonding curve params.
* `buy` occurs only if the GD return is above the given minimum. It is possible
* to buy only with cDAI and when the contract is set to active.
* MUST `approve` prior this action to allow this contract to accomplish the
* @param _buyWith The tokens that should be converted to GD tokens
* @param _tokenAmount The amount of `buyWith` tokens that should be converted to GD tokens
* @param _minReturn The minimum allowed return in GD tokens
* @return (gdReturn) How much GD tokens were transferred
function buy(ERC20 _buyWith,uint256 _tokenAmount,uint256 _minReturn) public requireActive onlyCDai(_buyWith) returns (uint256)
* @dev Converts GD tokens to `sellTo` tokens and update the bonding curve params.
* `sell` occurs only if the token return is above the given minimum. Notice that
* there is a contribution amount from the given GD that remains in the reserve.
* It is only possible to sell to cDAI and only when the contract is set to
* active. MUST make call to G$ `approve` prior to this action to allow this
* contract to accomplish the conversion.
* @param _sellTo The tokens that will be received after the conversion
* @param _gdAmount The amount of GD tokens that should be converted to `_sellTo` tokens
* @param _minReturn The minimum allowed `sellTo` tokens return
* @return (tokenReturn) How much `sellTo` tokens were transferred
) public requireActive onlyCDai(_sellTo) returns (uint256)
* @dev Current price of GD in `token`. currently only cDAI is supported.
* @param _token The desired reserve token to have
function currentPrice(ERC20 _token) public view returns (uint256)