Skip to content

Commit

Permalink
transfer role old simple lock
Browse files Browse the repository at this point in the history
  • Loading branch information
dorin-iancu committed Dec 8, 2022
1 parent d486eb9 commit 7651baa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions locked-asset/simple-lock/src/proxy_farm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ pub trait ProxyFarmModule:
);
}

#[only_owner]
#[endpoint(setTransferRoleProxyFarmToken)]
fn set_transfer_role_proxy_farm_token(&self, opt_address: OptionalValue<ManagedAddress>) {
let address = match opt_address {
OptionalValue::Some(addr) => addr,
OptionalValue::None => self.blockchain().get_sc_address(),
};
self.farm_proxy_token().set_local_roles_for_address(
&address,
&[EsdtLocalRole::Transfer],
None,
);
}

/// Add a farm to the whitelist.
/// Currently, two types of farms are supported, denoted by the `farm_type` argument:
/// `0` - SimpleFarm - rewards are fungible tokens
Expand Down
1 change: 1 addition & 0 deletions locked-asset/simple-lock/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ elrond_wasm_node::wasm_endpoints! {
removeFarmFromWhitelist
removeLiquidityLockedToken
removeLpFromWhitelist
setTransferRoleProxyFarmToken
unlockTokens
)
}

0 comments on commit 7651baa

Please sign in to comment.