Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flashmint hyeth #64

Merged
merged 48 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7f3e662
feat: add hyeth token
janndriessen Jun 3, 2024
30a6c60
feat: add empty flash mint hyeth quote provider
janndriessen Jun 3, 2024
5cc45f3
feat: add flash mint hyeth contract address
janndriessen Jun 3, 2024
6182b34
feat: return components swap data
janndriessen Jun 4, 2024
4025573
test: add test for redeeming
janndriessen Jun 4, 2024
bdad505
feat: get swap data for eth to input/output token
janndriessen Jun 4, 2024
d363c11
feat: add getting swap data for input token to eth
janndriessen Jun 4, 2024
0ecb3a7
feat: swap data eth to input token to eth is only relevant for mintin…
janndriessen Jun 4, 2024
62685db
feat: add flashmint hyeth abi
janndriessen Jun 4, 2024
6cd8078
feat: add rpc url and start implementing returning a quote amount
janndriessen Jun 4, 2024
41af543
test: update test for redemption quotes
janndriessen Jun 4, 2024
ea72148
feat: add new flash mint hyeth address
janndriessen Jun 6, 2024
c49cd8f
feat: add contract getter for flash mint hyeth
janndriessen Jun 6, 2024
58e1e25
feat: add flash mint hyeth builder
janndriessen Jun 6, 2024
63502e7
chore: remove comment
janndriessen Jun 6, 2024
d86ffc3
chore: remove log
janndriessen Jun 7, 2024
64945fd
ci: update workflow
janndriessen Jun 7, 2024
6cb683b
ci: update running hardhat nodes in background
janndriessen Jun 7, 2024
be08c42
ci: fix arbitrum tests
janndriessen Jun 7, 2024
651eefa
ci: update test flow
janndriessen Jun 7, 2024
acd0215
test: fix hyeth contract test
janndriessen Jun 7, 2024
63e4f51
ci: update flow removing duplicate run hardhat calls
janndriessen Jun 7, 2024
d7b1049
feat: add issuance for hyeth
janndriessen Jun 7, 2024
63d6471
feat: add getting required components and positions
janndriessen Jun 7, 2024
dad1b2b
feat: add component quotes for instadapp
janndriessen Jun 7, 2024
027b4c1
chore: remove logs
janndriessen Jun 7, 2024
29440db
feat: add across component quotes
janndriessen Jun 7, 2024
99744f0
feat: add pendle
janndriessen Jun 7, 2024
32f1ff8
feat: add flash mint hyeth quote provider
janndriessen Jun 7, 2024
6f0a01f
feat: add flash mint hyeth to flash mint quote provider
janndriessen Jun 7, 2024
98f941c
docs: update order for adding new token steps
janndriessen Jun 7, 2024
5f21a0d
refactor: update static component swap data
janndriessen Jun 7, 2024
3a40296
refactor: update swap data
janndriessen Jun 7, 2024
3ec2830
lint
janndriessen Jun 7, 2024
aeb5c09
fix: input output token amount
janndriessen Jun 7, 2024
21feb92
test: add hyeth integration tests
janndriessen Jun 7, 2024
2885f8c
ci: run only hyeth test for now
janndriessen Jun 7, 2024
497be93
chore: add slippage adjusted input/output token amount
janndriessen Jun 7, 2024
a52adac
refactor: use preview redeem
janndriessen Jun 8, 2024
3e547c9
test: add usdc redeem test
janndriessen Jun 8, 2024
5511579
refactor: remove rounding error for across redeem quotes
janndriessen Jun 8, 2024
2de7bd0
refactor: update pendle deposit quote
janndriessen Jun 8, 2024
433d140
refactor: clean up components swap data
janndriessen Jun 8, 2024
f88654e
refactor: add missing exports
janndriessen Jun 8, 2024
65aff29
refactor: adjust slippage
janndriessen Jun 8, 2024
9f1de17
build: update version
janndriessen Jun 8, 2024
58a5fe4
lint
janndriessen Jun 8, 2024
5f1a4ad
ci: readd tests
janndriessen Jun 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@ jobs:
- run: npm ci
- run: npm run lint
- run: npm run build --if-present
- run: npm run hardhat:arbitrum & npm run test:arbitrum
- run: npm run hardhat & npm run test:utils
- run: npm run hardhat & npm run test:builders
- run: npm run hardhat & npm run test:quote
- run: npm run hardhat & npm run test:btc2x
- run: npm run hardhat & npm run test:cdeti
- run: npm run hardhat & npm run test:dseth
- run: npm run hardhat & npm run test:eth2x
- run: npm run hardhat & npm run test:gtceth
- run: npm run hardhat & npm run test:iceth
# - run: npm run hardhat & npm run test:icreth
- run: npm run hardhat:arbitrum &
- run: npm run hardhat &
- name: Wait for hardhat nodes to start
run: sleep 10
- run: npm run test:utils
- run: npm run test:builders
- run: npm run test:quotes
- run: npm run test:hyeth
- run: npm run test:btc2x
- run: npm run test:cdeti
- run: npm run test:dseth
- run: npm run test:eth2x
- run: npm run test:gtceth
- run: npm run test:iceth
# - run: npm run test:icreth
janndriessen marked this conversation as resolved.
Show resolved Hide resolved
# run last - as it alters the block number
# skip as it can't be minted or redeemed with 0x
# - run: npm run hardhat & npm run test:eth2xfli
# - run: npm run test:eth2xfli
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ When adding new .env vars do not forget to update the [publish.yml](.github/work
0. add a test for determining the correct issuance module [here](./src/utils/issuanceModules.test.ts)
1. add a test for determining the correct contract [here](./src/utils/contracts.test.ts)
2. if there is a new FlashMint contract, add it as described [below](#adding-a-new-contract)
3. additionally, add a test in [tests](./src/tests/)
4. add symbol to `function getContractType(token: string)` in [src/quote/provider/utils.ts](./src/quote//provider/utils.ts) and add a test
3. add symbol to `function getContractType(token: string)` in [src/quote/provider/utils.ts](./src/quote//provider/utils.ts) and add a test
4. additionally, add a test in [tests](./src/tests/)

### Adding a new contract

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indexcoop/flash-mint-sdk",
"version": "3.0.0",
"version": "3.1.0",
"description": "The FlashMintSDK of the Index Coop.",
"engines": {
"node": ">=18"
Expand All @@ -26,16 +26,16 @@
"lint": "prettier -c . && eslint ./src",
"lint:fix": "prettier -w . && eslint ./src --fix",
"test": "jest",
"test:arbitrum": "npm test src/flashmint/builders/leveraged-extended.test.ts src/quote/leveraged-extended",
"test:builders": "npm test src/flashmint/builders/leveraged.test.ts src/flashmint/builders/zeroex.test.ts",
"test:quote": "npm test src/quote/flashmint/leveraged/provider.test.ts src/quote/flashmint/zeroex src/quote/provider/ ",
"test:builders": "npm test src/flashmint/",
"test:quotes": "npm test src/quote/",
janndriessen marked this conversation as resolved.
Show resolved Hide resolved
"test:utils": "npm test src/utils",
"test:btc2x": "npm test src/tests/btc2x.test.ts",
"test:cdeti": "npm test src/tests/cdeti",
"test:dseth": "npm test src/tests/dseth",
"test:eth2x": "npm test src/tests/eth2x.test.ts",
"test:eth2xfli": "npm test src/tests/eth2xfli",
"test:gtceth": "npm test src/tests/gtceth",
"test:hyeth": "npm test src/tests/hyeth.test.ts",
"test:iceth": "npm test src/tests/iceth",
"test:icreth": "npm test src/tests/icreth",
"test:watch": "jest --watch"
Expand Down
1 change: 1 addition & 0 deletions src/constants/abis/DebtIssuanceModuleV2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"FeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_newIssueFee","type":"uint256"}],"name":"IssueFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_newRedeemFee","type":"uint256"}],"name":"RedeemFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_issuer","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"address","name":"_hookContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_managerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"SetTokenIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"indexed":true,"internalType":"address","name":"_redeemer","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_managerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"SetTokenRedeemed","type":"event"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"bool","name":"_isIssue","type":"bool"}],"name":"calculateTotalFees","outputs":[{"internalType":"uint256","name":"totalQuantity","type":"uint256"},{"internalType":"uint256","name":"managerFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"getModuleIssuanceHooks","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"getRequiredComponentIssuanceUnits","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"getRequiredComponentRedemptionUnits","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"_managerIssueFee","type":"uint256"},{"internalType":"uint256","name":"_managerRedeemFee","type":"uint256"},{"internalType":"address","name":"_feeRecipient","type":"address"},{"internalType":"contract IManagerIssuanceHook","name":"_managerIssuanceHook","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_hook","type":"address"}],"name":"isModuleIssuanceHook","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"name":"issuanceSettings","outputs":[{"internalType":"uint256","name":"maxManagerFee","type":"uint256"},{"internalType":"uint256","name":"managerIssueFee","type":"uint256"},{"internalType":"uint256","name":"managerRedeemFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"contract IManagerIssuanceHook","name":"managerIssuanceHook","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"issue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"registerToIssuanceModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"}],"name":"unregisterFromIssuanceModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"updateFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_newIssueFee","type":"uint256"}],"name":"updateIssueFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"uint256","name":"_newRedeemFee","type":"uint256"}],"name":"updateRedeemFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Loading