Time to read: 1 min
RIF Relay Smart Wallets
This guide is intended to explain more about the interaction and deployment of the Smart Wallets. We will be using additional testing contracts that were included in the project, like the UtilToken(ERC20). All the utils scripts are executed from the account[0] from the regtest network.
Prerequisites
- Follow the deployment process in Deployment Guide.
- The definition of the smart wallet can be found in Architecture
Ways to create smart wallets
There are two ways to create a Smart Wallet:
- Regular transaction: The Requester (or another account on behalf of the Requester) calls the Proxy Factory asking to get a new Smart Wallet. Therefore the Proxy Factory creates a proxy to the SmartWallet code, delegating the ownership to the Requester.
- Sponsored: It needs to go through the RIF Relay process, which is described in detail below. The requester asks a third party to pay for the Smart Wallet deployment, and the requester pays in tokens for that (or free if it is subsidized by the third-party, a.k.a, Sponsor).
Send funds
In the RIF Relay Contracts there is a script that would help us to mint ERC20 tokens.
We need to execute the following script:
npx hardhat mint --token-address <0xabc123> --amount <amount_in_wei> --receiver <0xabc123> --network regtest
The token contract needs to have a mint function.