Skip to content

Commit 46ac5ef

Browse files
authored
feat: rename to oval (#8)
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
1 parent 0e585b1 commit 46ac5ef

File tree

9 files changed

+34
-29
lines changed

9 files changed

+34
-29
lines changed

.gitmodules

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[submodule "lib/forge-std"]
22
path = lib/forge-std
33
url = https://github.com/foundry-rs/forge-std.git
4-
[submodule "lib/oev-contracts"]
5-
path = lib/oev-contracts
6-
url = https://github.com/UMAprotocol/oev-contracts.git
74
[submodule "lib/openzeppelin-contracts"]
85
path = lib/openzeppelin-contracts
96
url = https://github.com/OpenZeppelin/openzeppelin-contracts
7+
[submodule "lib/oval-contracts"]
8+
path = lib/oval-contracts
9+
url = https://github.com/UMAprotocol/oval-contracts
10+
[submodule "lib/oev-contracts"]
11+
path = lib/oev-contracts
12+
url = https://github.com/UMAprotocol/oev-contracts

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# <h1 align="center"> OEV Share HoneyPot Demo </h1>
1+
# <h1 align="center"> Oval HoneyPot Demo </h1>
22

3-
**This repository is a demonstration of the OEV Share system and a HoneyPot mechanism. It showcases how a backrunner can liquidate a position, in this particular case, how a HoneyPot can be emptied given a specific price change.**
3+
**This repository is a demonstration of the Oval system and a HoneyPot mechanism. It showcases how a backrunner can liquidate a position, in this particular case, how a HoneyPot can be emptied given a specific price change.**
44

5-
![Github Actions](https://github.com/UMAprotocol/oev-demo/workflows/CI/badge.svg)
5+
![Github Actions](https://github.com/UMAprotocol/oval-demo/workflows/CI/badge.svg)
66

77
## Introduction
88

@@ -21,7 +21,7 @@ forge test`
2121
## Contracts Overview
2222

2323
- **HoneyPot**: Represents the honey pot, which can be emptied when a price oracle returns a value different from a pre-defined liquidation price. The honey pot's funds can also be reset by its owner.
24-
- **HoneyPotOEVShare**: Acts as the oracle which retrieves prices from various sources like Chainlink, Chronicle, and Pyth.
24+
- **HoneyPotOval**: Acts as the oracle which retrieves prices from various sources like Chainlink, Chronicle, and Pyth.
2525
- **Test Contract**: Sets up the environment, including simulating price changes and testing the mechanisms for creating and emptying the HoneyPot.
2626

2727
## Deploy the Contracts

lib/oev-contracts

lib/oval-contracts

Submodule oval-contracts added at 25afc49

remappings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ds-test/=lib/forge-std/lib/ds-test/src/
22
forge-std/=lib/forge-std/src/
3+
oval-contracts/=lib/oval-contracts/src/
34
oev-contracts/=lib/oev-contracts/src/
45
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/

script/HoneyPot.s.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import "forge-std/Script.sol";
66

77
import {ChronicleMedianSourceMock} from "../src/mock/ChronicleMedianSourceMock.sol";
88
import {IMedian} from "oev-contracts/interfaces/chronicle/IMedian.sol";
9-
import {HoneyPotOEVShare} from "../src/HoneyPotOEVShare.sol";
9+
import {HoneyPotOval} from "../src/HoneyPotOval.sol";
1010
import {HoneyPot} from "../src/HoneyPot.sol";
1111
import {HoneyPotDAO} from "../src/HoneyPotDAO.sol";
12-
import {IAggregatorV3Source} from "oev-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
12+
import {IAggregatorV3Source} from "oval-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
1313

1414
contract HoneyPotDeploymentScript is Script {
15-
HoneyPotOEVShare oevShare;
15+
HoneyPotOval oval;
1616
HoneyPot honeyPot;
1717
HoneyPotDAO honeyPotDAO;
1818
ChronicleMedianSourceMock chronicleMock;
@@ -32,15 +32,15 @@ contract HoneyPotDeploymentScript is Script {
3232
// Create mock ChronicleMedianSource and set the latest source data.
3333
chronicleMock = new ChronicleMedianSourceMock();
3434

35-
oevShare = new HoneyPotOEVShare(
35+
oval = new HoneyPotOval(
3636
chainlink,
3737
address(chronicleMock),
3838
pyth,
3939
pythPriceId,
4040
8
4141
);
4242

43-
honeyPot = new HoneyPot(IAggregatorV3Source(address(oevShare)));
43+
honeyPot = new HoneyPot(IAggregatorV3Source(address(oval)));
4444

4545
honeyPotDAO = new HoneyPotDAO();
4646

src/HoneyPot.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity 0.8.17;
33

44
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
55
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
6-
import {IAggregatorV3Source} from "oev-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
6+
import {IAggregatorV3Source} from "oval-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
77

88
contract HoneyPot is Ownable {
99
struct HoneyPotDetails {
@@ -12,7 +12,7 @@ contract HoneyPot is Ownable {
1212
}
1313

1414
mapping(address => HoneyPotDetails) public honeyPots;
15-
IAggregatorV3Source public oracle; // OEV Share serving as a Chainlink oracle
15+
IAggregatorV3Source public oracle; // Oval serving as a Chainlink oracle
1616

1717
event OracleUpdated(address indexed newOracle);
1818
event HoneyPotCreated(address indexed creator, int256 liquidationPrice, uint256 initialBalance);

src/HoneyPotOEVShare.sol renamed to src/HoneyPotOval.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {IAggregatorV3Source} from "oev-contracts/interfaces/chainlink/IAggregato
88
import {IMedian} from "oev-contracts/interfaces/chronicle/IMedian.sol";
99
import {IPyth} from "oev-contracts/interfaces/pyth/IPyth.sol";
1010

11-
contract HoneyPotOEVShare is BaseController, BoundedUnionSourceAdapter, ChainlinkDestinationAdapter {
11+
contract HoneyPotOval is BaseController, BoundedUnionSourceAdapter, ChainlinkDestinationAdapter {
1212
constructor(
1313
address chainlinkSource,
1414
address chronicleSource,

test/HoneyPot.sol

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
pragma solidity 0.8.17;
33

44
import {CommonTest} from "./Common.sol";
5-
import {IAggregatorV3Source} from "oev-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
5+
import {IAggregatorV3Source} from "oval-contracts/interfaces/chainlink/IAggregatorV3Source.sol";
66
import {IMedian} from "oev-contracts/interfaces/chronicle/IMedian.sol";
77
import {IPyth} from "oev-contracts/interfaces/pyth/IPyth.sol";
88

9-
import {HoneyPotOEVShare} from "../src/HoneyPotOEVShare.sol";
9+
import {HoneyPotOval} from "../src/HoneyPotOval.sol";
1010
import {HoneyPot} from "../src/HoneyPot.sol";
1111
import {HoneyPotDAO} from "../src/HoneyPotDAO.sol";
1212
import {ChronicleMedianSourceMock} from "../src/mock/ChronicleMedianSourceMock.sol";
@@ -26,7 +26,7 @@ contract HoneyPotTest is CommonTest {
2626

2727
ChronicleMedianSourceMock chronicleMock;
2828

29-
HoneyPotOEVShare oevShare;
29+
HoneyPotOval oval;
3030
HoneyPot honeyPot;
3131
HoneyPotDAO honeyPotDAO;
3232

@@ -35,26 +35,26 @@ contract HoneyPotTest is CommonTest {
3535

3636
function setUp() public {
3737
vm.createSelectFork("mainnet", 18419040); // Recent block on mainnet
38-
oevShare = new HoneyPotOEVShare(
38+
oval = new HoneyPotOval(
3939
address(chainlink),
4040
address(chronicle),
4141
address(pyth),
4242
pythPriceId,
4343
8
4444
);
4545

46-
honeyPot = new HoneyPot(IAggregatorV3Source(address(oevShare)));
46+
honeyPot = new HoneyPot(IAggregatorV3Source(address(oval)));
4747
honeyPotDAO = new HoneyPotDAO();
4848
_whitelistOnChronicle();
49-
oevShare.setUnlocker(address(this), true);
49+
oval.setUnlocker(address(this), true);
5050
chronicleMock = new ChronicleMedianSourceMock();
5151
}
5252

5353
receive() external payable {}
5454

5555
function _whitelistOnChronicle() internal {
5656
vm.startPrank(0xBE8E3e3618f7474F8cB1d074A26afFef007E98FB); // DSPause that is a ward (can add kiss to chronicle)
57-
chronicle.kiss(address(oevShare));
57+
chronicle.kiss(address(oval));
5858
chronicle.kiss(address(this)); // So that we can read Chronicle directly.
5959
vm.stopPrank();
6060
}
@@ -96,7 +96,7 @@ contract HoneyPotTest is CommonTest {
9696

9797
function testCrackHoneyPot() public {
9898
// Create HoneyPot for the caller
99-
(, int256 currentPrice,,,) = oevShare.latestRoundData();
99+
(, int256 currentPrice,,,) = oval.latestRoundData();
100100
vm.expectEmit(true, true, true, true);
101101
emit HoneyPotCreated(address(this), currentPrice, honeyPotBalance);
102102
honeyPot.createHoneyPot{value: honeyPotBalance}();
@@ -111,7 +111,7 @@ contract HoneyPotTest is CommonTest {
111111
mockChainlinkPriceChange();
112112

113113
// Unlock the latest value
114-
oevShare.unlockLatestValue();
114+
oval.unlockLatestValue();
115115

116116
uint256 liquidatorBalanceBefore = liquidator.balance;
117117

@@ -145,17 +145,17 @@ contract HoneyPotTest is CommonTest {
145145
uint256 read = chronicle.read();
146146
chronicleMock.setLatestSourceData(read, age);
147147

148-
HoneyPotOEVShare oevShare2 = new HoneyPotOEVShare(
148+
HoneyPotOval oval2 = new HoneyPotOval(
149149
address(chainlink),
150150
address(chronicleMock),
151151
address(pyth),
152152
pythPriceId,
153153
8
154154
);
155-
oevShare2.setUnlocker(address(this), true);
155+
oval2.setUnlocker(address(this), true);
156156

157157
HoneyPot honeyPot2 = new HoneyPot(
158-
IAggregatorV3Source(address(oevShare2))
158+
IAggregatorV3Source(address(oval2))
159159
);
160160

161161
// Create HoneyPot for the caller
@@ -171,7 +171,7 @@ contract HoneyPotTest is CommonTest {
171171
chronicleMock.setLatestSourceData((read * 103) / 100, uint32(block.timestamp - 1));
172172

173173
// Unlock the latest value
174-
oevShare2.unlockLatestValue();
174+
oval2.unlockLatestValue();
175175

176176
uint256 liquidatorBalanceBefore = liquidator.balance;
177177

0 commit comments

Comments
 (0)