-
Notifications
You must be signed in to change notification settings - Fork 10
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 deposit service #136
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
destinationChain: string; | ||
destinationAddress: string; | ||
environment: Environment; | ||
asset?: string; // if not specified, it is the native asset |
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.
how about string | 'native';
?
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.
this doesn't work since "native" is overridden by string
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.
how about we make asset
to be required, not optional, but remove getNativeWrapDepositAddress
from the getDepositAddress
function?
So if people want to send native token, they have to use getNativeWrapDepositAddress
instead.
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.
nah we want to have this be built in to the same function, don't have any other ideas tho
Description
This PR added support for wrap/unwrap deposit address generation.
Changes
getNativeWrapDepositAddress
APIgetNativeUnwrapDepositAddress
APIgetDepositAddress
togetLinkedDepositAddress
getDepositAddress
API. This function will return the deposit address based on three scenarios:getNativeWrapDepositAddress
function.asset
on the destination chain hasisERC20WrappedNativeGasToken = true
, then this function will return the linked deposit address where the destination address for linked deposit address is unwrap deposit address. (there're two addresses generation)isERC20WrappedNativeGasToken
is falsy, then the function simply returns the linked deposit addressTodo
Validate the wrap/unwrap addresses offline to prevent man in the middle attackSkipTest Results
1. Native Wrap Address
Sending AVAX from Avalanche to Fantom should receive WAVAX at the destination chain
Parameters
Returned Address
0xcd780367774c6ff9d781f41b09a095c450ecda58
Test Result
Passed ✅
Avalanche Tx
Axelarscan Tx
Fantom Tx
2. Unwrap Address
Sending WFTM from Avalanche to Fantom should receive FTM at the destination chain
Parameters
Returned Address
0x7C74188B53193E2513C707F26d1Ecf6d0d2765B4
Test Results
Passed ✅
Avalanche Tx
Axelarscan Tx not found
Fantom Tx
3. Simple Linked Address
Sending aUSDC from Avalanche to Fantom should receive aUSDC at the destination chain
Parameters
Returned Address
0xE12F77E36745Ad1019fbd19d09f2491047f9Ee73
Test Result
Passed ✅
Avalanche Tx
Axelarscan Tx not found
Fantom Tx