Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system SC proxy - arg reference fix #1768

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/examples/nft-minter/src/nft_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ pub trait NftModule {
self.send()
.esdt_system_sc_proxy()
.set_special_roles(
&self.blockchain().get_sc_address(),
&self.nft_token_id().get(),
self.blockchain().get_sc_address(),
self.nft_token_id().get(),
[EsdtLocalRole::NftCreate][..].iter().cloned(),
)
.async_call_and_exit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
self.wrapped_tx
.payment(NotPayable)
.raw_call(CHANGE_OWNER_BUILTIN_FUNC_NAME)
.argument(new_owner)
.argument(&new_owner)
.original_result()
}

Expand All @@ -87,26 +87,26 @@ where
Arg1: ProxyArg<BigUint<Env::Api>>,
>(
self,
token: &Arg0,
token: Arg0,
nonce: u64,
amount: &Arg1,
amount: Arg1,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
if nonce == 0 {
return self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_LOCAL_BURN_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(&token)
.argument(&amount)
.original_result();
}

self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_BURN_FUNC_NAME)
.argument(token)
.argument(&token)
.argument(&nonce)
.argument(amount)
.argument(&amount)
.original_result()
}

Expand All @@ -115,39 +115,39 @@ where
Arg1: ProxyArg<BigUint<Env::Api>>,
>(
self,
token: &Arg0,
token: Arg0,
nonce: u64,
amount: &Arg1,
amount: Arg1,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
if nonce == 0 {
return self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_LOCAL_MINT_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(&token)
.argument(&amount)
.original_result();
}
self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_ADD_QUANTITY_FUNC_NAME)
.argument(token)
.argument(&token)
.argument(&nonce)
.argument(amount)
.argument(&amount)
.original_result()
}

pub fn nft_add_multiple_uri<Arg0: ProxyArg<TokenIdentifier<Env::Api>>>(
self,
token_id: &Arg0,
token_id: Arg0,
nft_nonce: u64,
new_uris: &ManagedVec<Env::Api, ManagedBuffer<Env::Api>>,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
let mut tx = self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_ADD_URI_FUNC_NAME)
.argument(token_id)
.argument(&token_id)
.argument(&nft_nonce);

for uri in new_uris {
Expand All @@ -159,16 +159,16 @@ where

pub fn nft_update_attributes<T: TopEncode, Arg0: ProxyArg<TokenIdentifier<Env::Api>>>(
self,
token_id: &Arg0,
token_id: Arg0,
nft_nonce: u64,
new_attributes: &T,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_UPDATE_ATTRIBUTES_FUNC_NAME)
.argument(token_id)
.argument(&token_id)
.argument(&nft_nonce)
.argument(new_attributes)
.argument(&new_attributes)
.original_result()
}

Expand All @@ -182,24 +182,24 @@ where
Arg4: ProxyArg<ManagedBuffer<Env::Api>>,
>(
self,
token: &Arg0,
amount: &Arg1,
name: &Arg2,
royalties: &Arg3,
hash: &Arg4,
token: Arg0,
amount: Arg1,
name: Arg2,
royalties: Arg3,
hash: Arg4,
attributes: &T,
uris: &ManagedVec<Env::Api, ManagedBuffer<Env::Api>>,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, u64> {
let mut tx = self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_CREATE_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(name)
.argument(royalties)
.argument(hash)
.argument(attributes);
.argument(&token)
.argument(&amount)
.argument(&name)
.argument(&royalties)
.argument(&hash)
.argument(&attributes);

if uris.is_empty() {
// at least one URI is required, so we push an empty one
Expand Down
Loading
Loading