Mimic Docs
Search
⌃K

Develop your own action

As explained in the architecture section, Mimic offers an Action concept that can be extended to cover different use cases. Let's see an example:
contract Action {
// Smart Vault reference
address public immutable smartVault;
/**
* @dev Creates a new action instance
*/
constructor(address _smartVault) {
smartVault = _smartVault;
}
/**
* @dev Executes the action. Anyone can execute it.
*/
function call() external {
uint256 balance = address(smartVault).balance;
ISmartVault(smartVault).wrap(balance, new bytes(0));
}
}
As you can see, this action will wrap all the native token's balance available in the Smart Vault every time it's called. Therefore, it must be granted with the Smart Vault's wrap permission.