-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bounce for withdraw、borrow 、repay #32
base: main
Are you sure you want to change the base?
Conversation
let queryId: Int = self.queryId; | ||
let tokenTransferMsg: TokenTransfer = TokenTransfer{ | ||
queryId: queryId, | ||
amount: amount, | ||
destination: toAddress, | ||
response_destination: myAddress(), // Pool need to receive TokenExcesses message | ||
custom_payload: null, | ||
forward_ton_amount: 0, | ||
forward_payload: emptySlice() | ||
}; | ||
// store TokenTransferBounce | ||
let bounceMsg: TokenTransferBounce = TokenTransferBounce{ | ||
to: poolWalletAddress, | ||
user: toAddress, | ||
msg: tokenTransferMsg | ||
}; | ||
self.tokenTransferMsg.set(queryId, bounceMsg); | ||
self.queryId += 1; |
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.
如果下面的 gas value: ton("0.05") 设置的足够的话,这里可能就不需要做 Bounce处理
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.
以及做好数值的 validation
message MintBounce { | ||
to: Address; | ||
user: Address; | ||
msg: Mint; | ||
} |
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.
把 Bounce 类的 msg 结构固定了,to: to 地址,user:这个 message 对应的用户,msg: 原生message。
如何拿到 user对应的 bounce message,可能需要有个线下服务去定时扫一下 queryId 对应的 bounce message 内容。
@@ -93,7 +95,7 @@ contract Pool with Deployable, Ownable, Resumable, PoolView { | |||
let reserveAddress: Address = msg.tokenAddress; | |||
let reserveConfiguration: ReserveConfiguration? = self.reservesConfiguration.get(reserveAddress); | |||
require(reserveConfiguration != null, "Reserve not found"); | |||
|
|||
// GetUserAccountData don't need do bounce |
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.
// GetUserAccountData don't need do bounce | |
// GetUserAccountData don't need to handle bounce | |
or // GetUserAccountData won't bounce |
暂时不合,留着当后续参考 |
No description provided.