|
1 | 1 | use std::collections::HashMap; |
2 | 2 | use std::convert::TryFrom; |
3 | 3 |
|
4 | | -use mintbase_deps::constants::{ |
5 | | - gas, |
6 | | - NO_DEPOSIT, |
7 | | -}; |
| 4 | +use mintbase_deps::constants::gas; |
8 | 5 | // contract interface modules |
9 | 6 | use mintbase_deps::interfaces::ext_on_transfer; |
10 | 7 | // logging functions |
@@ -81,24 +78,14 @@ impl MintbaseStore { |
81 | 78 | let owner_id = AccountId::new_unchecked(token.owner_id.to_string()); |
82 | 79 | self.lock_token(&mut token); |
83 | 80 |
|
84 | | - ext_on_transfer::nft_on_transfer( |
85 | | - pred, |
86 | | - owner_id.clone(), |
87 | | - token_id, |
88 | | - msg, |
89 | | - receiver_id.clone(), |
90 | | - NO_DEPOSIT, |
91 | | - gas::NFT_TRANSFER_CALL, |
92 | | - ) |
93 | | - .then(store_self::nft_resolve_transfer( |
94 | | - owner_id, |
95 | | - receiver_id, |
96 | | - token_id.0.to_string(), |
97 | | - None, |
98 | | - env::current_account_id(), |
99 | | - NO_DEPOSIT, |
100 | | - gas::NFT_TRANSFER_CALL, |
101 | | - )) |
| 81 | + ext_on_transfer::ext(receiver_id.clone()) |
| 82 | + .with_static_gas(gas::NFT_TRANSFER_CALL) |
| 83 | + .nft_on_transfer(pred, owner_id.clone(), token_id, msg) |
| 84 | + .then( |
| 85 | + store_self::ext(env::current_account_id()) |
| 86 | + .with_static_gas(gas::NFT_TRANSFER_CALL) |
| 87 | + .nft_resolve_transfer(owner_id, receiver_id, token_id.0.to_string(), None), |
| 88 | + ) |
102 | 89 | } |
103 | 90 |
|
104 | 91 | // -------------------------- view methods ----------------------------- |
|
0 commit comments