makerdao / sdai

A tokenized wrapper around the DSR.
GNU Affero General Public License v3.0
38 stars 26 forks source link

feat: add missing transfer event #6

Closed banteg closed 1 year ago

banteg commented 1 year ago

this fixes balanceOf updates by mint/deposit/burn/withdraw not being picked up by explorers and wallets.

emitting Transfer from/to zero address is both a recommended part of eip-20 and a widely accepted convention.

A token contract which creates new tokens SHOULD trigger a Transfer event with the _from address set to 0x0 when tokens are created.

hexonaut commented 1 year ago

As discussed in DM, the Transfer mint/burn event was originally left out because it's completely redundant with Deposit / Withdraw events and is only used for integration which makes it a waste of gas in the long run. That being said, the amount of a heavy lift this is to get integrations to update is making me reconsider this decision for the NST version. We should probably include this change when the new token is released and sDAI is retired.

hexonaut commented 1 year ago

Actually there needs to be tests add too, so I've closed this in favour of: https://github.com/makerdao/sdai/pull/7