Deploy contract with constructor


#1

Hi.
I’m trying to deploy a contract that receives two arguments in the constructor like bellow:

When I try to deploy using the REST API I receive the following message:
“no arguments provided to function.”

If I try to deploy using the dashboard, I receive an alert saying:
“argument names don’t match: (_nf, _weight)()”

How can I provide these arguments using the REST API?

Thank you.

Marcos Roberto Silva


#2

Hi @marcos.silva3 - make sure to provide arguments to the constructor function when you upload the contract. The request body should contain (1) your password, (2) the contract source, and (3) the constructor arguments.

Try uploading the contract again with an args parameter (e.g. nf: nf, custodian: custodian, weight: weight).


#3

Hi Eli.
It worked!

Thank you.

Marcos Roberto Silva