Browse Source

v1 of solidity compiler inside of FED!

tags/v3.4.5
jojapoppa 8 months ago
parent
commit
8f024d43b3
5 changed files with 44 additions and 3 deletions
  1. +1
    -0
      no_git_ssl.sh
  2. +2
    -2
      package-lock.json
  3. +1
    -1
      package.json
  4. +0
    -0
      src/js/web3_hdwalletprovider.js
  5. +40
    -0
      src/js/web3_solidity.js

+ 1
- 0
no_git_ssl.sh View File

@@ -0,0 +1 @@
export GIT_SSL_NO_VERIFY=1

+ 2
- 2
package-lock.json View File

@@ -1,12 +1,12 @@
{
"name": "FedoraGoldWallet",
"version": "v3.3.8",
"version": "v3.3.9",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "FedoraGoldWallet",
"version": "v3.3.8",
"version": "v3.3.9",
"license": "ISC",
"dependencies": {
"@danieldsf/csv-utils": "^1.0.2",


+ 1
- 1
package.json View File

@@ -2,7 +2,7 @@
"name": "FedoraGoldWallet",
"productName": "FedoraGoldWallet",
"description": "FedoraGold (FED) GUI Wallet",
"version": "v3.3.8",
"version": "v3.3.9",
"homepage": "https://github.com/jojapoppa/fedoragold-wallet-electron",
"repository": "https://github.com/jojapoppa/fedoragold-wallet-electron",
"main": "main.js",


src/js/hdwalletprovider.js → src/js/web3_hdwalletprovider.js View File


+ 40
- 0
src/js/web3_solidity.js View File

@@ -0,0 +1,40 @@
var solc = require('solc');

var input = {
language: 'Solidity',
sources: {
'test.sol': {
content: 'import "lib.sol"; contract C { function f() public { L.f(); } }'
}
},
settings: {
outputSelection: {
'*': {
'*': ['*']
}
}
}
};

function findImports(path) {
if (path === 'lib.sol')
return {
contents:
'library L { function f() internal returns (uint) { return 7; } }'
};
else return { error: 'File not found' };
}

// New syntax (supported from 0.5.12, mandatory from 0.6.0)
var output = JSON.parse(
solc.compile(JSON.stringify(input), { import: findImports })
);

// `output` here contains the JSON output as specified in the documentation
for (var contractName in output.contracts['test.sol']) {
console.log(
contractName +
': ' +
output.contracts['test.sol'][contractName].evm.bytecode.object
);
}

Loading…
Cancel
Save