-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 01d759f
Showing
36 changed files
with
7,596 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
env: | ||
HUSKY: 0 | ||
CI: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: git config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: "yarn" | ||
node-version-file: ".nvmrc" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn install --frozen-lockfile | ||
- name: Semantic Release | ||
id: semantic | ||
uses: cycjimmy/semantic-release-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
node_modules | ||
**/node_modules | ||
.turbo | ||
.cache | ||
.history | ||
.idea | ||
.npmrc | ||
|
||
abi | ||
artifacts | ||
build | ||
cache | ||
dist | ||
forge-out | ||
sandbox | ||
coverage* | ||
|
||
.env | ||
.env.local | ||
|
||
.eslint.local.json | ||
.eslintcache | ||
|
||
out.json | ||
out.html | ||
tree.json | ||
|
||
.verifier* | ||
|
||
.DS_Store | ||
*.log | ||
|
||
|
||
.nx/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"branches": [ | ||
{ | ||
"name": "main" | ||
}, | ||
{ | ||
"name": "next", | ||
"channel": "next", | ||
"prerelease": "next" | ||
} | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": ["dist"] | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "yarn build ${nextRelease.version}" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"eslint.validate": ["javascript", "typescript"], | ||
"files.eol": "\n" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
Business Source License 1.1 | ||
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. | ||
"Business Source License" is a trademark of MariaDB Corporation Ab. | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
Parameters | ||
|
||
Licensor: GearBox Protocol Limited | ||
|
||
Licensed Work: Gearbox Contracts (Gearbox Protocol v1) | ||
The Licensed Work is (c) 2021 GearBox Holdings | ||
|
||
Additional Use Grant: Any production use of the Licensed Work is permitted if, | ||
and as long as, such use is expressly mentioned at | ||
gearbox.eth (the “List”). Once any specific use is added | ||
to the List, such production use shall be deemed permitted. | ||
Once any specific use is removed from the List (including | ||
if the List is updated to indicate that any specific such | ||
use is no longer allowed), such use shall no longer be | ||
permitted, and any license to make such production use | ||
shall be deemed immediately revoked. | ||
|
||
Change Date: December 15, 2022 | ||
|
||
Change License: GNU General Public License v2.0 or later | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
Terms | ||
|
||
The Licensor hereby grants you the right to copy, modify, create derivative works, | ||
redistribute, and make non-production use of the Licensed Work. The Licensor may | ||
make an Additional Use Grant, above, permitting limited production use. | ||
|
||
Effective on the Change Date, or the fourth anniversary of the first publicly | ||
available distribution of a specific version of the Licensed Work under this License, | ||
whichever comes first, the Licensor hereby grants you rights under the terms of the | ||
Change License, and the rights granted in the paragraph above terminate. | ||
|
||
If your use of the Licensed Work does not comply with the requirements currently in | ||
effect as described in this License, you must purchase a commercial license from the | ||
Licensor, its affiliated entities, or authorized resellers, or you must refrain from | ||
using the Licensed Work. | ||
|
||
All copies of the original and modified Licensed Work, and derivative works of the | ||
Licensed Work, are subject to this License. This License applies separately for each | ||
version of the Licensed Work and the Change Date may vary for each version of the | ||
Licensed Work released by Licensor. | ||
|
||
You must conspicuously display this License on each original or modified copy of the | ||
Licensed Work. If you receive the Licensed Work in original or modified form from a | ||
third party, the terms and conditions set forth in this License apply to your use of | ||
that work. | ||
|
||
Any use of the Licensed Work in violation of this License will automatically terminate | ||
your rights under this License for the current and all other versions of the Licensed | ||
Work. | ||
|
||
This License does not grant you any right in any trademark or logo of Licensor or its | ||
affiliates (provided that you may use a trademark or logo of Licensor as expressly | ||
required by this License). | ||
|
||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” | ||
BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, | ||
INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE, NON-INFRINGEMENT, AND TITLE. | ||
|
||
MariaDB hereby grants you permission to use this License’s text to license your works, | ||
and to refer to it using the trademark “Business Source License”, as long as you comply | ||
with the Covenants of Licensor below. | ||
|
||
|
||
----------------------------------------------------------------------------- | ||
|
||
Covenants of Licensor | ||
|
||
In consideration of the right to use this License’s text and the “Business Source License” | ||
name and trademark, Licensor covenants to MariaDB, and to all other recipients of the | ||
licensed work to be provided by Licensor: | ||
|
||
1. To specify as the Change License the GPL Version 2.0 or any later version, or a | ||
license that is compatible with GPL Version 2.0 or a later version, where “compatible” | ||
means that software provided under the Change License can be included in a program with | ||
software provided under GPL Version 2.0 or a later version. Licensor may specify | ||
additional Change Licenses without limitation. | ||
|
||
2. To either: (a) specify an additional grant of rights to use that does not impose | ||
any additional restriction on the right granted in this License, as the Additional | ||
Use Grant; or (b) insert the text “None”. | ||
|
||
3. To specify a Change Date. | ||
|
||
4. Not to modify this License in any other way. | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
Notice | ||
|
||
The Business Source License (this document, or the “License”) is not an Open Source license. | ||
However, the Licensed Work will eventually be made available under an Open Source License, | ||
as stated in this License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
![gearbox](header.png) | ||
|
||
## Gearbox protocol | ||
|
||
![npm](https://img.shields.io/npm/v/%40gearbox-protocol%2Fdeploy-tools) | ||
|
||
This repository contains the code for middleware between Gearbox V2 and third-party protocols. | ||
|
||
### What is Gearbox protocol? | ||
|
||
Gearbox is a generalized leverage protocol: it allows you to take leverage in one place and then use it across various | ||
DeFi protocols and platforms in a composable way. The protocol has two sides to it: passive liquidity providers who earn higher APY | ||
by providing liquidity; active traders, farmers, or even other protocols who can borrow those assets to trade or farm with x4+ leverage. | ||
|
||
Gearbox protocol is a Marketmake ETHGlobal hackathon finalist. | ||
|
||
## Bug bounty | ||
|
||
This repository is subject to the Gearbox bug bounty program, per the terms defined [here](). | ||
|
||
## Documentation | ||
|
||
General documentation of the Gearbox Protocol can be found [here](https://docs.gearbox.fi). Developer documentation with | ||
more tech-related infromation about the protocol, contract interfaces, integration guides and audits is available on the | ||
[Gearbox dev protal](https://dev.gearbox.fi). | ||
|
||
## Testing | ||
|
||
### Setup | ||
|
||
Running Forge tests requires Foundry. See [Foundry Book](https://book.getfoundry.sh/getting-started/installation) for installation details. | ||
|
||
### Unit tests | ||
|
||
`forge t` | ||
|
||
### Mainnet integration tests | ||
|
||
1. Start a Mainnet or Goerli fork with: `yarn fork` or `yarn fork-goerli`, respectively. | ||
2. Open a new terminal window and run `forge t --match-test _live_ --fork-url http://localhost:8545`. | ||
|
||
It is recommended to set `$ETH_MAINNET_BLOCK` or `$ETH_GOERLI_BLOCK` to run the tests on a fixed block. Mainnet tests can take significant time to run and can fail unexpectedly due to external provider errors. Re-running the tests on the same block (or without restarting the fork) will be sped up due to caching. | ||
|
||
## Licensing | ||
|
||
The primary license for Gearbox contracts is the Business Source License 1.1 (BUSL-1.1), see [LICENSE](https://github.com/Gearbox-protocol/gearbox-contracts/blob/master/LICENSE). The files licensed under the BUSL-1.1 have appropriate SPDX headers. | ||
|
||
### | ||
|
||
- The files in `contracts/adapters`, `contracts/interfaces` are licensed under GPL-2.0-or-later. | ||
- The files in `contracts/integrations` are either licensed under GPL-2.0-or-later or unlicensed (as indicated in their SPDX headers). | ||
- The files in `scripts`, `contracts/test`,`contracts/mocks` are unlicensed. | ||
|
||
## Disclaimer | ||
|
||
This application is provided "as is" and "with all faults." Me as developer makes no representations or | ||
warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical | ||
errors, or other harmful components of this software. There are inherent dangers in the use of any software, | ||
and you are solely responsible for determining whether this software product is compatible with your equipment and | ||
other software installed on your equipment. You are also solely responsible for the protection of your equipment | ||
and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, | ||
modifying, or distributing this software product. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "@gearbox-protocol/defillama", | ||
"version": "1.0.0", | ||
"description": "defillama scripts, but in ts and in one repo", | ||
"main": "index.js", | ||
"private": true, | ||
"keywords": [ | ||
"gearbox" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Gearbox-protocol/defillama" | ||
}, | ||
"license": "BUSL-1.1", | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"build": "node tsup.mjs", | ||
"prepare": "husky", | ||
"prettier": "prettier --write .", | ||
"prettier:ci": "npx prettier --check .", | ||
"lint": "eslint \"**/*.ts\" --fix", | ||
"lint:ci": "eslint \"**/*.ts\"", | ||
"typecheck:ci": "tsc --noEmit" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^18.4.4", | ||
"@commitlint/config-conventional": "^18.4.4", | ||
"@defillama/sdk": "^5.0.31", | ||
"@gearbox-protocol/eslint-config": "2.0.0-next.2", | ||
"@gearbox-protocol/prettier-config": "2.0.0-next.0", | ||
"@gearbox-protocol/sdk-gov": "^1.31.2", | ||
"@redstone-finance/protocol": "^0.3.6", | ||
"@redstone-finance/sdk": "^0.3.6", | ||
"@semantic-release/exec": "^6.0.3", | ||
"eslint": "^8.56.0", | ||
"ethers": "^6.0.0", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.0", | ||
"prettier": "^3.1.1", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.3.3" | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"extends": [ | ||
"@gearbox-protocol/eslint-config" | ||
] | ||
}, | ||
"prettier": "@gearbox-protocol/prettier-config", | ||
"lint-staged": { | ||
"*.{ts,tsx}": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
], | ||
"*.{json,md}": "prettier --write", | ||
"*.sol": "forge fmt" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const ADDRESS_PROVIDER_V3 = "0x9ea7b04da02a5373317d745c1571c84aad03321d"; |
Oops, something went wrong.