Skip to content

Pass an array as parameter #1

Open

Description

@ICONationDevTeam

Hello,

I got a contract with the following constructor :

class MyClass {

  MyClass (Address[] whitelist) {
    ...
  }
}

I'm trying to figure out how to pass the array "whitelist" in the gradle.build deployJar task :


deployJar {
    keystore = rootProject.hasProperty('keystoreName') ? "$keystoreName" 
        : 'Z:/Work/ICON/config/keystores/sejong/operator.icx'
    password = rootProject.hasProperty('keystorePass') ? "$keystorePass"
        : 'gochain'

    endpoints {
        sejong {
            uri = 'https://sejong.net.solidwallet.io/api/v3'
            nid = 83
        }
        local {
            uri = 'http://localhost:9082/api/v3'
            nid = 3
        }
    }
    parameters {
        arg('whitelist', ???) <- what to put here ?
    }
}

Whatever the value I try, it fails.

I noticed the multisig wallet contract uses a split on a String.
Is there any way to achieve what I want using the native Address array type ?

Activity

  1. sink772 commented on Aug 27, 2021

    @sink772
    Member

    Yeah... as you already noticed, only simple parameter type can be passed with arg extension for now.
    I think we should decide the desired form of structured parameter type passing first before implementing the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions