diff --git a/dapps/templates/boilerplate/config/contracts.js b/dapps/templates/boilerplate/config/contracts.js index a2b190c46..dfc93212a 100644 --- a/dapps/templates/boilerplate/config/contracts.js +++ b/dapps/templates/boilerplate/config/contracts.js @@ -51,6 +51,9 @@ module.exports = { // contracts section. //strategy: 'implicit', + // minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes + // minimalContractSize: false, + contracts: { // example: //SimpleStorage: { diff --git a/dapps/templates/demo/config/contracts.js b/dapps/templates/demo/config/contracts.js index 68b1e392d..3d9228380 100644 --- a/dapps/templates/demo/config/contracts.js +++ b/dapps/templates/demo/config/contracts.js @@ -51,6 +51,9 @@ module.exports = { // contracts section. //strategy: 'implicit', + // minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes + // minimalContractSize: false, + contracts: { SimpleStorage: { fromIndex: 0, diff --git a/dapps/templates/simple/contracts.js b/dapps/templates/simple/contracts.js index 14eb0f041..78e7be48c 100644 --- a/dapps/templates/simple/contracts.js +++ b/dapps/templates/simple/contracts.js @@ -51,6 +51,9 @@ module.exports = { // contracts section. //strategy: 'implicit', + // minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes + // minimalContractSize: false, + contracts: { // example: //SimpleStorage: { diff --git a/packages/embark-pipeline/src/index.js b/packages/embark-pipeline/src/index.js index 82de4eaa7..670d596f8 100644 --- a/packages/embark-pipeline/src/index.js +++ b/packages/embark-pipeline/src/index.js @@ -341,6 +341,14 @@ class Pipeline { }, function writeContractsJSON(contracts, next) { async.each(contracts, (contract, eachCb) => { + if (self.embark.config.contractsConfig.minimalContractSize) { + contract = Object.assign({}, contract); + delete contract.code; + delete contract.runtimeBytecode; + delete contract.realRuntimeBytecode; + delete contract.gasEstimates; + delete contract.swarmHash; + } self.fs.writeJson(dappPath( self.buildDir, 'contracts', contract.className + '.json'