Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance Transfer - Any Proxy - adding a limit / threshold #7564

Open
2 tasks done
VinceCorsica opened this issue Feb 13, 2025 · 6 comments
Open
2 tasks done

Balance Transfer - Any Proxy - adding a limit / threshold #7564

VinceCorsica opened this issue Feb 13, 2025 · 6 comments
Assignees
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I5-enhancement An additional feature request.

Comments

@VinceCorsica
Copy link

VinceCorsica commented Feb 13, 2025

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

The ability to transfer funds is associated to the Any Proxy.
However there is no limit outside of the available balance to transfer all funds.
This prevents to delegate with granularity / guardrails
And in case of security events it exposes all funds

Request

Modifying / Complementing current pallet in order to have a proxy which permit to define a max amount up to transfer can be done.

This limit will be allowed for a specific period of time which can be set (like for the delayed proxy)

Solution

No response

Are you willing to help with this request?

Yes!

@VinceCorsica VinceCorsica added the I5-enhancement An additional feature request. label Feb 13, 2025
@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Feb 13, 2025
@ggwpez
Copy link
Member

ggwpez commented Feb 13, 2025

We can think here about having a limit of a proxy for the amounts of funds that it can transfer. The limit should have:

  • optional duration in blocks for which it is valid, after that duration expired the proxy will not be able to transfer anymore
  • total amount of balance that can be transferred out during this duration

For example: Alice authorized proxy Bob to be able to transfer up to 1000 DOT over the next week.
Also possible: Alice authorized proxy Bob to be able to transfer up to 1000 DOT. No time limitation.

@bkchr bkchr removed the I10-unconfirmed Issue might be valid, but it's not yet known. label Feb 13, 2025
@bkchr
Copy link
Member

bkchr commented Feb 13, 2025

We can think here about having a limit of a proxy for the amounts of funds that it can transfer. The limit should have:

* optional duration in blocks for which it is valid, after that duration expired the proxy will not be able to transfer anymore

* total amount of balance that can be transferred out during this duration

This is not really important here, because this logic needs to be implemented downstream in the real runtime.

I see the following two ways to implement this:

  1. Introduce a new pallet that handles the logic. The AnyWithLimit proxy would only be allowed to call the special dispatch function in this new pallet. This dispatch would get a call that should be dispatched. The pallet would need to ensure that the rules are applied to the call and it being rejected if not following the rules.

  2. The proxy pallet is changed to store extra data along side a ProxyType. This data would need to be passed to filter as a mutable reference. The data, like the ProxyType should be passed to the runtime via the Config trait. In this data we would for example then store the limit etc. The filter implementation would then take that these limits are respected.

@bkchr bkchr added the C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. label Feb 13, 2025
@Nathy-bajo
Copy link
Contributor

@bkchr Let me give it a shot, assign me please.

@bkchr
Copy link
Member

bkchr commented Feb 13, 2025

One thing I forgot to mention, the extra data in 2 would need to request some extra deposit fee (depending on the size).

@kianenigma
Copy link
Contributor

In AHM we could add one new proxy type that delegates the logic to a smart contract, which can implement all sorts of proxy types.

This won't play well with the proxy replication methods though.

@bkchr
Copy link
Member

bkchr commented Feb 14, 2025

In AHM we could add one new proxy type that delegates the logic to a smart contract, which can implement all sorts of proxy types.

Yeah, but this would also only work on AHM and is basically ETH account abstractions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I5-enhancement An additional feature request.
Projects
Status: Backlog
Development

No branches or pull requests

6 participants
@kianenigma @bkchr @ggwpez @Nathy-bajo @VinceCorsica and others