diff --git a/contracts/adapters/CurveCompoundAdapter.sol b/contracts/adapters/CurveCompoundAdapter.sol index 5a1aa942..b4bd9918 100755 --- a/contracts/adapters/CurveCompoundAdapter.sol +++ b/contracts/adapters/CurveCompoundAdapter.sol @@ -37,7 +37,7 @@ interface stableswap { */ contract CurveCompoundAdapter is Adapter { - address constant internal SS = 0x2e60CF74d81ac34eB21eEff58Db4D385920ef419; + address constant internal SS = 0xA2B47E3D5c44877cca798226B7B8118F9BFb7A56; /** * @return Name of the protocol. diff --git a/contracts/adapters/PoolTogetherAdapter.sol b/contracts/adapters/PoolTogetherAdapter.sol index 73fb0f6d..c81aa399 100755 --- a/contracts/adapters/PoolTogetherAdapter.sol +++ b/contracts/adapters/PoolTogetherAdapter.sol @@ -25,8 +25,10 @@ contract PoolTogetherAdapter is Adapter { address internal constant SAI = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359; address internal constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F; + address internal constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; address internal constant POOL_SAI = 0xb7896fce748396EcFC240F5a0d3Cc92ca42D7d84; address internal constant POOL_DAI = 0x29fe7D60DdF151E5b52e5FAB4f1325da6b2bD958; + address internal constant POOL_USDC = 0x0034Ea9808E620A0EF79261c51AF20614B742B24; /** * @return Name of the protocol. @@ -37,7 +39,7 @@ contract PoolTogetherAdapter is Adapter { } /** - * @return Amount of DAI/SAI locked on the protocol by the given user. + * @return Amount of DAI/SAI/USDC locked on the protocol by the given user. * @dev Implementation of Adapter function. */ function getAssetAmount(address asset, address user) external view override returns (int256) { @@ -45,6 +47,8 @@ contract PoolTogetherAdapter is Adapter { return int256(BasePool(POOL_DAI).totalBalanceOf(user)); } else if (asset == SAI) { return int256(BasePool(POOL_SAI).totalBalanceOf(user)); + } else if (asset == USDC) { + return int256(BasePool(POOL_USDC).totalBalanceOf(user)); } else { return int256(0); } diff --git a/test/CurveCompoundAdapter.js b/test/CurveCompoundAdapter.js index 3a470508..72545db4 100755 --- a/test/CurveCompoundAdapter.js +++ b/test/CurveCompoundAdapter.js @@ -3,7 +3,7 @@ const AdapterRegistry = artifacts.require('./AdapterRegistry'); const CurveAdapter = artifacts.require('./CurveCompoundAdapter'); contract('CurveCompoundAdapter', () => { - const ssTokenAddress = '0x3740fb63ab7a09891d7c0d4299442A551D06F5fD'; + const ssTokenAddress = '0x845838DF265Dcd2c412A1Dc9e959c7d08537f8a2'; const DAIAddress = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; const USDCAddress = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; const testAddress = '0x42b9dF65B219B3dD36FF330A4dD8f327A6Ada990'; diff --git a/test/PoolTogetherAdapter.js b/test/PoolTogetherAdapter.js index ffeea518..27aa8e81 100755 --- a/test/PoolTogetherAdapter.js +++ b/test/PoolTogetherAdapter.js @@ -5,7 +5,9 @@ const PoolTogetherAdapter = artifacts.require('./PoolTogetherAdapter'); contract('PoolTogetherAdapter', () => { const daiAddress = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; const saiAddress = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359'; - const testAddress = '0x7e5ce10826ee167de897d262fcc9976f609ecd2b'; + const usdcAddress = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; + + const testAddress = '0x42b9dF65B219B3dD36FF330A4dD8f327A6Ada990'; const incorrectAsset = '0x1C83501478f1320977047008496DACBD60Bb15ef'; let accounts; @@ -20,7 +22,7 @@ contract('PoolTogetherAdapter', () => { }); await AdapterRegistry.new( [poolAdapter.options.address], - [[daiAddress, saiAddress]], + [[daiAddress, saiAddress, usdcAddress]], { from: accounts[0] }, ) .then((result) => { @@ -37,16 +39,26 @@ contract('PoolTogetherAdapter', () => { // eslint-disable-next-line no-console console.log(`Deposited DAI amount: ${daiAmount}`); assert.equal(result[0].name, 'PoolTogether'); + const usdcBase = new BN(10).pow(new BN(4)); + const usdcAmount = new BN(result[0].balances[2].amount).div(usdcBase) / 100; + // eslint-disable-next-line no-console + console.log(`Deposited USDC amount: ${usdcAmount}`); + assert.equal(result[0].name, 'PoolTogether'); assert.equal(result[0].balances[0].decimals, 18); assert.equal(result[0].balances[0].asset, daiAddress); assert.equal(result[0].balances[1].decimals, 18); assert.equal(result[0].balances[1].asset, saiAddress); + assert.equal(result[0].balances[2].decimals, 6); + assert.equal(result[0].balances[2].asset, usdcAddress); assert.equal(result[0].rates[0].asset, daiAddress); assert.equal(result[0].rates[0].components[0].underlying, daiAddress); assert.equal(result[0].rates[0].components[0].rate, 1e18); assert.equal(result[0].rates[1].asset, saiAddress); assert.equal(result[0].rates[1].components[0].underlying, saiAddress); assert.equal(result[0].rates[1].components[0].rate, 1e18); + assert.equal(result[0].rates[2].asset, usdcAddress); + assert.equal(result[0].rates[2].components[0].underlying, usdcAddress); + assert.equal(result[0].rates[2].components[0].rate, 1e18); }); });