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

introduce Hub as receivers #287

Merged
merged 4 commits into from
Jan 20, 2025
Merged

introduce Hub as receivers #287

merged 4 commits into from
Jan 20, 2025

Conversation

CoderZhi
Copy link
Collaborator

if deposit fee of cashier is not 0
if the token amount to transfer is insufficient to pay the deposit fee, transfer token to sender and return
else swap in uniswap and call the cashier with the remaining token
payload is a combination of recipient + second layer payload

@CoderZhi CoderZhi requested a review from Liuhaai January 16, 2025 03:39
}
require(_token.approve(address(r), _amount), "EthereumHub: approve router failed");
amounts = r.swapTokensForExactETH(fee, _amount, path, address(this), block.timestamp + 10);
_amount = _amount - amounts[0];
Copy link
Collaborator

@Liuhaai Liuhaai Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

require(_amount>=amounts[0], "");
_amount = _amount - amounts[0];

@CoderZhi CoderZhi merged commit 3ba4d25 into master Jan 20, 2025
1 of 2 checks passed
@CoderZhi CoderZhi deleted the hub branch January 20, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants