-
Notifications
You must be signed in to change notification settings - Fork 67
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: Eddy Finance #46
base: main
Are you sure you want to change the base?
Conversation
const data = getDataForCrossChain(BTC_ZRC20, encodedBitcoinWalletAddress); | ||
return data; | ||
}; | ||
|
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.
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.
Thanks for sharing . Will update the logic
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.
if (!chainId) return toResult(`Unsupported chain name: ${chainName}`, true); | ||
if (!supportedChains.includes(chainId)) return toResult(`Eddy Finance is not supported on ${chainName}`, true); | ||
|
||
// Validate amount |
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.
Do you consider add checks for enough balance on account of native currency Because if not, then we will have attempt of transaction execution and revert due insufficient balance in viem staticcall and possible not really clear error.
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.
Sure, I'll add them.
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.
|
||
export default { | ||
tools, | ||
functions, |
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.
here main protocol description for AI. Add slightly more info.
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.
Sure
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.
description: 'Account address that will execute the example', | ||
}, | ||
{ | ||
name: 'destToken', |
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.
Do you consider create resolve function for get proper zrc20 from chainName for example or users must know zrc20 addresses?
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.
Yes, I will create a resolver function that maps tokenSymbol to zrc20 address .
The flow will be something like this -
User prompts - Bridge 0.1 ETH from Base to USDC on Etherem
// @notice : The resolver function here will convert usdc address on ethereum to zrc20 address
resolverFunction(USDC) => return usdc_zrc20
], | ||
}, | ||
{ | ||
name: 'bridgeToBitcoin', |
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.
Do you consider create get function for check how much btc I can get for 1 ETH for example?
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.
Yes, for sure. Will add a getter function that shows the estimated amount of BTC that user will receive after bridging
Pull Requests are only allowed to modify files in the
/projects
directory.Any changes outside of this directory will be rejected automatically.
Files Changed