pub async fn deploy_safe_module_with_targets_and_nodes<M: Middleware>(
hopr_node_stake_factory: HoprNodeStakeFactory<M>,
hopr_token_address: Address,
hopr_channels_address: Address,
hopr_module_implementation_address: Address,
hopr_announcement_address: Address,
allowance: U256,
node_addresses: Option<Vec<Address>>,
admins: Vec<Address>,
threshold: U256,
) -> Result<(SafeSingleton<M>, HoprNodeManagementModule<M>), HelperErrors>
Expand description
Deploy a safe and a module proxies via HoprStakeFactory contract with default permissions and announcement targets Within one multicall, as an owner of the safe:
- deploy a safe proxy instance and a module proxy instance with multicall as an owner
- add announcement as a permitted target in the deployed module proxy
- approve token transfer to be done for the safe by channel contracts
- if node addresses are known, include nodes to the module by safe
- transfer safe ownership to actual admins
- set desired threshold
- if node addresses are known, include nodes and safes to the network registry.
Returns safe proxy address and module proxy address