@@ -86,11 +86,17 @@ impl<'ws, S: Spec> IbcTransferContext<'ws, S> {
86
86
} )
87
87
}
88
88
89
+ /// Creates a new token with the specified `token_name` and mints an initial
90
+ /// balance to the `minter_address`.
91
+ ///
92
+ /// Note: The mint authority must be held by the `IbcTransfer` module, so the
93
+ /// `authorized_minters` is set to the `IbcTransfer` address. Also, remember
94
+ /// that the `token_name` is a denom prefixed with IBC and originates from the
95
+ /// counterparty chain.
89
96
fn create_token (
90
97
& self ,
91
98
token_name : String ,
92
99
minter_address : S :: Address ,
93
- authorized_minters : Vec < S :: Address > ,
94
100
) -> Result < TokenId , TokenTransferError > {
95
101
// Using a different salt will result in a different token
96
102
// address. Since ICS-20 tokens coming from other chains are
@@ -115,7 +121,7 @@ impl<'ws, S: Spec> IbcTransferContext<'ws, S> {
115
121
salt,
116
122
initial_balance,
117
123
minter_address,
118
- authorized_minters ,
124
+ vec ! [ self . ibc_transfer . address . clone ( ) ] ,
119
125
& context,
120
126
& mut self . working_set . borrow_mut ( ) ,
121
127
)
@@ -383,11 +389,7 @@ impl<'ws, S: Spec> TokenTransferExecutionContext for IbcTransferContext<'ws, S>
383
389
384
390
match maybe_token_id {
385
391
Some ( token_id) => token_id,
386
- None => self . create_token (
387
- token_name,
388
- account. address . clone ( ) ,
389
- vec ! [ self . ibc_transfer. address. clone( ) ] ,
390
- ) ?,
392
+ None => self . create_token ( token_name, account. address . clone ( ) ) ?,
391
393
}
392
394
} ;
393
395
0 commit comments