Expand description
This module contains all the methods used for onchain interaction, especially with Safe instance, Mutlicall, and Multisend contracts.
SafeTxOperation corresponds to the Operation
Enum used in Safe smart contract.
MultisendTransaction struct is used for building transactions interacting with Multisend contract
Re-exports§
pub use safe_singleton::*;
pub use module_singleton::*;
pub use multi_send::*;
Modules§
- module_
singleton - This module was auto-generated with ethers-rs Abigen. More information at: https://github.com/gakonst/ethers-rs
- multi_
send - This module was auto-generated with ethers-rs Abigen. More information at: https://github.com/gakonst/ethers-rs
- safe_
singleton - This module was auto-generated with ethers-rs Abigen. More information at: https://github.com/gakonst/ethers-rs
Structs§
- Multisend
Transaction - Struct to make a multisend transaction, mainly used by safe instances
Enums§
- Safe
TxOperation - Enums of Safe transaction operation
Functions§
- debug_
node_ safe_ module_ setup_ main - Quick check if the following values are correct, for one single node: 4. If Safe is owned by the correct owner(s) 5. Safe’s wxHOPR balance and allowance 6. if the module is enabled 7. if node is included in the module 8. Get all the targets of the safe (then check if channel and announcement are there) 9. Get the owner of the module
- debug_
node_ safe_ module_ setup_ on_ balance_ and_ registries - Quick check if the following values are correct, for one single node:
- deploy_
multicall3_ for_ testing - Deploy a MULTICALL contract into Anvil local chain for testing
- deploy_
proxy 🔒 - helper function to compute create2 safe proxy address
- deploy_
safe_ module_ with_ targets_ and_ nodes - 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:
- deregister_
nodes_ from_ network_ registry - Deregister safes and nodes from the network registry. Does not do any action on the eligibility. It returns the number of removed nodes
- deregister_
nodes_ from_ node_ safe_ registry_ and_ remove_ from_ module - Deregister safes and nodes from the node-safe registry. It returns the number of removed nodes
- force_
sync_ safes_ on_ network_ registry - Force-sync the eligibility to given values. This can only be called with a manager account
- get_
chain_ id_ and_ safe_ nonce - Get chain id and safe nonce
- get_
domain_ 🔒separator - get the domain separator of a safe instance contract_address should be safe address
- get_
native_ and_ token_ balances - Get native balance and hopr token balance for given addresses
- get_
registered_ safes_ for_ nodes_ on_ network_ registry - Get registered safes for given nodes on the network registry
- get_
registered_ safes_ for_ nodes_ on_ node_ safe_ registry - Get registered safes for given nodes on the node-safe registry
- get_
safe_ 🔒transaction_ hash - Implement getTransactionHash() function as in vendor/solidity/safe-contracts-1.4.1/contracts/Safe.sol
Note that
safeTxGas
,baseGas
, andgasPrice
are zero;gasToken
is also address zero - get_
salt_ 🔒from_ salt_ nonce - helper function to get salt nonce
- include_
nodes_ to_ module - Include nodes to the module
- migrate_
nodes - Migrate nodes to be able to run in a new network.
- predict_
module_ address - Helper function to predict module address. Note that here the caller is the contract deployer
- predict_
safe_ address - Helper function to predict safe address
- prepare_
safe_ tx_ from_ owner_ contract - Wrap a transaction into a safe transaction payload Add the safe transaction to multicall
- register_
safes_ and_ nodes_ on_ network_ registry - Register safes and nodes to the network registry, and force-sync the eligibility to true. It returns the number of removed nodes and nodes being added.
- send_
multisend_ safe_ transaction_ with_ threshold_ one - Use safe to delegatecall to multisend contract Note that when no additional signature is provided, the safe must have a threshold of one, so that the transaction can be executed. Note that the refund address is the caller (safe owner) wallet
- send_
safe_ transaction_ with_ threshold_ one - Send one transaction via safe
- transfer_
native_ tokens - Transfer some native tokens from the caller to the list of addresses Address_i receives amounts_i native tokens.
- transfer_
or_ mint_ tokens - Transfer some HOPR tokens from the caller to the list of addresses Address_i receives amounts_i HOPR tokens. When there’s not enough token in caller’s balance, if the caller is a minter, mint the missing tokens. If not, returns error