Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Lombardo
nucleo
Commits
d68dd374
Commit
d68dd374
authored
4 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Mejorando solc
parent
508c41d1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/solc
+57
-13
57 additions, 13 deletions
bin/solc
with
57 additions
and
13 deletions
bin/solc
+
57
−
13
View file @
d68dd374
...
...
@@ -4,24 +4,68 @@
# See if PATH is set up incorrectly (look for another install of this binary).
mypath
=
$(
realpath
$0
)
myname
=
${
mypath
##*/
}
for
p
in
${
PATH
//
:/
}
do
checkfile
=
${
p
}
/
${
myname
}
if
[
-x
${
checkfile
}
]
printf
-v
newline
'\n'
function
find_evm_version
()
{
# Remember to set the evm version to be compatible with
# the blockchain. BFA is still at Byzantium (as per 2021).
# The current version is listed in lib/versions with
# keyword chain_evm_version
unset
evmvers
local
keyword
keyword
=
chain_evm_version
while
read
-r
do
if
[[
"
$REPLY
"
=
~ ^
${
keyword
}
=
]]
then
evmvers
=
${
REPLY
#
${
keyword
}
=
}
break
fi
done
<
"
${
BFAHOME
:-
/home/bfa/bfa
}
/lib/versions"
if
[
-z
"
$evmvers
"
]
then
if
[
$(
realpath
${
checkfile
}
)
=
$mypath
]
printf
-v
errortxt
'%s\n%s'
"
$errortxt
"
"Can not find the keyword
${
keyword
}
in lib/versions"
errortxt
=
${
errortxt
#
${
newline
}}
fi
}
function
find_first_solc
{
local
mypath myname p
mypath
=
$(
realpath
"
$0
"
)
myname
=
${
mypath
##*/
}
unset
first_solc
for
p
in
${
PATH
//
:/
}
do
local
checkfile
=
${
p
}
/
${
myname
}
if
[
!
-x
"
${
checkfile
}
"
]
then
continue
fi
if
[
"
$(
realpath
"
${
checkfile
}
"
)
"
=
"
$mypath
"
]
then
continue
fi
# we found another one, yay!
evmvers
=
$(
grep
'^chain_evm_version='
${
BFAHOME
:-
/home/bfa/bfa
}
/lib/versions |
head
-1
)
exec
${
checkfile
}
${
evmvers
/*=/--evm-version=
}
--combined-json
abi,asm,ast,bin,bin-runtime,compact-format,devdoc,generated-sources,generated-sources-runtime,hashes,interface,metadata,opcodes,srcmap,srcmap-runtime,storage-layout,userdoc
"
$@
"
exit
1
first_solc
=
${
checkfile
}
break
done
if
[
-z
"
$first_solc
"
]
then
printf
-v
errortxt
'%s\n%s'
"
$errortxt
"
"solc: command not found."
errortxt
=
${
errortxt
#
${
newline
}}
fi
done
}
errortxt
=
find_first_solc
find_evm_version
if
[
-n
"
$errortxt
"
]
then
echo
"
$errortxt
"
>
&2
exit
1
fi
# not found
echo
"solc: command not found."
>
&2
exec
"
${
first_solc
}
"
--evm-version
=
"
$evmvers
"
--combined-json
abi,asm,ast,bin,bin-runtime,compact-format,devdoc,generated-sources,generated-sources-runtime,hashes,interface,metadata,opcodes,srcmap,srcmap-runtime,storage-layout,userdoc
"
$@
"
exit
1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment