Skip to content

Commit 36b0491

Browse files
authored
v2.0.2 release
- Update conditional order filled event to include Oracle used - Use Synthetix’s PerpsV2ExchangeRate to fetch prices from Pyth - Update where the fee is transferred when a conditional order is executed - Update _sUSDRate() to use both Pyth and Chainlink price feeds - Gelato-specific exploit analysis around incentives
2 parents ee07ae9 + d822c2a commit 36b0491

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1281
-593
lines changed

.gas-snapshot

Lines changed: 96 additions & 88 deletions
Large diffs are not rendered by default.

.gitmodules

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
[submodule "lib/forge-std"]
22
path = lib/forge-std
33
url = https://github.com/foundry-rs/forge-std
4-
branch = v1.5.1
5-
[submodule "lib/solmate"]
6-
path = lib/solmate
7-
url = https://github.com/transmissions11/solmate
8-
[submodule "lib/openzeppelin-contracts"]
9-
path = lib/openzeppelin-contracts
10-
url = https://github.com/OpenZeppelin/openzeppelin-contracts
11-
branch = v4.8.2
4+
branch = v1.5.1

.solhint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "solhint:recommended",
33
"rules": {
4+
"not-rely-on-time": "off",
45
"no-global-import": "off",
56
"no-inline-assembly": "off",
67
"func-name-mixedcase": "off",

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ src
125125

126126
## Test Coverage
127127

128-
| File | % Lines | % Statements | % Branches | % Funcs |
129-
|--------------------------------|------------------|------------------|-----------------|-----------------|
130-
| src/Account.sol | 98.53% (201/204) | 98.61% (213/216) | 92.11% (70/76) | 100.00% (35/35) |
131-
| src/AccountProxy.sol | 100.00% (10/10) | 76.92% (10/13) | 50.00% (3/6) | 100.00% (6/6) |
132-
| src/Events.sol | 100.00% (6/6) | 100.00% (6/6) | 100.00% (0/0) | 100.00% (6/6) |
133-
| src/Factory.sol | 100.00% (27/27) | 100.00% (34/34) | 85.71% (12/14) | 100.00% (6/6) |
134-
| src/Settings.sol | 100.00% (2/2) | 100.00% (2/2) | 100.00% (0/0) | 100.00% (1/1) |
135-
| src/utils/Auth.sol | 100.00% (15/15) | 100.00% (18/18) | 100.00% (10/10) | 100.00% (5/5) |
136-
| src/utils/OpsReady.sol | 100.00% (3/3) | 100.00% (4/4) | 75.00% (3/4) | 100.00% (1/1) |
128+
| File | % Lines | % Statements | % Branches | % Funcs |
129+
|--------------------------------------|------------------|------------------|------------------|-----------------|
130+
| src/Account.sol | 99.05% (209/211) | 99.10% (221/223) | 93.59% (73/78) | 100.00% (35/35) |
131+
| src/AccountProxy.sol | 100.00% (10/10) | 76.92% (10/13) | 50.00% (3/6) | 100.00% (6/6) |
132+
| src/Events.sol | 100.00% (6/6) | 100.00% (6/6) | 100.00% (0/0) | 100.00% (6/6) |
133+
| src/Factory.sol | 100.00% (27/27) | 100.00% (34/34) | 85.71% (12/14) | 100.00% (6/6) |
134+
| src/Settings.sol | 100.00% (2/2) | 100.00% (2/2) | 100.00% (0/0) | 100.00% (1/1) |
135+
| src/utils/Auth.sol | 100.00% (15/15) | 100.00% (18/18) | 100.00% (10/10) | 100.00% (5/5) |
136+
| src/utils/OpsReady.sol | 100.00% (3/3) | 100.00% (4/4) | 75.00% (3/4) | 100.00% (1/1) |
137137

138138
## Usage
139139

@@ -182,17 +182,16 @@ forge test --fork-url $(grep ARCHIVE_NODE_URL_GOERLI_L2 .env | cut -d '=' -f2) -
182182
2. Add new directory to `./script/upgrades/` with the version number as the directory name (i.e. v2.6.9)
183183
3. Create new `Upgrade.s.sol` for the new version in that directory
184184
4. Add new directory to `./test/upgrades/` with the version number as the directory name (i.e. v2.6.9)
185-
5. Create new `upgrade.vX.X.X.t.sol` for the new version (where vX.X.X is the version number) in that directory
186-
6. Test upgrade using new script (example: `./test/upgrades/v2.0.1/upgrade.v2.0.1.t.sol`)
187-
> If adding new contracts, make sure to test them in the `upgrade.vX.X.X.t.sol` file also
185+
5. Create new `Upgrade.t.sol` for the new version in that directory
186+
6. Test upgrade using new script (example: `./test/upgrades/v2.0.1/Upgrade.t.sol`)
188187
7. Run script and deploy to Testnet
189188
8. Call `Factory.upgradeAccountImplementation` with new `Account` address (can be done on etherscan)
190189
> Only factory owner can do this
191190
9. Update `./deploy-addresses/optimism-goerli.json` with new `Account` address
192-
10. Ensure tesnet accounts are updated and functional (ensure state is correct)
191+
10. Ensure testnet accounts are updated and functional (ensure state is correct)
193192
11. Run script and deploy to Mainnet
194193
12. Call `Factory.upgradeAccountImplementation` with new `Account` address (can be done on etherscan)
195-
> Only factory owner can do this (admin dao multisig or pDAO)
194+
> Only factory owner can do this (pDAO)
196195
13. Update `./deploy-addresses/optimism.json` with new `Account` address
197196
14. Ensure mainnet accounts are updated and functional (ensure state is correct)
198197

deploy-addresses/optimism-goerli.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Account": "0x76210dbA7b06bC40ec4E152D2Dcfd6bFa8102a8a",
3-
"Events": "0x91276Ad073Db556a84DA84aCFB960d3A2Fa7195a",
2+
"Account": "0xf9CC1eD5EC9b8DFb9273fdDABD07C7bB37938285",
3+
"Events": "0xa7AE3969A128048290968b41865Eaa53B20FA69e",
44
"Factory": "0x30582eeE34719fe22b1B6c3b607636A3ab94522E",
55
"Settings": "0xd2f3c4D549EF6AB572dB6512AB0e33f709E7caE1"
66
}

