From a7dcefaa59a15da5da6d09dc7efb74bd46831734 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 5 May 2020 11:45:50 +0530 Subject: [PATCH] Added require conditions for token address --- contracts/connectors/curve.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/connectors/curve.sol b/contracts/connectors/curve.sol index bacbd82..a3a47d4 100644 --- a/contracts/connectors/curve.sol +++ b/contracts/connectors/curve.sol @@ -100,11 +100,14 @@ contract CurveHelpers is Stores, DSMath { } else if (token == address(0x57Ab1ec28D129707052df4dF418D58a2D46d5f51)) { // sUSD Token i = 3; + } else { + revert("token-not-found."); } } function getTokenAddr(ICurve curve, uint256 i) internal view returns (address token) { - return curve.underlying_coins(int128(i)); + token = curve.underlying_coins(int128(i)); + require(token != address(0), "token-not-found."); } }