-
Notifications
You must be signed in to change notification settings - Fork 9
transfer native token to sourceTokenAddress #4
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: cyl19970726 <[email protected]>
Signed-off-by: cyl19970726 <[email protected]>
Signed-off-by: cyl19970726 <[email protected]>
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.
Should BridgeDestination.withdraw() also handle the native token logic?
contracts/app/Bridge.sol
Outdated
} | ||
|
||
function buy(TransferKey memory tkey) public { | ||
function buy(TransferKey memory tkey) public payable{ |
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.
nit: payable{ => payable {
Further, please use npm run prettier:fix to auto-format the code. |
Signed-off-by: cyl19970726 <[email protected]>
Signed-off-by: cyl19970726 <[email protected]>
Signed-off-by: cyl19970726 <[email protected]>
) { | ||
return transferData.fee; | ||
} else { | ||
return transferData.fee * (currentTime - transferData.startTime); |
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.
return transferData.fee * (currentTime - transferData.startTime); | |
return transferData.fee * (currentTime - transferData.startTime) / transferData.feeRampup; |
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.
Not yet fixed?
|
||
if (tkey.transferData.tokenAddress == address(0)) { | ||
require(msg.value >= amount, "not enough msg.value"); | ||
payable(tkey.transferData.destination).transfer(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.
may need nonReentrant to avoid reentrancy attack?
modify BridgeDestination.getLPFee() Co-authored-by: Qi Zhou <[email protected]>
add nonReentrant to BridgeDestination.withdraw() and BridgeDestination.buy() Signed-off-by: cyl19970726 <[email protected]>
Signed-off-by: cyl19970726 [email protected]