1

I wish to deploy a contract using ConseilJS that I am able to originate successfully using smartpy.io

However, when I copy the generated Michelson and initial storage into the following function:

async function deploy_contract(){
  const server='https://babylonnet.SmartPy.io'; //same as smartpy.io
  const keystore={ //working for contract invocations
    publicKey:'foo',
    privateKey:'foo',
    publicKeyHash:'foo',
    seed:'',
    storeType:conseiljs.StoreType.Fundraiser
  };
  const amount=0; //same as smartpy.io
  const delegate=undefined;
  const fee=100000; //same as smartpy.io
  const derivationPath='';
  const storageLimit=20000; //same as smartpy.io
  const gasLimit=500000; //same as smartpy.io
  const code=`
    .
    .
  `;
  const storage=`
    .
    .
  `;
  const codeFormat=conseiljs.TezosParameterFormat.Michelson;
  const result=await conseiljs.TezosNodeWriter.sendContractOriginationOperation(
   server,
   keystore,
   amount,
   delegate,
   fee,
   derivationPath,
   storageLimit,
   gasLimit,
   code,
   storage,
   codeFormat
 );
 console.log(JSON.stringify(result,null,4));
}

The variables code and storage contain the Michelson and initial storage produced by SmartPy which can be deployed through an online tool. However, when I run this function the browser (in this case Chrome) produces the error paused before out-of-memory crash in the console.

Any help is much appreciated!

1

You should probably use the Micheline / JSON version created by SmartPy.io. This is what is actually sent from SmartPy.io.

You also need to change the conseiljs.TezosParameterFormat.Michelson parameter into conseiljs.TezosParameterFormat.Micheline.

| improve this answer | |
  • This appears to have resolved the problem! Thanks for this. – macourtney7 Jan 25 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.