-
Notifications
You must be signed in to change notification settings - Fork 226
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 alternative receiver for transfer in native to erc20 mode #302
Conversation
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.
Waiting for comments on the questions raised in #301
# Conflicts: # contracts/upgradeable_contracts/InitializableBridge.sol
# Conflicts: # contracts/upgradeable_contracts/ERC677BridgeForBurnableMintableToken.sol # contracts/upgradeable_contracts/amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol # contracts/upgradeable_contracts/amb_erc677_to_erc677/ForeignAMBErc677ToErc677.sol # contracts/upgradeable_contracts/amb_erc677_to_erc677/HomeAMBErc677ToErc677.sol
bytes /*_data*/ | ||
) internal { | ||
contract ERC677BridgeForBurnableMintableToken is ERC677Bridge, OtherSideBridgeStorage { | ||
function chooseReceiver(address _from, bytes _data) internal view returns (address recipient) { |
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.
seems that we have the same method in amb_erc677_to_erc677/BasicAMBErc677ToErc677.sol
. Does it make sense to have a separate module for it?
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.
Moved definition of the method fd80024
@@ -22,7 +22,8 @@ contract ForeignBridgeNativeToErc is | |||
uint256 _requiredBlockConfirmations, | |||
uint256[] _homeDailyLimitHomeMaxPerTxArray, // [ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] | |||
address _owner, | |||
uint256 _decimalShift | |||
uint256 _decimalShift, | |||
address _bridgeOnOtherSide |
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.
is my understanding correct and the scenario approve-then-relayTokens
is not supported in the bridge mode. Do you think it make sense to keep consistency and support it for all bridge modes where erc677 tokens are intended to be used? If yes, I will create a new issue.
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.
You are correct, approve-then-relayTokens
was only added for the modes where erc677
is not present in order to be able to specify an alternative receiver. I think that since erc677
can specify a different receiver using transferAndCall
method, relayTokens
is not needed for those cases because it will be a duplicated functionality and from user perspective requires two transactions instead of one so I think transferAndCall
will be always preferred
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.
right. but consider a following situation: a user knows that on the bridge A
he/she can transfer tokens by pairing approve
and relayTokens
. Next, the same user tries to transfer tokens through the bridge B
but fails. In both cases he/she considers the token contract as erc20 compatible. But in one case it works and does not work in another. I assumed this consistency when raised the comment initially. I understand that's it is not mandatory to have but asking your opinion whether we can suggest the user this level of usability in the future.
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.
Thanks for the explanation, in that case keeping consistency and allowing the users to interact in the same way with all the bridges is a nice usability feature, let's create a new issue for this.
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.
Ok. I will do.
Closes #297