NethermindEth / StarknetByExample

A collection of examples of Cairo smart contracts for Starknet.
https://starknet-by-example.voyager.online/
MIT License
101 stars 77 forks source link

Feature: Account Abstraction - Spending Limits #230

Open egeaybars123 opened 4 days ago

egeaybars123 commented 4 days ago

I thought I could create a Cairo contract and a content about Account Abstraction on Starknet. Spending/withdrawal limits for Starknet accounts for ERC-20 tokens could be added, and the developers could learn more about how to write their own account contracts on Starknet with Starknet By Example website. Do you think it is a good idea to add this feature on Starknet By Example?

julio4 commented 3 days ago

Hello! There is already an account abstraction section with a simple contract account example. Adding specific examples of account abstraction is a good idea (see #191).

Could you expand a little bit on what features you have in mind regarding spending/withdrawal limits?

egeaybars123 commented 3 days ago

Hello! There is already an account abstraction section with a simple contract account example. Adding specific examples of account abstraction is a good idea (see #191).

Could you expand a little bit on what features you have in mind regarding spending/withdrawal limits?

Regarding spending limits, a user will be able to set a spending limit for a token address for any amount they want. Their limit will decrease if they call the approve or transfer function on the token contract address. The limit will also reset after any timestamp they want (daily, weekly or every 12 hours).