Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move contracts/arbiter to arbmod repository + Minor fixes #368

Merged
merged 23 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Cargo.lock
*.csv

.DS_Store
# /contracts/*
# /contracts/*
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[submodule "contracts/portfolio"]
path = contracts/portfolio
url = https://github.com/primitivefinance/portfolio
branch = main
[submodule "contracts/v2-core"]
path = contracts/v2-core
url = https://github.com/Uniswap/v2-core
Expand All @@ -28,3 +29,6 @@
path = contracts/solidity-lib
url = https://github.com/Uniswap/solidity-lib
branch = v2.1.0
[submodule "contracts/arbmod"]
path = contracts/arbmod
url = https://github.com/primitivefinance/arbmod
17 changes: 10 additions & 7 deletions bind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@ forge install https://github.com/gnosis/canonical-weth --no-commit
forge install https://github.com/Uniswap/v2-core --no-commit
forge install https://github.com/Uniswap/v2-periphery --no-commit
forge install https://github.com/Uniswap/solidity-lib --no-commit
forge install https://github.com/primitivefinance/arbmod --no-commit

# Edit the init code hash used in the contracts/v2-periphery/contracts/libraries/UniswapV2Library.sol file on line 24.
sed -i '' 's/96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f/4fe5997d67f80818ff0b53bc5a01b97fefcdd789b0a7926797f623873e7728c9/g' contracts/v2-periphery/contracts/libraries/UniswapV2Library.sol
TARGET="contracts/v2-periphery/contracts/libraries/UniswapV2Library.sol"
CODEHASH="s/7fb0ae3175f4aef679d8e5eec91e7e16de3a6de15862774e2485db47122050f5/74ab6266490e96629ce06b06feb6f74a53755463f6025d31c365adb67550f3dc/g"

sed -i.bak -e ${CODEHASH} -- "${TARGET}" &&
rm -- "${TARGET}.bak"

forge bind --skip "^UniswapV3.*" -C contracts/v3-core/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for v3-core"
forge bind -C contracts/portfolio/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for portfolio"
forge bind -C contracts/canonical-weth/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for canonical-weth"
forge bind -C contracts/arbiter/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for arbiter contracts"
forge bind -C contracts/v2-core/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for v2-core"
forge bind -C contracts/v2-periphery/contracts --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for v2-periphery"
forge bind -C contracts/arbmod/src --revert-strings debug -b lib/bindings/ --crate-name bindings --overwrite
echo "Generated bindings for arbmod"

rm -f lib/bindings/src/mock_time_uniswap_v3_pool_deployer.rs


#!/bin/bash
# Edit the init code hash used in the contracts/v2-periphery/contracts/libraries/UniswapV2Library.sol file on line 24.

# Define the input and output files
input_file="lib/bindings/Cargo.toml"
Expand Down Expand Up @@ -238,4 +241,4 @@ echo " Apache License
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." > lib/bindings/LICENSE
limitations under the License." > lib/bindings/LICENSE
49 changes: 0 additions & 49 deletions contracts/arbiter/contracts/ArbiterMath.sol

This file was deleted.

23 changes: 0 additions & 23 deletions contracts/arbiter/contracts/ArbiterToken.sol

This file was deleted.

63 changes: 0 additions & 63 deletions contracts/arbiter/contracts/LiquidExchange.sol

This file was deleted.

20 changes: 0 additions & 20 deletions contracts/arbiter/contracts/writer.sol

This file was deleted.

1 change: 1 addition & 0 deletions contracts/arbmod
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we switch from the arbiter contracts to using the arbmod submodule, is that directory up to date? We have all the same contracts in both

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i updated it

Submodule arbmod added at c6a76c
1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ remappings = [
'@uniswap/lib/=contracts/solidity-lib/',
'@uniswap/v2-core/=contracts/v2-core/',
'@uniswap/v2-periphery/=contracts/v2-periphery/',

]
4 changes: 2 additions & 2 deletions lib/bindings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "bindings"
version = "0.2.0"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ethers = { version = "2.0.4", default-features = false, features = ["abigen"] }
ethers = { version = "2", default-features = false, features = ["abigen"] }
19 changes: 13 additions & 6 deletions lib/bindings/src/account_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ pub use account_lib::*;
non_camel_case_types
)]
pub mod account_lib {
#[rustfmt::skip]
const __ABI: &str = "[]";
#[allow(deprecated)]
fn __abi() -> ::ethers::core::abi::Abi {
::ethers::core::abi::ethabi::Contract {
constructor: ::core::option::Option::None,
functions: ::std::collections::BTreeMap::new(),
events: ::std::collections::BTreeMap::new(),
errors: ::std::collections::BTreeMap::new(),
receive: false,
fallback: false,
}
}
///The parsed JSON ABI of the contract.
pub static ACCOUNTLIB_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(|| {
::ethers::core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid")
});
::ethers::contract::Lazy::new(__abi);
pub struct AccountLib<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for AccountLib<M> {
fn clone(&self) -> Self {
Expand All @@ -36,7 +43,7 @@ pub mod account_lib {
}
impl<M> ::core::fmt::Debug for AccountLib<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(AccountLib))
f.debug_tuple(::core::stringify!(AccountLib))
.field(&self.address())
.finish()
}
Expand Down
Loading