Sovereign-Labs / sovereign-sdk

A framework for building seamlessly scalable and interoperable rollups that can run on any blockchain
https://sovereign.xyz
Apache License 2.0
375 stars 106 forks source link

Return token address from `create_token`. Emit `token_created` event. #189

Open preston-evans98 opened 1 year ago

preston-evans98 commented 1 year ago

Currently the bank module's create_token returns an empty list of events. We should emit an event indicating which token was created, and return the address to the caller.

cc @bkolad

bkolad commented 1 year ago

For sure we can add the event. Here is also another way of getting the the address for tests: We can use the create_token_address::<C>(&token_name, sender_address.as_ref(), salt) method directly in tests and calculate the deployed address. Example: https://github.com/Sovereign-Labs/sovereign/blob/research/sov-modules/sov-modules-impl/bank/src/tests.rs#L141

citizen-stig commented 1 year ago

@bkolad @preston-evans98 can you confirm, if current state of affairs require that?