From d6992bc447b48b64594f22395607787b27d75f8a Mon Sep 17 00:00:00 2001 From: yruej301 <114962854+yruej301@users.noreply.github.com> Date: Thu, 20 Mar 2025 10:47:37 -0400 Subject: [PATCH 1/2] chore: readme (#84) --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..88dca2f --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Vertex Protocol + +This repository contains the smart contract implementations for the Vertex Protocol ecosystem. + +## Project Structure + +The repository is organized into two main projects: + +- **[vertex-contracts/core](./core)**: EVM implementation of Vertex core functionality +- **[vertex-contracts/lba](./lba)**: Vertex LBA (Liquidity Bootstrap Auction) contracts + +## Requirements + +- Node.js >=16 +- [Yarn](https://yarnpkg.com/) + +## Getting Started + +Each project has its own setup and development commands. Navigate to the respective directories for project-specific instructions: + +``` +# For Vertex EVM Core Contracts +cd vertex-contracts/core +yarn install +yarn compile + +# For Vertex LBA Contracts +cd vertex-contracts/lba +yarn install +# Follow the .env setup instructions +``` + +## Available Commands + +### Core Contracts + +- `yarn compile`: Compile Vertex EVM contracts +- See project-specific README for more details + +### LBA Contracts + +- `yarn lint`: Run prettier & SolHint +- `yarn contracts:force-compile`: Compile contracts and generate TS bindings + ABIs +- `yarn run-local-node`: Run a persistent local Hardhat node for testing +- See project-specific README for more details + +## Further Documentation + +For more detailed information about each project, please refer to their respective README files. \ No newline at end of file From 4c892a675ad0dc736f9333458388d5370737ba27 Mon Sep 17 00:00:00 2001 From: yruej301 <114962854+yruej301@users.noreply.github.com> Date: Mon, 21 Apr 2025 10:36:56 -0400 Subject: [PATCH 2/2] bump: v3.2.0 (#86) --- core/contracts/Clearinghouse.sol | 9 +++++++-- core/package.json | 2 +- lba/package.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/contracts/Clearinghouse.sol b/core/contracts/Clearinghouse.sol index 5eb3430..9b6288f 100644 --- a/core/contracts/Clearinghouse.sol +++ b/core/contracts/Clearinghouse.sol @@ -531,8 +531,13 @@ contract Clearinghouse is EndpointGated, ClearinghouseStorage, IClearinghouse { spotEngine.updateBalance(VLP_PRODUCT_ID, V_ACCOUNT, vlpAmount); int128 quoteAmount = vlpAmount.mul(oraclePriceX18); - spotEngine.updateBalance(QUOTE_PRODUCT_ID, txn.sender, quoteAmount); - spotEngine.updateBalance(QUOTE_PRODUCT_ID, V_ACCOUNT, -quoteAmount); + int128 burnFee = MathHelper.max(ONE, quoteAmount / 1000); + quoteAmount = MathHelper.max(0, quoteAmount - burnFee); + + if (quoteAmount != 0) { + spotEngine.updateBalance(QUOTE_PRODUCT_ID, txn.sender, quoteAmount); + spotEngine.updateBalance(QUOTE_PRODUCT_ID, V_ACCOUNT, -quoteAmount); + } require( spotEngine.getBalance(VLP_PRODUCT_ID, txn.sender).amount >= 0, diff --git a/core/package.json b/core/package.json index 374d640..8326bb1 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,6 @@ { "name": "vertex-core", - "version": "3.1.0", + "version": "3.2.0", "license": "UNLICENSED", "description": "EVM implementation of Vertex", "scripts": { diff --git a/lba/package.json b/lba/package.json index 04868fa..884c5af 100644 --- a/lba/package.json +++ b/lba/package.json @@ -1,6 +1,6 @@ { "name": "vertex-lba", - "version": "3.1.0", + "version": "3.2.0", "license": "UNLICENSED", "description": "Vertex LBA contracts", "scripts": {