-
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.
feat: Add Armada data types and Armada Manager (#470)
- Added `armada-protocol-common` and `armada-protocol-service` packages with all Armada common data types and the Armada manager - Added `ArmadaManagerClient` and SDK server handlers to provide client/server communication - Update the Armada webapp to use the new data types and functions - Moved submodule name from `earn-protocol` to `armada-protocol` - Promoted `armada-protocol/abis` to full package `armada-protocol-abis` so we can use it in `contracts-provider-service` - Updated all ABIs and generated TS files for them - Consolidated packages exports (some were wrong due to weird merge from `dev` - Updated Turbo SDK service template to not do the main exports
- Loading branch information
Showing
658 changed files
with
2,115 additions
and
552 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "earn-protocol/contracts"] | ||
path = earn-protocol/contracts | ||
[submodule "armada-protocol/contracts"] | ||
path = armada-protocol/contracts | ||
url = git@github.com:OasisDEX/summer-earn-protocol.git |
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
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
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
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 |
---|---|---|
@@ -1,32 +1,24 @@ | ||
import { type Token, TokenAmount } from '@summerfi/sdk-common' | ||
|
||
import { useSDK } from '@/hooks/use-sdk' | ||
|
||
export const useDeposit = () => { | ||
const { getFleetClient, getUserClient } = useSDK() | ||
const { getNewDepositTX } = useSDK() | ||
|
||
return async ({ | ||
return ({ | ||
chainId, | ||
walletAddress, | ||
fleetAddress, | ||
amountString, | ||
token, | ||
}: { | ||
chainId: number | ||
walletAddress: string | ||
fleetAddress: string | ||
amountString: string | ||
token: Token | ||
}) => { | ||
const fleet = await getFleetClient({ chainId, fleetAddress }) | ||
const user = await getUserClient({ chainId, walletAddress }) | ||
|
||
return fleet.deposit({ | ||
user, | ||
amount: TokenAmount.createFrom({ | ||
amount: amountString, | ||
token, | ||
}), | ||
return getNewDepositTX({ | ||
chainId, | ||
fleetAddress, | ||
walletAddress, | ||
amount: amountString, | ||
}) | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,32 +1,24 @@ | ||
import { type Token, TokenAmount } from '@summerfi/sdk-common' | ||
|
||
import { useSDK } from '@/hooks/use-sdk' | ||
|
||
export const useWithdraw = () => { | ||
const { getFleetClient, getUserClient } = useSDK() | ||
const { getWithdrawTX } = useSDK() | ||
|
||
return async ({ | ||
return ({ | ||
chainId, | ||
walletAddress, | ||
fleetAddress, | ||
amountString, | ||
token, | ||
}: { | ||
chainId: number | ||
walletAddress: string | ||
fleetAddress: string | ||
amountString: string | ||
token: Token | ||
}) => { | ||
const fleet = await getFleetClient({ chainId, fleetAddress }) | ||
const user = await getUserClient({ chainId, walletAddress }) | ||
|
||
return fleet.withdraw({ | ||
user, | ||
amount: TokenAmount.createFrom({ | ||
amount: amountString, | ||
token, | ||
}), | ||
return getWithdrawTX({ | ||
chainId, | ||
fleetAddress, | ||
walletAddress, | ||
amount: amountString, | ||
}) | ||
} | ||
} |
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
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,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
ignorePatterns: ['jest.config.js'], | ||
extends: ['@summerfi/eslint-config/library.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
} |
File renamed without changes.
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,30 @@ | ||
{ | ||
"name": "@summerfi/armada-protocol-abis", | ||
"version": "0.0.1", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./src/index.js", | ||
"types": "./src/index.d.ts" | ||
}, | ||
"./*": { | ||
"import": "./dist/*/index.js", | ||
"types": "./dist/*/index.d.ts" | ||
} | ||
}, | ||
"scripts": { | ||
"tsc": "tsc", | ||
"watch": "tsc -w", | ||
"e2e": "jest e2e/", | ||
"testw": "jest --watch", | ||
"build": "tsc -b tsconfig.build.json", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"genindex": "rm -f src/index.ts && for dir in ./src/*; do cti create ./$dir -b -w > /dev/null; done && cti ./src -b -w -e '.t.sol' -e 'build-info' -e 'MockERC721.sol'" | ||
}, | ||
"devDependencies": { | ||
"@summerfi/eslint-config": "workspace:*", | ||
"@summerfi/typescript-config": "workspace:*" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
armada-protocol/abis/src/AaveV3Ark.fork.t.sol/AaveV3ArkTestFork.abi.ts
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 AaveV3ArkTestForkAbi = [{"type":"function","name":"IS_TEST","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"aaveAddressProvider","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"aaveV3DataProvider","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"aaveV3Pool","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IPoolV3"}],"stateMutability":"view"},{"type":"function","name":"aaveV3PoolAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"ark","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract AaveV3Ark"}],"stateMutability":"view"},{"type":"function","name":"commander","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"dai","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IERC20"}],"stateMutability":"view"},{"type":"function","name":"excludeArtifacts","inputs":[],"outputs":[{"name":"excludedArtifacts_","type":"string[]","internalType":"string[]"}],"stateMutability":"view"},{"type":"function","name":"excludeContracts","inputs":[],"outputs":[{"name":"excludedContracts_","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"excludeSelectors","inputs":[],"outputs":[{"name":"excludedSelectors_","type":"tuple[]","internalType":"struct StdInvariant.FuzzSelector[]","components":[{"name":"addr","type":"address","internalType":"address"},{"name":"selectors","type":"bytes4[]","internalType":"bytes4[]"}]}],"stateMutability":"view"},{"type":"function","name":"excludeSenders","inputs":[],"outputs":[{"name":"excludedSenders_","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"failed","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"governor","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"nextArk","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract AaveV3Ark"}],"stateMutability":"view"},{"type":"function","name":"raft","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"rewardsController","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"setUp","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"targetArtifactSelectors","inputs":[],"outputs":[{"name":"targetedArtifactSelectors_","type":"tuple[]","internalType":"struct StdInvariant.FuzzArtifactSelector[]","components":[{"name":"artifact","type":"string","internalType":"string"},{"name":"selectors","type":"bytes4[]","internalType":"bytes4[]"}]}],"stateMutability":"view"},{"type":"function","name":"targetArtifacts","inputs":[],"outputs":[{"name":"targetedArtifacts_","type":"string[]","internalType":"string[]"}],"stateMutability":"view"},{"type":"function","name":"targetContracts","inputs":[],"outputs":[{"name":"targetedContracts_","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"targetInterfaces","inputs":[],"outputs":[{"name":"targetedInterfaces_","type":"tuple[]","internalType":"struct StdInvariant.FuzzInterface[]","components":[{"name":"addr","type":"address","internalType":"address"},{"name":"artifacts","type":"string[]","internalType":"string[]"}]}],"stateMutability":"view"},{"type":"function","name":"targetSelectors","inputs":[],"outputs":[{"name":"targetedSelectors_","type":"tuple[]","internalType":"struct StdInvariant.FuzzSelector[]","components":[{"name":"addr","type":"address","internalType":"address"},{"name":"selectors","type":"bytes4[]","internalType":"bytes4[]"}]}],"stateMutability":"view"},{"type":"function","name":"targetSenders","inputs":[],"outputs":[{"name":"targetedSenders_","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"test_Board_AaveV3_fork","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"tipJar","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"event","name":"ArkPoked","inputs":[{"name":"currentPrice","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"ArkPokedNoChange","inputs":[],"anonymous":false},{"type":"event","name":"ArkPokedTooSoon","inputs":[],"anonymous":false},{"type":"event","name":"Boarded","inputs":[{"name":"commander","type":"address","indexed":true,"internalType":"address"},{"name":"token","type":"address","indexed":false,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"DepositCapUpdated","inputs":[{"name":"newCap","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Disembarked","inputs":[{"name":"commander","type":"address","indexed":true,"internalType":"address"},{"name":"token","type":"address","indexed":false,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Harvested","inputs":[{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"MaxAllocationUpdated","inputs":[{"name":"newMaxAllocation","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Moved","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"token","type":"address","indexed":false,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"RaftUpdated","inputs":[{"name":"newRaft","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"SlotFound","inputs":[{"name":"who","type":"address","indexed":false,"internalType":"address"},{"name":"fsig","type":"bytes4","indexed":false,"internalType":"bytes4"},{"name":"keysHash","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"slot","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"WARNING_UninitedSlot","inputs":[{"name":"who","type":"address","indexed":false,"internalType":"address"},{"name":"slot","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"log","inputs":[{"name":"","type":"string","indexed":false,"internalType":"string"}],"anonymous":false},{"type":"event","name":"log_address","inputs":[{"name":"","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"log_array","inputs":[{"name":"val","type":"uint256[]","indexed":false,"internalType":"uint256[]"}],"anonymous":false},{"type":"event","name":"log_array","inputs":[{"name":"val","type":"int256[]","indexed":false,"internalType":"int256[]"}],"anonymous":false},{"type":"event","name":"log_array","inputs":[{"name":"val","type":"address[]","indexed":false,"internalType":"address[]"}],"anonymous":false},{"type":"event","name":"log_bytes","inputs":[{"name":"","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false},{"type":"event","name":"log_bytes32","inputs":[{"name":"","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"log_int","inputs":[{"name":"","type":"int256","indexed":false,"internalType":"int256"}],"anonymous":false},{"type":"event","name":"log_named_address","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"log_named_array","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"uint256[]","indexed":false,"internalType":"uint256[]"}],"anonymous":false},{"type":"event","name":"log_named_array","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"int256[]","indexed":false,"internalType":"int256[]"}],"anonymous":false},{"type":"event","name":"log_named_array","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"address[]","indexed":false,"internalType":"address[]"}],"anonymous":false},{"type":"event","name":"log_named_bytes","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false},{"type":"event","name":"log_named_bytes32","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"log_named_decimal_int","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"int256","indexed":false,"internalType":"int256"},{"name":"decimals","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"log_named_decimal_uint","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"decimals","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"log_named_int","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"int256","indexed":false,"internalType":"int256"}],"anonymous":false},{"type":"event","name":"log_named_string","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"string","indexed":false,"internalType":"string"}],"anonymous":false},{"type":"event","name":"log_named_uint","inputs":[{"name":"key","type":"string","indexed":false,"internalType":"string"},{"name":"val","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"log_string","inputs":[{"name":"","type":"string","indexed":false,"internalType":"string"}],"anonymous":false},{"type":"event","name":"log_uint","inputs":[{"name":"","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"logs","inputs":[{"name":"","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false}] as const |
1 change: 1 addition & 0 deletions
1
armada-protocol/abis/src/AaveV3Ark.fork.t.sol/AaveV3ArkTestFork.json
Large diffs are not rendered by default.
Oops, something went wrong.
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 * from './AaveV3ArkTestFork.abi'; |
Oops, something went wrong.