Skip to content

Commit

Permalink
Merge pull request #15 from ElrondNetwork/public-functions-refactor
Browse files Browse the repository at this point in the history
[Router SC] setLocalRoles does not need tokenId
  • Loading branch information
claudiulataretu authored Apr 1, 2021
2 parents a1afc03 + 4af46f5 commit 31e157a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions elrond_dex_router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ pub trait Router {
fn set_local_roles(
&self,
address: Address,
token_identifier: TokenIdentifier,
) -> SCResult<AsyncCall<BigUint>> {
require!(self.state().get() == State::Active, "Not active");
sc_try!(self.check_is_pair_sc(&address));
Expand All @@ -153,12 +152,12 @@ pub trait Router {
let pair_token = contract_call!(self, address.clone(), PairContractProxy)
.get_lp_token_identifier()
.execute_on_dest_context(half_gas, self.send());
require!(token_identifier == pair_token, "PAIR: LP token differs from supplied Token");
require!(pair_token.is_esdt(), "PAIR: LP token not issued");

Ok(ESDTSystemSmartContractProxy::new()
.set_special_roles(
&address,
token_identifier.as_esdt_identifier(),
pair_token.as_esdt_identifier(),
&[EsdtLocalRole::Mint, EsdtLocalRole::Burn],
)
.async_call()
Expand Down

0 comments on commit 31e157a

Please sign in to comment.