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

add sourceTokenAddress #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add sourceTokenAddress #3

wants to merge 1 commit into from

Conversation

qizhou
Copy link
Contributor

@qizhou qizhou commented Dec 23, 2021

The motivation is to allow token mapping from source to destination by user (in general the tokens on the source and target chains are different).

@qizhou qizhou requested a review from zhiqiangxu December 23, 2021 07:47
BridgeLib.TransferData memory transferData,
bytes32[] memory proof
) public {
// safemath not needed for solidity 8
uint256 amountPlusFee = (transferData.amount *
(10000 + CONTRACT_FEE_BASIS_POINTS)) / 10000;
IERC20(transferData.tokenAddress).safeTransferFrom(
IERC20(sourceTokenAddress).safeTransferFrom(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think evil things can happen if designed like this...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems the token mapping has to be centralized, can't be decentralized..

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.

3 participants