SNS AddGenericNervousSystemFunction targeting SNS ledger forbidden

I’m trying to add a generic function to an SNS that targets the icrc1_transfer method of the sns_ledger. The idea is to have funds in different subaccounts of the governance canister that can be transferred via a proposal. We don’t want to put them into the base treasury because we want to keep funds separate for different purposes.

When calling the AddGenericNervousSystemFunction proposal, I receive the following error.

(
  record {
    command = opt variant {
      Error = record {
        error_message = "1 defects in Proposal:\nFunction targets a reserved canister.";
        error_type = 15 : int32;
      }
    };
  },
)

I guess it makes sense that this is not possible to target the ledger because otherwise one could circumvent the “critical proposal” types and simply add a function that can transfer treasury funds in a normal proposal.

However, we’d still like to be able to have separate subaccounts on our governance canister that we can dedicated to different purposes and have the funds in control of the DAO. Is this possible?

I guess it makes sense that this is not possible to target the ledger because otherwise one could circumvent the “critical proposal” types and simply add a function that can transfer treasury funds in a normal proposal.

Yes, this is precisely the idea.

However, we’d still like to be able to have separate subaccounts on our governance canister that we can dedicated to different purposes and have the funds in control of the DAO. Is this possible?

May I ask a bit more about the use cases? Would you like to have a DAO decision for each separate transfer or would you want one DAO decision that pre-approves some fund that can be used under some conditions?
Depending on what you need, here a few ideas:

  • You could have a canister that is SNS-controlled and which owns an account on the ledger. The canister could implement some fixed conditions under which a certain amount can be transferred and do this automatically. The SNS voters could then review this canister and approve a treasury transfer to this canister to reserve these funds for this if they agree to the conditions. This could be useful for example to automate things like cycle management etc.

  • You could do something similar as above, but if you require a “partial decision”, e.g., where the funds would exactly go, I think you could do this with a generic proposal to the canister (which in turn would call the ledger). This would not be a critical proposal, so probably has to be treated with care and remains to be seen if the SNS voters would accept this (perhaps implementing limits on this canister or just pre-approving amounts that are not too large could make this a viable option).

  • Finally, if you are looking to approve every individual transaction through a treasury proposal but from different treasury accounts, I think you are right that this is currently not supported (will try to double-check). I don’t think this is on our roadmap at the moment, but we can discuss adding it to future features if this is what you need.

Hope this helps and I will try to confirm the statement in the last point!

So the basic idea is to have separate accounts where inflows to the DAO treasury can be stored. The source could be income from different sources, donations, etc. and we don’t want to mix those in the main treasury.

From what I understand now, the most logical way for us to do this is to create a new canister, which we hand to the SNS, and then we have different subaccounts on this canister which would serve as a “liquid” treasury, dedicated to each purpose that we have.

One of the SNS engineers confirmed that we were right about the last point: namely that it is not currently possible to have multipel treasury subaccounts that can be accessed via treasury proposal.

From what I understand now, the most logical way for us to do this is to create a new canister, which we hand to the SNS, and then we have different subaccounts on this canister which would serve as a “liquid” treasury, dedicated to each purpose that we have.

I don’t know if this is the most logical way, but this is certainly something that you could integrate with the SNS already today and that I think would work (of course good to test this first).
In the end it is also about convincing the SNS community that this makes sense: if there is too large a share of the total treasury stored in these accounts, maybe the SNS community prefers if they are in a “real treasury” that is protected by the treasury limits. But for smaller amounts or if this new canister implements strict rules what these funds can be used for, maybe they would think this is acceptable.

1 Like