diff --git a/contracts/adapters/SynthetixAdapter.sol b/contracts/adapters/SynthetixAdapter.sol index ec7299b5..5ba0c674 100755 --- a/contracts/adapters/SynthetixAdapter.sol +++ b/contracts/adapters/SynthetixAdapter.sol @@ -5,6 +5,17 @@ import { Adapter } from "./Adapter.sol"; import { Component } from "../Structs.sol"; +/** + * @dev Proxy contract interface. + * Only the functions required for SynthetixAdapter contract are added. + * The Proxy contract is available here + * https://github.com/Synthetixio/synthetix/blob/master/contracts/Proxy.sol. + */ +interface Proxy { + function target() external view returns (address); +} + + /** * @dev Synthetix contract interface. * Only the functions required for SynthetixAdapter contract are added. @@ -25,8 +36,8 @@ interface Synthetix { */ contract SynthetixAdapter is Adapter { - address internal constant SNX = 0x153C3148A0a285A6f9F6d1996E1348832249bF7e; - address internal constant SUSD = 0x2A020C1ad728f1C12735bC4877CEECa4491A4a3D; + address internal constant SNX = 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F; + address internal constant SUSD = 0x57Ab1ec28D129707052df4dF418D58a2D46d5f51; /** * @return Name of the protocol. @@ -41,7 +52,7 @@ contract SynthetixAdapter is Adapter { * @dev Implementation of Adapter function. */ function getAssetAmount(address asset, address user) external view override returns (int256) { - Synthetix synthetix = Synthetix(SNX); + Synthetix synthetix = Synthetix(Proxy(SNX).target()); if (asset == SNX) { return int256(synthetix.balanceOf(user) - synthetix.transferableSynthetix(user)); } else if (asset == SUSD) { diff --git a/migrations_scripts/1_deploy_registry_and_all_adapters.js b/migrations_scripts/1_deploy_registry_and_all_adapters.js index f084d209..13fba949 100755 --- a/migrations_scripts/1_deploy_registry_and_all_adapters.js +++ b/migrations_scripts/1_deploy_registry_and_all_adapters.js @@ -23,7 +23,7 @@ module.exports = (deployer, network, accounts) => { const mkrAddress = '0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2'; const manaAddress = '0x0F5D2fB29fb7d3CFeE444a200298f468908cC942'; const zrxAddress = '0xE41d2489571d322189246DaFA5ebDe1F4699F498'; - const snxProxyAddress = '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F'; + const snxAddress = '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F'; const wbtcAddress = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'; const cDAIAddress = '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643'; @@ -41,8 +41,6 @@ module.exports = (deployer, network, accounts) => { const saiAddress = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359'; - const snxAddress = '0x7cB89c509001D25dA9938999ABFeA6740212E5f0'; - const aaveAdapterAssets = [ daiAddress, tusdAddress, diff --git a/test/SynthetixAdapter.js b/test/SynthetixAdapter.js index 598efce4..3abdb4b8 100755 --- a/test/SynthetixAdapter.js +++ b/test/SynthetixAdapter.js @@ -2,8 +2,8 @@ const AdapterRegistry = artifacts.require('./AdapterRegistry'); const SynthetixAdapter = artifacts.require('./SynthetixAdapter'); contract('SynthetixAdapter', () => { - const snxAddress = '0x153C3148A0a285A6f9F6d1996E1348832249bF7e'; - const susdAddress = '0x2A020C1ad728f1C12735bC4877CEECa4491A4a3D'; + const snxAddress = '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F'; + const susdAddress = '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51'; const testAddress = '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b'; const incorrectAsset = '0x1C83501478f1320977047008496DACBD60Bb15ef';