hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
290 stars 129 forks source link

How to pass in the default.testnet-plan.yaml - list 5 (optional principal) parameter #1479

Closed jovanvuleta closed 1 week ago

jovanvuleta commented 1 week ago

How is list of optionals passed in the testnet deployment plan? - list 5 (optional principal) parameter

(define-public (initialize-governance (governance-multisigs (list 5 (optional principal))))
  (begin
    (asserts! (not (var-get governance-initialized)) ERR-CONTRACT-ALREADY-INITIALIZED)
    (try! (is-contract-deployer))
    (var-set governance-initialized true)
    (map set-governance-multisig governance-multisigs)
    SUCCESS
  )
)

Example:

          - contract-call:
                contract-id: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG.governance
                expected-sender: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
                method: initialize-governance
                parameters:
                    - "'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG none none none none"
                cost: 10800
hugocaillard commented 1 week ago

@jovanvuleta You can do

parameters:
    - "(list (some 'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG) none none none none)"

Linking to this issue so that we can add it to the documentation https://github.com/hirosystems/docs/issues/293

hugocaillard commented 1 week ago

I'm closing for now. Feel free to reopen if you need to