Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6bbbb985
Commit
6bbbb985
authored
Jun 30, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-bindings: better logging, absolute paths
parent
9ad235e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
Makefile
op-bindings/Makefile
+4
-3
main.go
op-bindings/gen/main.go
+5
-5
No files found.
op-bindings/Makefile
View file @
6bbbb985
SHELL
:=
/bin/bash
pkg
:=
bindings
contracts-dir
:=
../packages/contracts-bedrock
monorepo-base
:=
$(
shell
dirname
$
(
realpath
.
))
contracts-dir
:=
$
(
monorepo-base
)
/packages/contracts-bedrock
all
:
version mkdir bindings
...
...
@@ -17,12 +18,12 @@ bindings: compile bindings-build
bindings-build
:
go run ./gen/main.go
\
-forge-artifacts
../packages/contracts-bedrock
/forge-artifacts
\
-forge-artifacts
$
(
contracts-dir
)
/forge-artifacts
\
-out
./bindings
\
-contracts
./artifacts.json
\
-source-maps
MIPS,PreimageOracle
\
-package
$(pkg)
\
-monorepo-base
$(
shell
dirname
$
(
realpath
.
)
)
-monorepo-base
$
(
monorepo-base
)
mkdir
:
mkdir
-p
$(pkg)
...
...
op-bindings/gen/main.go
View file @
6bbbb985
...
...
@@ -105,21 +105,21 @@ func main() {
for
_
,
name
:=
range
contracts
{
log
.
Printf
(
"generating code for %s
\n
"
,
name
)
forgeArtifactData
,
err
:=
os
.
ReadFile
(
path
.
Join
(
f
.
ForgeArtifacts
,
name
+
".sol"
,
name
+
".json"
))
artifactPath
:=
path
.
Join
(
f
.
ForgeArtifacts
,
name
+
".sol"
,
name
+
".json"
)
forgeArtifactData
,
err
:=
os
.
ReadFile
(
artifactPath
)
if
errors
.
Is
(
err
,
os
.
ErrNotExist
)
{
forgeArtifactData
,
err
=
os
.
ReadFile
(
artifactPaths
[
name
])
artifactPath
=
artifactPaths
[
name
]
forgeArtifactData
,
err
=
os
.
ReadFile
(
artifactPath
)
if
errors
.
Is
(
err
,
os
.
ErrNotExist
)
{
log
.
Fatalf
(
"cannot find forge-artifact of %q
\n
"
,
name
)
}
}
log
.
Printf
(
"using forge-artifact %s
\n
"
,
artifactPath
)
var
artifact
foundry
.
Artifact
if
err
:=
json
.
Unmarshal
(
forgeArtifactData
,
&
artifact
);
err
!=
nil
{
log
.
Fatalf
(
"failed to parse forge artifact of %q: %v
\n
"
,
name
,
err
)
}
if
err
!=
nil
{
log
.
Fatalf
(
"error reading storage layout %s: %v
\n
"
,
name
,
err
)
}
rawAbi
:=
artifact
.
Abi
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment