Use an MPC Wallet as the Delegate
Assume you have a Safe{Wallet} on the Base chain with ETH deposited in the Stargate protocol for yield farming. You can use an MPC Wallet to perform automated, scheduled reward collection by using the WaaS API.- Before you start, refer to Get started with Smart Contract Wallets to complete the initial setup, including installing the WaaS SDK and importing the Safe{Wallet} to Cobo Portal.
-
Configure an on-chain risk control policy to approve the claim method initiated via the MPC Wallet address automatically.
- Select the MPC Wallet address as the Delegate.
- Set Condition as Custom Contract Calls.
- Select Method-Level.
- Enter the address of the Stargate staking contract as the target contract, and select claim as the method.
- Click Submit to initiate a multi-sig transaction. Ask the Safe{Wallet} signers for confirmation.
- Execute the following code to claim rewards daily at 9 a.m. The sample code uses the Call smart contract operation to interact with the Stargate contract.
Sample code in Python
Sample code in Python
Use an external EOA wallet as the Delegate
You can also use external EOA wallets that are not created through Cobo Portal to claim rewards. The initial steps are similar to those for MPC Wallets, but you will set the EOA wallet address as the Delegate and adjust the on-chain risk control policy accordingly. Instead of using the WaaS API, the EOA wallet interacts with Safe{Wallet} by using functions provided by Cobo Safe. The process can be outlined in the following steps:- Build a claim transaction to collect farming rewards from Stargate.
- Wrap the claim transaction within a Cobo Safe transaction.
- Initiate the Cobo Safe transaction via the EOA wallet.
- Use the EOA wallet to sign the transaction and send it to the network.
Sample code in Python
Sample code in Python
Feel free to share your feedback to improve our documentation!