mattlockyer / composables-998

An implementation and documentation repo for developing the ERC-998 standard for Ethereum.
MIT License
103 stars 64 forks source link

Improved ERC998PossessERC20.sol #8

Closed mudgen closed 6 years ago

mudgen commented 6 years ago

Changes to ERC998PossessERC20.sol

  1. I implemented the function tokenFallback from ERC223 (https://github.com/ethereum/EIPs/issues/223) as a way to receive ERC20 tokens from transfers. This works in a similar way as onERC721Received. Also implemented the bytes _data version of transfer from ERC223 that works with tokenFallback.
  2. The getToken function was implemented as a way to support ERC20 tokens that do support ERC223. This is a two step process. The composable is first approved to transfer tokens and then getToken is called to get the tokens. This works the same ways as getChild.
  3. I fixed the tests with these changes and I uncommented some tests and fixed those too.
  4. I am not sure that using "token" in a plural way is a good idea. Maybe it should be "tokens" or some other name scheme.