wyvernprotocol / wyvern-v3

Wyvern Protocol v3.1, Ethereum implementation
https://wyvernprotocol.com
MIT License
298 stars 121 forks source link

Transfer relayer fee for anyERC20ForERC1155 #76

Open ansoncsh opened 2 years ago

ansoncsh commented 2 years ago

Hi, I go through the tests in "7-static-market-matching.js" to exchange ERC1155 and ERC20 with anyERC1155ForERC20 and anyERC20ForERC1155

Wonder if it is possible to transfer ERC20 to 2 addresses, one for ERC1155 owner and another for a relayer, in second call

It would be appreciated if someone could help on it.

Thanks a lot.

smitea commented 2 years ago

The anyERC1155ForERC20 and anyERC20ForERC1155 just apply to one ERC1155 with one ERC20 exchange, so if you want to exchange many ERC20 for one ERC1155, you can use atomicize to wrap many ERC20 transactions as secondCall parameters in atomicMatchWith. or you can use anyAddOne for your scene.

ansoncsh commented 2 years ago

The anyERC1155ForERC20 and anyERC20ForERC1155 just apply to one ERC1155 with one ERC20 exchange, so if you want to exchange many ERC20 for one ERC1155, you can use atomicize to wrap many ERC20 transactions as secondCall parameters in atomicMatchWith. or you can use anyAddOne for your scene.

@smitea Thank you for suggestion.

We tried to use atomicize in counterorder but it cannot pass the validation because anyERC1155ForERC20 will check whether the 2nd call is transferFrom(address,address,uint256). atomicize multiple ERC20 transactions will make this validation fail.

We also tried to use any to any pair and it so called "works" ("works" means that I can transfer ERC1155 to one wallet and transfer ERC20 to multiple wallets). However, it does not have any order matching validation.

What we are trying to achieve:

Is it required to write a customized solidity for cases like it? Or does our purpose make no sense?

smitea commented 2 years ago

see that 56#.