casper-ecosystem / cep18

Implementation of ERC20 token for the CasperLabs platform.
https://casper.network/docs/dapp-dev-guide
Apache License 2.0
26 stars 47 forks source link

Emit event on install #111

Closed Levike34 closed 5 months ago

Levike34 commented 6 months ago

Emit a Transfer event on install_contract() to register token's existence. It would be best if some event was emitted on install.

davidatwhiletrue commented 6 months ago

@Levike34 Maybe it should be a Mint event?

Levike34 commented 6 months ago

@Levike34 Maybe it should be a Mint event?

@davidatwhiletrue That does make more sense. For more context, I created this PR to address this issue: After deploying a new CEP18 contract, tokens do not appear in Casper Wallet until some event is emitted. Transfer works for sure, but I will have to check if Mint works as well. Tokens only seem to appear if events_mode is enabled and after a Transfer event. This commit I put allows tokens to be seen in one's wallet after calling install_contract

davidatwhiletrue commented 5 months ago

@Levike34 thanks for the context information. I just tried and, yes, emitting a Mint event during contract installation also makes the initial supply visible in the contract owner account.

Levike34 commented 5 months ago

@davidatwhiletrue updated to Mint event

deuszex commented 5 months ago

Technically it is a Mint event.