IdentityAccessManagerWalletFacet
Allows EAMs to deploy and manage wallets for their entities
Facet for wallet deployment and management through IAM
State Variables
_walletFactory
mapping(address => address) private _walletFactory;
_deployedWallets
mapping(address => address[]) private _deployedWallets;
_walletExists
mapping(address => mapping(address => bool)) private _walletExists;
Functions
constructor
Constructor - no dependencies to avoid circular dependency during dEAMond construction
constructor();
setWalletFactory
Set the wallet factory for this IAM
function setWalletFactory(address walletFactory) external;
Parameters
walletFactory
address
The wallet factory address
deployWallet
Deploy a standard wallet through the IAM
function deployWallet(string calldata name, string calldata walletType) external returns (address wallet);
Parameters
name
string
The name for the wallet
walletType
string
The type of wallet to deploy
Returns
wallet
address
The address of the deployed wallet
deployGovernanceWallet
Deploy a governance wallet through the IAM
function deployGovernanceWallet(string calldata governanceType) external returns (address wallet);
Parameters
governanceType
string
The type of governance (e.g., "SimpleApproval", "MultiSig", "FullGovernance")
Returns
wallet
address
The address of the deployed governance wallet
getDeployedWallets
Get all wallets deployed by this IAM
function getDeployedWallets() external view returns (address[] memory wallets);
Returns
wallets
address[]
Array of wallet addresses
getWalletCount
Get the number of wallets deployed by this IAM
function getWalletCount() external view returns (uint256 count);
Returns
count
uint256
Number of deployed wallets
isWalletDeployed
Check if a wallet was deployed by this IAM
function isWalletDeployed(address wallet) external view returns (bool exists);
Parameters
wallet
address
The wallet address to check
Returns
exists
bool
True if the wallet was deployed by this IAM
getWalletFactory
Get the current wallet factory for this IAM
function getWalletFactory() external view returns (address factory);
Returns
factory
address
The wallet factory address
_ensureIdentityAccess
Ensure only the entity (IAM owner) can call wallet functions
function _ensureIdentityAccess() internal view;
initializeWalletFactory
Initialize wallet factory for a new IAM
function initializeWalletFactory(address IAM, address walletFactory) external;
Parameters
IAM
address
The IAM address
walletFactory
address
The wallet factory address
Events
WalletDeployed
event WalletDeployed(address indexed IAM, address indexed wallet, string walletType, address indexed creator);
GovernanceWalletDeployed
event GovernanceWalletDeployed(
address indexed IAM, address indexed wallet, string governanceType, address indexed creator
);
WalletFactoryUpdated
event WalletFactoryUpdated(address indexed oldFactory, address indexed newFactory);
Errors
WalletFactoryNotSet
error WalletFactoryNotSet();
WalletDeploymentFailed
error WalletDeploymentFailed();
OnlyEntityCanDeploy
error OnlyEntityCanDeploy();
Last updated
Was this helpful?