Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Fuel V1.5 | Aggregate Signature and Compressed Transaction Format #48

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions config/solidity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const solc = require('solc');
const read = require('fs-readfile-promise');
const write = require('write');

// target filename
const target = 'target.sol';

(async () => {
if (!process.env.compile) return;

const contractName = process.env.compile;
const path = process.env.file || `./src/${contractName}.sol`;

const input = {
language: 'Solidity',
sources: {
[target]: {
content: await read(path, 'utf8'),
},
},
settings: {
outputSelection: {
'*': {
'*': ['*'],
},
},
},
};

try {
const output = JSON.parse(solc.compile(JSON.stringify(input)));

if (output.errors) {
console.error(output);
}

let result = {
abi: output.contracts[target][contractName].abi,
bytecode: output.contracts[target][contractName].evm.bytecode.object,
};

await write(`./src/builds/${process.env.compile}.json`, JSON.stringify(result, null, 2));

// exit without issue?
process.exit(0);

console.log('Solidity compiling complete.');

} catch (error) {
console.error(error);
}
})();
Loading