makerdao / dss-deploy

Set of smart contracts and bash scripts to deploy Multi collateral DAI
GNU Affero General Public License v3.0
68 stars 39 forks source link

Integrate dach #11

Closed MrChico closed 5 years ago

MrChico commented 5 years ago

I would like to modify the Dai ds-token that is currently included in this project to be able to support token transfers by signed messages. If we are upgrading the dai token contract anyway, this is an excellent opportunity to add this functionality which allows people to transact dai without needing ether to pay for gas. A sketch implementation is here https://github.com/MrChico/tokens/blob/master/src/dach.sol

michaelelliot commented 5 years ago

I would love to see this feature in the Dai token.

michaelelliot commented 5 years ago

@MrChico Would a deadline param be a useful feature so that signatures can expire?

gbalabasquer commented 5 years ago

I think @rainbreak is preparing a simpler erc20 contract for DAI. I'm on favor to add the offchain transfers to it.

rainbreak commented 5 years ago

Don't users just need to approve the dach contract to enable this? Or are you suggesting that it should be enabled by default?

gbalabasquer commented 5 years ago

I think he is meaning to add the offchain transfers directly to dai erc20 the token

MrChico commented 5 years ago

Yes, I'm suggesting to enable it by default, granting it authorized access to transferFrom, or something equivalent. In ERC777 terminology, dach would be a defaultOperator.

And yes, a timeout is an interesting thing to consider. Another way to invalidate an old cheque is to "overwrite" it by having another submitted with the same nonce.