-
Notifications
You must be signed in to change notification settings - Fork 48
Yo yielder integration #1008
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
Open
gemdev111
wants to merge
23
commits into
main
Choose a base branch
from
yo-yielder-intergration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Yo yielder integration #1008
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
724c735
Add yielder crate with Yo earn provider
gemdev111 72f68aa
Integrate yielder into gateway for earn operations
gemdev111 f5aeaee
Refactor Yo client and provider
gemdev111 48a0144
Add unit tests for conversion and slippage
gemdev111 8b643f5
Rename yielder/yo methods for clarity
gemdev111 dd4da0a
Update YoAsset to checksum
gemdev111 d2bc619
Extracted mapping logic to mapper
gemdev111 1d3a7d9
Removed PROVIDER const, improved visability for GAS_LIMIT
gemdev111 f775106
update naming consistence
gemdev111 1cd5ef0
Simplify errors
gemdev111 bfd40ac
Yo client: add ERC-4626 interface, typed eth_call, and multicall3 bat…
gemdev111 de4c4e7
Refactor: move slippage to gem_evm, rename yielder methods for consis…
gemdev111 017f142
Refactor yielder crate architecture
gemdev111 d6b7f1c
Extract shared alien types and client factories to gem_jsonrpc and ge…
gemdev111 1b77b40
Migrate swapper to shared alien types from gem_jsonrpc
gemdev111 9560678
Refactor yielder crate architecture
gemdev111 128f77d
Added name to earn provider
gemdev111 dfc3197
Pass token IDs to earn balance fetch to skip unnecessary RPC calls
gemdev111 5341ab4
Refactor yielder crate for clarity and testability
gemdev111 e697c6d
Refactor EVM client factory: remove Option, add yielder client_factory
gemdev111 37d30ef
Improve Yielder and AlienProviderWrapper design
gemdev111 4c5eec2
Removed dead code
gemdev111 a3662e3
Improve naming
gemdev111 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,9 @@ | ||
| use alloy_sol_types::sol; | ||
|
|
||
| sol! { | ||
| interface IERC4626 { | ||
| function balanceOf(address account) external view returns (uint256); | ||
| function totalAssets() external view returns (uint256); | ||
| function totalSupply() external view returns (uint256); | ||
| } | ||
| } |
This file contains hidden or 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,7 +1,9 @@ | ||
| pub mod erc1155; | ||
| pub mod erc20; | ||
| pub mod erc721; | ||
| pub mod erc1155; | ||
| pub mod erc4626; | ||
|
|
||
| pub use erc20::IERC20; | ||
| pub use erc721::IERC721; | ||
| pub use erc1155::IERC1155; | ||
| pub use erc4626::IERC4626; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 +1,6 @@ | ||
| pub mod error; | ||
| pub mod mock; | ||
| #[cfg(feature = "reqwest_provider")] | ||
| pub mod reqwest_provider; | ||
|
|
||
| pub use error::AlienError; | ||
| pub use gem_jsonrpc::{HttpMethod, RpcClient as GenericRpcClient, RpcProvider as GenericRpcProvider, Target}; | ||
|
|
||
| pub type RpcClient = GenericRpcClient<AlienError>; | ||
|
|
||
| pub trait RpcProvider: GenericRpcProvider<Error = AlienError> {} | ||
|
|
||
| impl<T> RpcProvider for T where T: GenericRpcProvider<Error = AlienError> {} | ||
| pub use gem_jsonrpc::alien::{AlienError, RpcClient, RpcProvider}; | ||
| pub use gem_jsonrpc::{HttpMethod, Target}; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| [package] | ||
| name = "yielder" | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| license.workspace = true | ||
|
|
||
| [features] | ||
| default = [] | ||
| yield_integration_tests = [ | ||
| "gem_jsonrpc/reqwest", | ||
| "gem_client/reqwest", | ||
| "tokio/rt-multi-thread", | ||
| ] | ||
|
|
||
| [dependencies] | ||
| alloy-primitives = { workspace = true } | ||
| alloy-sol-types = { workspace = true } | ||
| num-bigint = { workspace = true } | ||
| gem_client = { path = "../gem_client" } | ||
| gem_evm = { path = "../gem_evm", features = ["rpc"] } | ||
| gem_jsonrpc = { path = "../gem_jsonrpc" } | ||
| primitives = { path = "../primitives" } | ||
| async-trait = { workspace = true } | ||
| futures = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| gem_client = { path = "../gem_client", features = ["reqwest"] } | ||
| gem_jsonrpc = { path = "../gem_jsonrpc", features = ["reqwest"] } | ||
| reqwest = { workspace = true } | ||
| tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } |
This file contains hidden or 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,17 @@ | ||
| use gem_evm::rpc::EthereumClient; | ||
| use gem_jsonrpc::alien::{self, RpcClient, RpcProvider}; | ||
| use gem_jsonrpc::client::JsonRpcClient; | ||
| use primitives::{Chain, EVMChain}; | ||
| use std::sync::Arc; | ||
|
|
||
| use crate::YielderError; | ||
|
|
||
| pub fn create_client(provider: Arc<dyn RpcProvider>, chain: Chain) -> Result<JsonRpcClient<RpcClient>, YielderError> { | ||
| alien::create_client(provider, chain).map_err(|_| YielderError::NotSupportedChain) | ||
| } | ||
|
|
||
| pub fn create_eth_client(provider: Arc<dyn RpcProvider>, chain: Chain) -> Result<EthereumClient<RpcClient>, YielderError> { | ||
| let evm_chain = EVMChain::from_chain(chain).ok_or(YielderError::NotSupportedChain)?; | ||
| let client = create_client(provider, chain)?; | ||
| Ok(EthereumClient::new(client, evm_chain)) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.