diff --git a/src/v2/oracles/individual/UmaV2AssertionProvider.sol b/src/v2/oracles/individual/UmaV2AssertionProvider.sol index 88e6e157..552eb3d6 100644 --- a/src/v2/oracles/individual/UmaV2AssertionProvider.sol +++ b/src/v2/oracles/individual/UmaV2AssertionProvider.sol @@ -142,17 +142,12 @@ contract UmaV2AssertionProvider is Ownable { coverageStart, ANCILLARY_TAIL ); + currency.approve(address(oo), requiredBond); oo.requestPrice( PRICE_IDENTIFIER, block.timestamp, _bytesAncillary, currency, - 0 - ); - oo.setBond( - PRICE_IDENTIFIER, - block.timestamp, - _bytesAncillary, requiredBond ); oo.setCustomLiveness( diff --git a/src/v2/oracles/individual/UmaV2PriceProvider.sol b/src/v2/oracles/individual/UmaV2PriceProvider.sol index 8c70033c..3a773f64 100644 --- a/src/v2/oracles/individual/UmaV2PriceProvider.sol +++ b/src/v2/oracles/individual/UmaV2PriceProvider.sol @@ -132,17 +132,12 @@ contract UmaV2PriceProvider is Ownable { if (pendingAnswer.startedAt != 0) revert RequestInProgress(); bytes memory _bytesAncillary = abi.encodePacked(ancillaryData); + currency.approve(address(oo), requiredBond); oo.requestPrice( PRICE_IDENTIFIER, block.timestamp, _bytesAncillary, currency, - 0 - ); - oo.setBond( - PRICE_IDENTIFIER, - block.timestamp, - _bytesAncillary, requiredBond ); oo.setCustomLiveness( diff --git a/test/V2/oracles/individual/UmaV2AssertionProvider.t.sol b/test/V2/oracles/individual/UmaV2AssertionProvider.t.sol index c53793a7..092e4c1b 100644 --- a/test/V2/oracles/individual/UmaV2AssertionProvider.t.sol +++ b/test/V2/oracles/individual/UmaV2AssertionProvider.t.sol @@ -49,7 +49,6 @@ contract UmaV2AssertionProviderTest is Helper { umaDecimals = 8; umaDescription = "FUSD/ETH"; umaCurrency = USDC_TOKEN; - // TODO: Need to review how the configuration section should be composed ancillaryData = "q: Curve USDC pool on Arbitrum One was hacked or compromised leading to locked funds or >25% loss in TVL value after the timestamp of: "; requiredBond = 1e6; @@ -64,6 +63,7 @@ contract UmaV2AssertionProviderTest is Helper { ); uint256 condition = 2; umaV2AssertionProvider.setConditionType(marketId, condition); + deal(USDC_TOKEN, address(umaV2AssertionProvider), 1000e6); } //////////////////////////////////////////////// diff --git a/test/V2/oracles/individual/UmaV2PriceProvider.t.sol b/test/V2/oracles/individual/UmaV2PriceProvider.t.sol index 8c7915f2..db4027d0 100644 --- a/test/V2/oracles/individual/UmaV2PriceProvider.t.sol +++ b/test/V2/oracles/individual/UmaV2PriceProvider.t.sol @@ -50,7 +50,7 @@ contract UmaV2PriceProviderTest is Helper { umaDecimals = 8; umaDescription = "FUSD/USD"; umaCurrency = USDC_TOKEN; - ancillaryData = "base:FUSD,baseAddress:0x630410530785377d49992824a70b43bd5c482c9a,baseChain: 42161,quote:USD,quoteDetails:United States Dollar,rounding:6,fallback:"https://www.coingecko.com/en/coins/uma",configuration:{"type": "medianizer","minTimeBetweenUpdates": 60,"twapLength": 600,"medianizedFeeds":[{"type": "cryptowatch", "exchange": "coinbase-pro", "pair": "umausd" }, { "type": "cryptowatch", "exchange": "binance", "pair": "umausdt" }, { "type": "cryptowatch", "exchange": "okex", "pair": "umausdt" }]}"; + ancillaryData = 'base:FUSD,baseAddress:0x630410530785377d49992824a70b43bd5c482c9a,baseChain: 42161,quote:USD,quoteDetails:United States Dollar,rounding:6,fallback:"https://www.coingecko.com/en/coins/uma",configuration:{"type": "medianizer","minTimeBetweenUpdates": 60,"twapLength": 600,"medianizedFeeds":[{"type": "cryptowatch", "exchange": "coinbase-pro", "pair": "umausd" }, { "type": "cryptowatch", "exchange": "binance", "pair": "umausdt" }, { "type": "cryptowatch", "exchange": "okex", "pair": "umausdt" }]}'; requiredBond = 1e6; umaV2PriceProvider = new UmaV2PriceProvider( @@ -65,6 +65,7 @@ contract UmaV2PriceProviderTest is Helper { ); uint256 condition = 2; umaV2PriceProvider.setConditionType(marketId, condition); + deal(USDC_TOKEN, address(umaV2PriceProvider), 1000e6); } ////////////////////////////////////////////////