-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2e6d34
commit 46a476d
Showing
6 changed files
with
132 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
contracts/feature-tests/composability/forwarder/src/fwd_dynamic.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
use crate::fwd_nft::{CallbackProxy, Color}; | ||
|
||
multiversx_sc::imports!(); | ||
|
||
#[multiversx_sc::module] | ||
pub trait ForwarderDynamicModule: | ||
crate::fwd_nft::ForwarderNftModule + crate::fwd_storage::ForwarderStorageModule | ||
{ | ||
#[payable["EGLD"]] | ||
#[endpoint] | ||
fn issue_dynamic_token( | ||
&self, | ||
token_display_name: ManagedBuffer, | ||
token_ticker: ManagedBuffer, | ||
token_type: EsdtTokenType, | ||
num_decimals: usize, | ||
) { | ||
let issue_cost = self.call_value().egld_value().clone_value(); | ||
let caller = self.blockchain().get_caller(); | ||
|
||
self.send() | ||
.esdt_system_sc_proxy() | ||
.issue_dynamic( | ||
issue_cost, | ||
token_display_name, | ||
token_ticker, | ||
token_type, | ||
num_decimals, | ||
) | ||
.callback(self.callbacks().nft_issue_callback(&caller)) | ||
.async_call_and_exit(); | ||
} | ||
|
||
#[endpoint] | ||
fn change_to_dynamic(&self, token_id: TokenIdentifier) { | ||
self.send() | ||
.esdt_system_sc_proxy() | ||
.change_to_dynamic(token_id) | ||
.sync_call(); | ||
} | ||
|
||
#[endpoint] | ||
fn update_token(&self, token_id: TokenIdentifier) { | ||
self.send() | ||
.esdt_system_sc_proxy() | ||
.update_token(token_id) | ||
.sync_call(); | ||
} | ||
|
||
#[endpoint] | ||
fn modify_royalties(&self, token_id: TokenIdentifier, nonce: u64, new_royalty: u64) { | ||
self.send() | ||
.esdt_modify_royalties(&token_id, nonce, new_royalty); | ||
} | ||
|
||
#[endpoint] | ||
fn set_new_uris( | ||
&self, | ||
token_id: TokenIdentifier, | ||
nonce: u64, | ||
new_uris: MultiValueEncoded<ManagedBuffer>, | ||
) { | ||
let new_uris = new_uris.to_vec(); | ||
self.send() | ||
.esdt_nft_set_new_uris(&token_id, nonce, &new_uris); | ||
} | ||
|
||
#[endpoint] | ||
fn modify_creator(&self, token_id: TokenIdentifier, nonce: u64) { | ||
self.send().esdt_nft_modify_creator(&token_id, nonce); | ||
} | ||
|
||
#[endpoint] | ||
fn metadata_recreate( | ||
&self, | ||
token_id: TokenIdentifier, | ||
nonce: u64, | ||
name: ManagedBuffer, | ||
royalties: u64, | ||
hash: ManagedBuffer, | ||
new_attributes: Color, | ||
uris: MultiValueEncoded<ManagedBuffer>, | ||
) { | ||
let uris = uris.to_vec(); | ||
|
||
self.send().esdt_metadata_recreate( | ||
token_id, | ||
nonce, | ||
name, | ||
royalties, | ||
hash, | ||
&new_attributes, | ||
uris, | ||
); | ||
} | ||
|
||
#[endpoint] | ||
fn metadata_update( | ||
&self, | ||
token_id: TokenIdentifier, | ||
nonce: u64, | ||
name: ManagedBuffer, | ||
royalties: u64, | ||
hash: ManagedBuffer, | ||
new_attributes: Color, | ||
uris: MultiValueEncoded<ManagedBuffer>, | ||
) { | ||
let uris = uris.to_vec(); | ||
|
||
self.send().esdt_metadata_update( | ||
token_id, | ||
nonce, | ||
name, | ||
royalties, | ||
hash, | ||
&new_attributes, | ||
uris, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
mod builtin_func_proxy; | ||
mod esdt_system_sc_proxy; | ||
mod legacy_system_sc_proxy; | ||
mod system_sc_proxy; | ||
pub(crate) mod token_properties; | ||
|
||
pub use builtin_func_proxy::*; | ||
pub use esdt_system_sc_proxy::{ESDTSystemSCProxy, ESDTSystemSCProxyMethods, IssueCall}; | ||
pub use legacy_system_sc_proxy::ESDTSystemSmartContractProxy; | ||
pub use system_sc_proxy::{SystemSCProxy, SystemSCProxyMethods}; | ||
pub use token_properties::*; |
61 changes: 0 additions & 61 deletions
61
framework/base/src/types/interaction/system_proxy/system_sc_proxy.rs
This file was deleted.
Oops, something went wrong.