Add Generic Nervous System Function with new topic (bug?)

Hi, im trying to register a Generic Nervous System Function but it looks like it’s not working as expected, it looks like the new topic field is always passed in as [] and result in a topic is required error.

Also I noticed that the declarations on the @dfinity/sns npm package are not up to date yet, could it maybe originate from that?

I still need to try it through quill but i was wondering if anybody else has run into a similar issue.

payload im sending

5 Likes

I also confirmed it’s not working with quill, i get the following response running the below script;
@lara @aterga

(
  record {
    command = opt variant {
      Error = record {
        error_message = "1 defects in Proposal:\nNervousSystemFunction must have a topic";
        error_type = 15 : int32;
      }
    };
  },
)
#!/bin/bash

PEM_FILE="$(readlink -f "./identity.pem")"
DEVELOPER_NEURON_ID="9b9d1da84eab24cd91272dcdb539070e5385d3a166454d40c3ecb73b32dca0fb"
CANISTERS_PATH=./sns_canister_ids.json

TITLE="Add deploy_icrc1_tokens generic function"
URL=""
CANISTER_PRINCIPAL="fi3zi-fyaaa-aaaaq-aachq-cai"
SUMMARY="This proposal registers the new deploy_icrc1_tokens generic function on the Sneed DeFi canister (ok64y-uiaaa-aaaag-qdcbq-cai). This function allows the Sneed governance canister to transfer icrc1 tokens that are under the null subaccount."

quill sns  \
   --canister-ids-file $CANISTERS_PATH  \
   --pem-file $PEM_FILE  \
   make-proposal --proposal "(record {
      title=\"$TITLE\";
      url=\"$URL\";
      summary=\"$SUMMARY\";
      action=opt variant {
         AddGenericNervousSystemFunction = record {
            description=opt \"Deploys ICRC1 token\";
            name=\"deploy_icrc1_tokens\";
            id=3001 : nat64;
            function_type= opt variant {
               GenericNervousSystemFunction = record {
                  topic= opt variant {
                     DappCanisterManagement = null
                  };
                  target_canister_id=opt principal \"ok64y-uiaaa-aaaag-qdcbq-cai\";
                  validator_canister_id=opt principal \"ok64y-uiaaa-aaaag-qdcbq-cai\";
                  validator_method_name=opt \"validate_deploy_icrc1_tokens\";
                  target_method_name=opt \"deploy_icrc1_tokens\"
               }
            }
         }
      }
   })" \
   "${DEVELOPER_NEURON_ID}" > msg.json

quill send --yes msg.json
5 Likes

It’s over, twenty characters

2 Likes

Hi @rem.codes,

Thanks a lot for reporting this. Enforcing that new custom proposals must have topics was released without a proper heads up for the clients, e.g., quill, to adjust to it. We’re going to bump quill and make a new release soon, I’ll update this thread once we have that.

I’ll also notify all SNS devs in via the DAO circle OpenChat group about this recent change. As you’re an SNS frontend developer yourself, we’d very much appreciate the fix in ic-toolkit.

Apologies for the inconvenience!

4 Likes

I can confirmed that it works,
i will wait for the release of the new @dfinity/sns package until that time i will do a custom implementation for toolkit to temporary fix it.

3 Likes

Hi @rem.codes,
We have released a new version of @dfinity/sns with updated types. Thank you for bringing this to our attention.

7 Likes