Skip to content

Commit

Permalink
feat: refactored UmaV3
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnyxos committed Dec 13, 2023
1 parent 54a9339 commit a1600c9
Show file tree
Hide file tree
Showing 14 changed files with 541 additions and 348 deletions.
52 changes: 32 additions & 20 deletions script/v2/V2DeployContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import "../../src/v2/oracles/individual/GdaiPriceProvider.sol";
import "../../src/v2/oracles/individual/UmaV2PriceProvider.sol";
import "../../src/v2/oracles/individual/UmaV2AssertionProvider.sol";
import "../../src/v2/oracles/individual/UmaV3PriceAssertionProvider.sol";
import "../../src/v2/oracles/individual/UmaV3DynamicAssertionProvider.sol";
import "../../src/v2/oracles/individual/PythPriceProvider.sol";
import "../../src/v2/TimeLock.sol";
import "./V2Helper.sol";
Expand Down Expand Up @@ -131,9 +132,9 @@ contract V2DeployContracts is Script, HelperV2 {
// DIAPriceProvider diaPriceProvider = new DIAPriceProvider(diaOracleV2);

uint256 timeOut = 2 hours;
address umaCurrency = 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8;
address umaV2Finder = 0xB0b9f73B424AD8dc58156C2AE0D7A1115D1EcCd1;
uint128 reward = 5e6;
// address umaCurrency = 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8;
// address umaV2Finder = 0xB0b9f73B424AD8dc58156C2AE0D7A1115D1EcCd1;
// uint128 reward = 5e6;

// uint256 umaDecimals = 18;
// string memory umaDescription = "FUSD/USD";
Expand All @@ -150,20 +151,20 @@ contract V2DeployContracts is Script, HelperV2 {
// reward
// );

string memory umaDescription = "AAVE aUSDC Hack Market";
string
memory ancillaryData = "q: Aave USDC.e pool (address: 0x625E7708f30cA75bfd92586e17077590C60eb4cD) on Arbitrum One was hacked or compromised leading to locked funds or >25% loss in TVL value after the timestamp of: ";
UmaV2AssertionProvider umaV2AssertionProvider = new UmaV2AssertionProvider(
timeOut,
umaDescription,
umaV2Finder,
umaCurrency,
ancillaryData,
reward
);
// string memory umaDescription = "AAVE aUSDC Hack Market";
// string
// memory ancillaryData = "q: Aave USDC.e pool (address: 0x625E7708f30cA75bfd92586e17077590C60eb4cD) on Arbitrum One was hacked or compromised leading to locked funds or >25% loss in TVL value after the timestamp of: ";
// UmaV2AssertionProvider umaV2AssertionProvider = new UmaV2AssertionProvider(
// timeOut,
// umaDescription,
// umaV2Finder,
// umaCurrency,
// ancillaryData,
// reward
// );

// uint256 umaDecimals = 18;
// address umaOOV3 = address(0x123);
address umaOOV3 = 0xa6147867264374F324524E30C02C331cF28aa879;
// string memory umaDescription = "USDC";
// uint256 requiredBond = 1e6;
// bytes32 defaultIdentifier = bytes32("abc");
Expand All @@ -181,6 +182,17 @@ contract V2DeployContracts is Script, HelperV2 {
// requiredBond
// );

string memory marketDescription = "ETH Volatility";
uint256 requiredBond = 1e6;
address currency = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1; // WETH_ADDRESS
UmaV3DynamicAssertionProvider umaV3Provider = new UmaV3DynamicAssertionProvider(
marketDescription,
timeOut,
umaOOV3,
currency,
requiredBond
);

// address pythContract = 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C;
// // bytes32 fdUsdFeedId = 0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979;
// bytes32 cUsdFeedId = 0x8f218655050a1476b780185e89f19d2b1e1f49e9bd629efad6ac547a946bf6ab;
Expand Down Expand Up @@ -233,11 +245,11 @@ contract V2DeployContracts is Script, HelperV2 {
// console2.log("Dia Price Provider", address(diaPriceProvider));
// console.log("Pyth Price Provider", address(pythProvider));
// console2.log("Uma V2 Price Provider", address(umaV2PriceProvider));
console2.log(
"Uma V2 Assertion Provider",
address(umaV2AssertionProvider)
);
// console2.log("Uma Price Provider", address(umaPriceProvider));
// console2.log(
// "Uma V2 Assertion Provider",
// address(umaV2AssertionProvider)
// );
// console2.log("Uma V3 Provider", address(umaV3Provider));

// console2.log("resolveKeeper address", address(resolveKeeper));
// console2.log("resolveKeeperGenericController address", address(resolveKeeperGenericController));
Expand Down
6 changes: 0 additions & 6 deletions src/v2/interfaces/IConditionProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
pragma solidity 0.8.17;

interface IConditionProvider {
function setConditionType(uint256 _marketId, uint256 _condition) external;

function getLatestPrice() external view returns (int256);

function conditionMet(
Expand All @@ -15,8 +13,4 @@ interface IConditionProvider {
external
view
returns (uint80, int256, uint256, uint256, uint80);

function marketIdToConditionType(
uint256 _marketId
) external view returns (uint256);
}
2 changes: 2 additions & 0 deletions src/v2/interfaces/IOptimisticOracleV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ interface IOptimisticOracleV3 {
) external payable returns (bytes32 assertionId);

function getMinimumBond(address currency) external returns (uint256);

function defaultIdentifier() external returns (bytes32);
}
Loading

0 comments on commit a1600c9

Please sign in to comment.