|
|
|
@ -18,8 +18,8 @@ class CompilerMetadata { |
|
|
|
|
var path = self._opts.fileManager.currentPath() |
|
|
|
|
if (provider && path) { |
|
|
|
|
self._opts.compiler.visitContracts((contract) => { |
|
|
|
|
var fileName = path + '/' + contract.name + '.json' |
|
|
|
|
provider.get(fileName, (error, content) => { |
|
|
|
|
var fileNameDeploy = path + '/' + contract.name + '.deploy.json'
|
|
|
|
|
provider.get(fileNameDeploy, (error, content) => { |
|
|
|
|
if (!error) { |
|
|
|
|
content = content || '{}' |
|
|
|
|
var metadata |
|
|
|
@ -32,9 +32,19 @@ class CompilerMetadata { |
|
|
|
|
self.networks.forEach((network) => { |
|
|
|
|
metadata[network] = self._syncContext(contract, metadata[network] || {}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
provider.set(fileName, JSON.stringify(metadata, null, '\t')) |
|
|
|
|
provider.set(fileNameDeploy, JSON.stringify(metadata, null, '\t')) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
var fileNameData = path + '/' + contract.name + '.data.json' |
|
|
|
|
var fileNameAbi = path + '/' + contract.name + '.abi' |
|
|
|
|
provider.set(fileNameAbi, JSON.stringify(contract.object.abi, null, '\t'), () => { |
|
|
|
|
var data = { |
|
|
|
|
bytecode: contract.object.evm.bytecode, |
|
|
|
|
deployedBytecode: contract.object.evm.deployedBytecode, |
|
|
|
|
gasEstimates: contract.object.evm.gasEstimates, |
|
|
|
|
methodIdentifiers: contract.object.evm.methodIdentifiers, |
|
|
|
|
} |
|
|
|
|
provider.set(fileNameData, JSON.stringify(data, null, '\t')) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|