mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use modelCheckerSettings to disable SMT in bytecode comparison instead of stripping the pragmas
This commit is contained in:
parent
61069ec77d
commit
fc1ade7cf6
@ -8,13 +8,10 @@ import json
|
|||||||
SOLC_BIN = sys.argv[1]
|
SOLC_BIN = sys.argv[1]
|
||||||
REPORT_FILE = open("report.txt", mode="w", encoding='utf8', newline='\n')
|
REPORT_FILE = open("report.txt", mode="w", encoding='utf8', newline='\n')
|
||||||
|
|
||||||
def removeSMT(source):
|
|
||||||
return source.replace('pragma experimental SMTChecker;', '')
|
|
||||||
|
|
||||||
for optimize in [False, True]:
|
for optimize in [False, True]:
|
||||||
for f in sorted(glob.glob("*.sol")):
|
for f in sorted(glob.glob("*.sol")):
|
||||||
sources = {}
|
sources = {}
|
||||||
sources[f] = {'content': removeSMT(open(f, mode='r', encoding='utf8').read())}
|
sources[f] = {'content': open(f, mode='r', encoding='utf8').read()}
|
||||||
input_json = {
|
input_json = {
|
||||||
'language': 'Solidity',
|
'language': 'Solidity',
|
||||||
'sources': sources,
|
'sources': sources,
|
||||||
@ -23,6 +20,9 @@ for optimize in [False, True]:
|
|||||||
'enabled': optimize
|
'enabled': optimize
|
||||||
},
|
},
|
||||||
'outputSelection': {'*': {'*': ['evm.bytecode.object', 'metadata']}}
|
'outputSelection': {'*': {'*': ['evm.bytecode.object', 'metadata']}}
|
||||||
|
},
|
||||||
|
'modelCheckerSettings': {
|
||||||
|
"engine": 'none'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args = [SOLC_BIN, '--standard-json']
|
args = [SOLC_BIN, '--standard-json']
|
||||||
|
@ -57,11 +57,6 @@ var fs = require('fs')
|
|||||||
|
|
||||||
var compiler = require('./solc-js/wrapper.js')(require('./solc-js/soljson.js'))
|
var compiler = require('./solc-js/wrapper.js')(require('./solc-js/soljson.js'))
|
||||||
|
|
||||||
function removeSMT(source)
|
|
||||||
{
|
|
||||||
return source.replace('pragma experimental SMTChecker;', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var optimize of [false, true])
|
for (var optimize of [false, true])
|
||||||
{
|
{
|
||||||
for (var filename of process.argv.slice(2))
|
for (var filename of process.argv.slice(2))
|
||||||
@ -69,13 +64,16 @@ for (var optimize of [false, true])
|
|||||||
if (filename !== undefined)
|
if (filename !== undefined)
|
||||||
{
|
{
|
||||||
var inputs = {}
|
var inputs = {}
|
||||||
inputs[filename] = { content: removeSMT(fs.readFileSync(filename).toString()) }
|
inputs[filename] = { content: fs.readFileSync(filename).toString() }
|
||||||
var input = {
|
var input = {
|
||||||
language: 'Solidity',
|
language: 'Solidity',
|
||||||
sources: inputs,
|
sources: inputs,
|
||||||
settings: {
|
settings: {
|
||||||
optimizer: { enabled: optimize },
|
optimizer: { enabled: optimize },
|
||||||
outputSelection: { '*': { '*': ['evm.bytecode.object', 'metadata'] } }
|
outputSelection: { '*': { '*': ['evm.bytecode.object', 'metadata'] } }
|
||||||
|
},
|
||||||
|
"modelCheckerSettings": {
|
||||||
|
"engine": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var result = JSON.parse(compiler.compile(JSON.stringify(input)))
|
var result = JSON.parse(compiler.compile(JSON.stringify(input)))
|
||||||
|
Loading…
Reference in New Issue
Block a user