ZeppelinOS with Quorum/Private Contracts

Hi @amkCha

Have you had any success? If not, please go ahead with creating a feature request.


I setup a 7nodes Quorum network using Docker.

I was able to deploy a private contract on Quorum using truffle as per the instructions: https://www.trufflesuite.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains

I was able to deploy and interact with an OpenZeppelin SDK public contract on Quorum created using OpenZeppelin SDK interactive commands.

I tried using truffle migrations with OpenZeppelin SDK based on the following example and adding privateFor option to the deploy and quorum network type but this appears to have created a public contract rather than a private one:

2_deploy_v0.js

Added privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="] to the options

// Load zos scripts and truffle wrapper function
const { scripts, ConfigManager } = require('@openzeppelin/cli');
const { add, push, create } = scripts;

async function deploy(options) {
  // Register v0 of MyContract in the zos project
  add({ contractsData: [{ name: 'MyContract_v0', alias: 'MyContract' }] });

  // Push implementation contracts to the network
  await push(options);

  // Create an instance of MyContract, setting initial value to 42
  await create(Object.assign({ contractAlias: 'MyContract', methodName: 'initialize', methodArgs: [42] }, options));
}

module.exports = function(deployer, networkName, accounts) {
  deployer.then(async () => {
    const { network, txParams } = await ConfigManager.initNetworkConfiguration({ network: networkName, from: accounts[1], privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="] })
    await deploy({ network, txParams, privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="] })
  })
}