Skip to content

Commit

Permalink
Merge pull request #476 from equilibria-xyz/arjun/rename-packages
Browse files Browse the repository at this point in the history
[Cleanup] Rename packages to @perennial namespace
  • Loading branch information
arjun-io authored Oct 16, 2024
2 parents ab22885 + c62b3de commit 33ba539
Show file tree
Hide file tree
Showing 93 changed files with 283 additions and 304 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2 run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/core run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
MAINNET_NODE_URL: ${{ secrets.MAINNET_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2 run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/core run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-account run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/account run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
ARBITRUM_NODE_URL: ${{ secrets.ARBITRUM_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-account run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/account run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
MAINNET_NODE_URL: ${{ secrets.MAINNET_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
ARBITRUM_SEPOLIA_NODE_URL: ${{ secrets.ARBITRUM_SEPOLIA_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integrationSepolia' || 'test:integrationSepolia' }}
yarn workspace @perennial/oracle run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integrationSepolia' || 'test:integrationSepolia' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-order run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/order run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -352,7 +352,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
ARBITRUM_NODE_URL: ${{ secrets.ARBITRUM_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-order run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/order run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-vault run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/vault run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -413,7 +413,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
MAINNET_NODE_URL: ${{ secrets.MAINNET_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-vault run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/vault run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -444,7 +444,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-extensions run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/extensions run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -474,7 +474,7 @@ jobs:
MOCHA_RETRY_COUNT: 2
MAINNET_NODE_URL: ${{ secrets.MAINNET_NODE_URL }}
run: |
yarn workspace @equilibria/perennial-v2-extensions run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
yarn workspace @perennial/extensions run ${{ env.PARSER_BROKEN != 'true' && 'coverage:integration' || 'test:integration' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -505,7 +505,7 @@ jobs:
MOCHA_REPORTER: dot
MOCHA_RETRY_COUNT: 2
run: |
yarn workspace @equilibria/perennial-v2-verifier run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
yarn workspace @perennial/verifier run ${{ env.PARSER_BROKEN != 'true' && 'coverage' || 'test' }}
- name: Upload lcov file
uses: actions/upload-artifact@v3
with:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

## 📦 Packages

| Package | Description | Latest Version |
| -------------------------- | :-------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------: |
| `@perennial-v2` | Core perennial smart contracts. | [![npm version](https://badge.fury.io/js/@equilibria%2Fperennial-v2.svg)](https://badge.fury.io/js/@equilibria%2Fperennial-v2) |
| `@perennial-v2-deploy` | Deployment scripts and artifacts. | [![npm version](https://badge.fury.io/js/@equilibria%2Fperennial-v2-deploy.svg)](https://badge.fury.io/js/@equilibria%2Fperennial-v2-deploy) |
| `@perennial-v2-extensions` | Extension smart contracts. | [![npm version](https://badge.fury.io/js/@equilibria%2Fperennial-v2-extensions.svg)](https://badge.fury.io/js/@equilibria%2Fperennial-v2-extensions) |
| `@perennial-v2-oracle` | Oracle provider smart contracts. | [![npm version](https://badge.fury.io/js/@equilibria%2Fperennial-v2-oracle.svg)](https://badge.fury.io/js/@equilibria%2Fperennial-v2-oracle) |
| `@perennial-v2-vault` | Vault smart contracts. | [![npm version](https://badge.fury.io/js/@equilibria%2Fperennial-v2-vault.svg)](https://badge.fury.io/js/@equilibria%2Fperennial-v2-vault) |
| Package | Description | Latest Version |
| ----------------------- | :-------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------: |
| `@perennial/core` | Core perennial smart contracts. | [![npm version](https://badge.fury.io/js/@perennial%2Fcore.svg)](https://badge.fury.io/js/@perennial%2Fcore) |
| `@perennial/deploy` | Deployment scripts and artifacts. | [![npm version](https://badge.fury.io/js/@perennial%2Fperennial/deploy.svg)](https://badge.fury.io/js/@perennial%2Fperennial/deploy) |
| `@perennial/extensions` | Extension smart contracts. | [![npm version](https://badge.fury.io/js/@perennial%2Fperennial/extensions.svg)](https://badge.fury.io/js/@perennial%2Fperennial/extensions) |
| `@perennial/oracle` | Oracle provider smart contracts. | [![npm version](https://badge.fury.io/js/@perennial%2Fperennial/oracle.svg)](https://badge.fury.io/js/@perennial%2Fperennial/oracle) |
| `@perennial/vault` | Vault smart contracts. | [![npm version](https://badge.fury.io/js/@perennial%2Fperennial/vault.svg)](https://badge.fury.io/js/@perennial%2Fperennial/vault) |

## 🔗 Resources

Expand Down Expand Up @@ -40,7 +40,7 @@ This also generates the Typechain types

### Test

Perennial has 4 logic packages: `perennial-v2`, `perennial-v2-extensions`, `perennial-v2-oracle`, and `perennial-v2-vault`
Perennial has 4 logic packages: `core`, `deploy`, `extensions`, `oracle`, and `vault`

Run the Mocha unit tests a specific package:

Expand All @@ -51,7 +51,7 @@ $ yarn workspace @equilibria/<package-name> run test
For example, to run the tests for the core package:

```sh
$ yarn workspace @equilibria/perennial-v2 run test
$ yarn workspace @perennial/core run test
```

To run tests against a Mainnet fork, set your `MAINNET_NODE_URL` in the root `.env` and run
Expand All @@ -63,7 +63,7 @@ $ yarn workspace run @equilibria/<package-name> test:integration
For example, to run the integration tests for the core package:

```sh
$ yarn workspace @equilibria/perennial-v2 run test:integration
$ yarn workspace @perennial/core run test:integration
```

## 🔐 Security
Expand Down
4 changes: 2 additions & 2 deletions packages/perennial-account/contracts/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Token6 } from "@equilibria/root/token/types/Token6.sol";
import { Token18 } from "@equilibria/root/token/types/Token18.sol";

import { IAccount } from "./interfaces/IAccount.sol";
import { IMarket, Position } from "@equilibria/perennial-v2/contracts/interfaces/IMarket.sol";
import { IMarket, Position } from "@perennial/core/contracts/interfaces/IMarket.sol";

/// @title Account
/// @notice Collateral Accounts allow users to manage collateral across Perennial markets
Expand Down Expand Up @@ -108,4 +108,4 @@ contract Account is IAccount, Instance {
if (msg.sender != owner && msg.sender != address(factory())) revert AccountNotAuthorizedError();
_;
}
}
}
2 changes: 1 addition & 1 deletion packages/perennial-account/contracts/AccountVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.24;
import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import { VerifierBase } from "@equilibria/root/verifier/VerifierBase.sol";
import { IMarketFactory } from "@equilibria/perennial-v2/contracts/interfaces/IMarketFactory.sol";
import { IMarketFactory } from "@perennial/core/contracts/interfaces/IMarketFactory.sol";

import { IAccountVerifier } from "./interfaces/IAccountVerifier.sol";
import { IRelayVerifier } from "./interfaces/IRelayVerifier.sol"; // only needed for docstrings
Expand Down
2 changes: 1 addition & 1 deletion packages/perennial-account/contracts/Controller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Token6 } from "@equilibria/root/token/types/Token6.sol";
import { Token18 } from "@equilibria/root/token/types/Token18.sol";
import { Fixed6, Fixed6Lib } from "@equilibria/root/number/types/Fixed6.sol";
import { UFixed6, UFixed6Lib } from "@equilibria/root/number/types/UFixed6.sol";
import { IMarketFactory } from "@equilibria/perennial-v2/contracts/interfaces/IMarketFactory.sol";
import { IMarketFactory } from "@perennial/core/contracts/interfaces/IMarketFactory.sol";

import { IAccount, IMarket } from "./interfaces/IAccount.sol";
import { IAccountVerifier, IController } from "./interfaces/IController.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.24;
import { Kept_Arbitrum, Kept } from "@equilibria/root/attribute/Kept/Kept_Arbitrum.sol";
import { UFixed18 } from "@equilibria/root/number/types/UFixed18.sol";
import { IVerifierBase } from "@equilibria/root/verifier/interfaces/IVerifierBase.sol";
import { IMarketFactory } from "@equilibria/perennial-v2/contracts/interfaces/IMarketFactory.sol";
import { IMarketFactory } from "@perennial/core/contracts/interfaces/IMarketFactory.sol";
import { Controller_Incentivized } from "./Controller_Incentivized.sol";

/// @title Controller_Arbitrum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { UFixed18, UFixed18Lib } from "@equilibria/root/number/types/UFixed18.so
import { Token6 } from "@equilibria/root/token/types/Token6.sol";
import { Token18 } from "@equilibria/root/token/types/Token18.sol";
import { IVerifierBase } from "@equilibria/root/verifier/interfaces/IVerifierBase.sol";
import { IMarket } from "@equilibria/perennial-v2/contracts/interfaces/IMarket.sol";
import { IMarketFactory } from "@equilibria/perennial-v2/contracts/interfaces/IMarketFactory.sol";
import { IMarket } from "@perennial/core/contracts/interfaces/IMarket.sol";
import { IMarketFactory } from "@perennial/core/contracts/interfaces/IMarketFactory.sol";

import { IAccount } from "./interfaces/IAccount.sol";
import { IController } from "./interfaces/IController.sol";
Expand Down Expand Up @@ -321,4 +321,4 @@ abstract contract Controller_Incentivized is Controller, IRelayer, Kept {
data
);
}
}
}
4 changes: 2 additions & 2 deletions packages/perennial-account/contracts/interfaces/IAccount.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import { IMarket } from "@equilibria/perennial-v2/contracts/interfaces/IMarket.sol";
import { IMarket } from "@perennial/core/contracts/interfaces/IMarket.sol";
import { Fixed6 } from "@equilibria/root/number/types/Fixed6.sol";
import { UFixed18 } from "@equilibria/root/number/types/UFixed18.sol";
import { UFixed6 } from "@equilibria/root/number/types/UFixed6.sol";
Expand Down Expand Up @@ -44,4 +44,4 @@ interface IAccount {
/// @notice Converts a specified amount of DSU to USDC
/// @param amount Quantity of DSU to burn, in 18-decimal precision
function unwrap(UFixed18 amount) external;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.13;
import { Fixed6 } from "@equilibria/root/number/types/Fixed6.sol";
import { Token6 } from "@equilibria/root/token/types/Token6.sol";
import { Token18 } from "@equilibria/root/token/types/Token18.sol";
import { IMarketFactory } from "@equilibria/perennial-v2/contracts/interfaces/IMarketFactory.sol";
import { IMarketFactory } from "@perennial/core/contracts/interfaces/IMarketFactory.sol";

import { IAccount, IMarket } from "../interfaces/IAccount.sol";
import { IAccountVerifier } from "../interfaces/IAccountVerifier.sol";
Expand Down Expand Up @@ -157,4 +157,4 @@ interface IController {
/// @param withdrawal Message requesting a withdrawal
/// @param signature ERC712 message signature
function withdrawWithSignature(Withdrawal calldata withdrawal, bytes calldata signature) external;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import { AccessUpdateBatch, AccessUpdateBatchLib } from "@equilibria/perennial-v2-verifier/contracts/types/AccessUpdateBatch.sol";
import { AccessUpdateBatch, AccessUpdateBatchLib } from "@perennial/verifier/contracts/types/AccessUpdateBatch.sol";
import { Action, ActionLib } from "./Action.sol";

struct RelayedAccessUpdateBatch {
Expand All @@ -28,4 +28,4 @@ library RelayedAccessUpdateBatchLib {
function hash(RelayedAccessUpdateBatch memory self) internal pure returns (bytes32) {
return keccak256(abi.encode(STRUCT_HASH, AccessUpdateBatchLib.hash(self.accessUpdateBatch), ActionLib.hash(self.action)));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import { OperatorUpdate, OperatorUpdateLib } from "@equilibria/perennial-v2-verifier/contracts/types/OperatorUpdate.sol";
import { OperatorUpdate, OperatorUpdateLib } from "@perennial/verifier/contracts/types/OperatorUpdate.sol";
import { Action, ActionLib } from "./Action.sol";

struct RelayedOperatorUpdate {
Expand All @@ -28,4 +28,4 @@ library RelayedOperatorUpdateLib {
function hash(RelayedOperatorUpdate memory self) internal pure returns (bytes32) {
return keccak256(abi.encode(STRUCT_HASH, OperatorUpdateLib.hash(self.operatorUpdate), ActionLib.hash(self.action)));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import { SignerUpdate, SignerUpdateLib } from "@equilibria/perennial-v2-verifier/contracts/types/SignerUpdate.sol";
import { SignerUpdate, SignerUpdateLib } from "@perennial/verifier/contracts/types/SignerUpdate.sol";
import { Action, ActionLib } from "./Action.sol";

struct RelayedSignerUpdate {
Expand Down
6 changes: 3 additions & 3 deletions packages/perennial-account/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import defaultConfig from '../common/hardhat.default.config'

const config = defaultConfig({
dependencyPaths: [
'@equilibria/perennial-v2/contracts/MarketFactory.sol',
'@equilibria/perennial-v2/contracts/Market.sol',
'@equilibria/perennial-v2-verifier/contracts/interfaces/IVerifier.sol',
'@perennial/core/contracts/MarketFactory.sol',
'@perennial/core/contracts/Market.sol',
'@perennial/verifier/contracts/interfaces/IVerifier.sol',
],
})

Expand Down
4 changes: 2 additions & 2 deletions packages/perennial-account/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@equilibria/perennial-v2-account",
"name": "@perennial/account",
"version": "1.3.0",
"description": "Perennial V2 Collateral Account",
"files": [
Expand All @@ -24,6 +24,6 @@
"author": "",
"license": "APACHE-2.0",
"dependencies": {
"@equilibria/perennial-v2": "1.3.0"
"@perennial/core": "1.3.0"
}
}
4 changes: 2 additions & 2 deletions packages/perennial-account/test/helpers/arbitrumHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Oracle__factory,
PythFactory,
PythFactory__factory,
} from '@equilibria/perennial-v2-oracle/types/generated'
} from '@perennial/oracle/types/generated'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { createMarket, deployController, deployOracleFactory, deployProtocolForOracle } from './setupHelpers'
import {
Expand All @@ -26,7 +26,7 @@ import {
GasOracle__factory,
} from '../../types/generated'
import { impersonate } from '../../../common/testutil'
import { IVerifier } from '@equilibria/perennial-v2/types/generated'
import { IVerifier } from '@perennial/core/types/generated'

const PYTH_ADDRESS = '0xff1a0f4744e8582DF1aE09D5611b887B6a12925C'
const PYTH_ETH_USD_PRICE_FEED = '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace'
Expand Down
Loading

0 comments on commit 33ba539

Please sign in to comment.