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 alternative receiver for transfer in native to erc20 mode #302

Merged
merged 10 commits into from
Oct 23, 2019

Conversation

patitonar
Copy link
Contributor

Closes #297

@patitonar patitonar self-assigned this Oct 8, 2019
Copy link
Collaborator

@akolotov akolotov left a 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) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. I will do.

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.

None yet

2 participants