This is the Main Contract for all the Defi Smart Accounts. Used to create a new Defi Smart Account for a user and run a cast function in the new smart account.
This contract contains most core functions of smart account name cast(). It is only called by owners of smart accounts and has full-fledge access over the smart account. Used also to access all the DSA.
Spells denote a sequence of connector functions that will achieve a given use case. Spells can comprise any number of tasks across any number of connectors.
IDSA(_account).cast(_targets, _data, address(0));
We create an InstaImplementationM1 contract instance using our DSA account and then cast function to cast the spell.
Interact with DSA on smart contract level:
This guide will show you how to interact with DSA on the smart contract level.
Quick setup:
Now we can start interacting with the DSA contract.
Go to Networks to find each chain-related address.
Usage
* InstaIndex:
This is the Main Contract for all the Defi Smart Accounts. Used to create a new Defi Smart Account for a user and run a cast function in the new smart account.
* InstaImplementationM1:
This contract contains most core functions of smart account name cast(). It is only called by owners of smart accounts and has full-fledge access over the smart account. Used also to access all the DSA.
* build(owner, accountVersion, _origin):
Create a DSA Account using this function. It returns the address of the DSA account created.
* cast(_targets, _datas, _origin):
Using cast() user can access the connectors, which allows the smart account to interact with protocols or set up any settings on the smart account.
DSA Setup
Inside the interactingDSA contract, we will create a DSA account and use that to cast a spell.
Creating InstaIndex instance
Creating DSA account
Casting Spell:
Spells denote a sequence of connector functions that will achieve a given use case. Spells can comprise any number of tasks across any number of connectors.
We create an
InstaImplementationM1
contract instance using our DSA account and then cast function to cast the spell.