Skip to content

Commit

Permalink
Merge pull request #160 from primitivefinance/colin/bindings-cleanup
Browse files Browse the repository at this point in the history
Colin/bindings cleanup
  • Loading branch information
0xJepsen authored Mar 23, 2023
2 parents f41be63 + 3adbc14 commit f129ebc
Show file tree
Hide file tree
Showing 45 changed files with 130,277 additions and 119,418 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[workspace]
members = [
"crates/bindings",
"crates/bindings_old",
# "crates/clairvoyance",
# "crates/architect",
"crates/cli",
"crates/utils",
"crates/simulate"
]

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ cargo doc --workspace --no-deps --open
```
This will generate and open the docs in your browser. From there, you can look at the documentation for each crate in the Arbiter workspace.

## Including More Contracts

In the `lib/` folder you can add additional smart contracts or regenerate Rust bindings. To do so, run the following from the Arbiter root directory:

```
./bind.sh
```

At the moment, this only builds the bindings for the contracts in the `lib/arbmod/contracts/` and `lib/portfolio/contracts`. You can of course add an additional directory of contracts in `lib/`. Just be sure to include it when you generate bindings!

## Contributing

See our [Contributing Guidelines](https://github.com/primitivefinance/arbiter/blob/main/.github/CONTRIBUTING.md)
23 changes: 21 additions & 2 deletions crates/bindings_old/LICENSE → bind.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
Apache License
#!/bin/bash

forge bind -C lib/arbmod/contracts -b crates/bindings/ --crate-name bindings --overwrite --single-file
echo "Generated bindings for arbmod"
forge bind -C lib/portfolio/contracts -b crates/bindings/ --crate-name bindings --overwrite --single-file
echo "Generated bindings for portfolio"

#!/bin/bash

# Define the input and output files
input_file="crates/bindings/Cargo.toml"
output_file="crates/bindings/Cargo-updated.toml"

# Use sed to search and replace a string in the input file
sed 's/git = "https:\/\/github.com\/gakonst\/ethers-rs"/version = "=2.0.0"/g' "$input_file" > "$output_file"
mv "$output_file" "$input_file"



echo " Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -198,4 +217,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License." > crates/bindings/LICENSE
4 changes: 1 addition & 3 deletions crates/bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

ethers = "=2.0.0"
serde_json = "1.0.79"
ethers = { version = "=2.0.0", default-features = false, features = ["abigen"] }
38 changes: 19 additions & 19 deletions crates/bindings/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,60 @@

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
License shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
Licensor shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
Legal Entity shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
control means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
You (or Your) shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
Source form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
Object form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Work shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
Derivative Works shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
Contribution shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
the copyright owner. For the purposes of this definition, submitted
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
designated in writing by the copyright owner as Not a Contribution.

"Contributor" shall mean Licensor and any individual or Legal Entity
Contributor shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

Expand Down Expand Up @@ -103,7 +103,7 @@
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
(d) If the Work includes a NOTICE text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
Expand Down Expand Up @@ -142,7 +142,7 @@

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
Contributor provides its Contributions) on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
Expand Down Expand Up @@ -178,24 +178,24 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets []
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
same printed page as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
63 changes: 0 additions & 63 deletions crates/bindings/src/account_lib.rs

This file was deleted.

Loading

0 comments on commit f129ebc

Please sign in to comment.