deploy-addresses/optimism.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Account": "0x640Cf0c438d5c7C39479935856329F6Bc5D2D52a",
3-
"Events": "0xABD4171d1be4ec3970992bC0e697342EA0BD913d",
2+
"Account": "0x3BC8D34314E77c2E36948Fd8F4B353f1baDc3F6C",
3+
"Events": "0x11193470df30B37Af9fc5Ec696c240D878bdfb42",
44
"Factory": "0x8234F990b149Ae59416dc260305E565e5DAfEb54",
55
"Settings": "0xD02813baF080d06FC6F706cF93F5DaA96D6edB17"
66
}

lib/openzeppelin-contracts

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/solmate

Lines changed: 0 additions & 1 deletion
This file was deleted.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kwenta/cross-margin-manager",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"scripts": {
55
"compile": "forge build",
66
"test": "forge test --fork-url $(grep ARCHIVE_NODE_URL_GOERLI_L2 .env | cut -d '=' -f2) --etherscan-api-key $(grep ETHERSCAN_API_KEY .env | cut -d '=' -f2) --gas-report -vvv",
@@ -15,7 +15,7 @@
1515
},
1616
"repository": {
1717
"type": "git",
18-
"url": "https://github.com/Kwenta/margin-manager"
18+
"url": "https://github.com/Kwenta/smart-margin"
1919
},
2020
"engines": {
2121
"node": ">=14.0.0"

0 commit comments

Comments
 (0)