Skip to content

Commit

Permalink
Add more contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll committed Jul 9, 2024
1 parent c5bd28c commit 1ded5c2
Show file tree
Hide file tree
Showing 38 changed files with 4,063 additions and 350 deletions.
54 changes: 12 additions & 42 deletions scripts/git/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,29 @@ update_schemas_and_formatting() {
if [[ $CHANGES == *contracts/${contract}* ]]
then
echo "Changes in ${contract} contract"

cd ${REPO_ROOT}/smart-contracts/contracts/${contract}
cargo run --bin schema --features schema

# generate schemas
cargo schema
NEW_CHANGES=$(git diff --name-only origin/main)
if [[ $NEW_CHANGES == *contracts/${contract}/schema* ]]
if [[ $NEW_CHANGES == *schema/* ]]
then
git add schema
else
echo "No schema changes for ${contract}."
fi

# fix formatting
cargo fmt --all
cd ${REPO_ROOT}
NEW_CHANGES=$(git diff --name-only origin/main)
NEW_CHANGES=$(git diff --name-only origin/main --diff-filter=A)
git add $NEW_CHANGES
fi
}

update_schemas_and_formatting lst-dex-adapter-osmosis
update_schemas_and_formatting dex-router-osmosis

# CONTRACT_NAME=lst-dex-adapter-osmosis
# if [[ $CHANGES == *contracts/${CONTRACT_NAME}* ]]
# then
# echo "Changes in ${CONTRACT_NAME} contract"

# cd ${REPO_ROOT}/smart-contracts/contracts/${CONTRACT_NAME}
# cargo run --bin schema --features schema
# NEW_CHANGES=$(git diff --name-only origin/main)
# if [[ $CHANGES == *contracts/${CONTRACT_NAME}/schema* ]]
# then
# git add schema
# fi

# cargo fmt --all
# cd ${REPO_ROOT}
# git add $CHANGES
# fi

# CONTRACT_NAME=dex-router-osmosis
# if [[ $CHANGES == *contracts/${CONTRACT_NAME}* ]]
# then
# echo "Changes in ${CONTRACT_NAME} contract"

# cd ${REPO_ROOT}/smart-contracts/contracts/${CONTRACT_NAME}

# # update schemas
# cargo run --bin schema
# NEW_CHANGES=$(git diff --name-only origin/main)
# if [[ $CHANGES == *contracts/${CONTRACT_NAME}/schema* ]]
# then
# git add schema
# fi

# cargo fmt --all
# cd ${REPO_ROOT}
# git add $CHANGES
# fi
update_schemas_and_formatting token-burner
update_schemas_and_formatting cl-vault
update_schemas_and_formatting merkle-incentives
update_schemas_and_formatting range-middleware
26 changes: 3 additions & 23 deletions smart-contracts/contracts/cl-vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,22 @@ name = "cl-vault"
version = "0.3.0"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"cl_vault.wasm",
"hash.txt",
]

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

[lib]
crate-type = ["cdylib", "rlib"]

[profile.release]
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true
panic = 'abort'
rpath = false
[[bin]]
name = "schema"

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []

[package.metadata.scripts]
optimize = """docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.16.0
"""

[dependencies]
cosmwasm-std = { workspace = true }
osmosis-std = { workspace = true }
Expand All @@ -54,8 +36,6 @@ cw2 = { workspace = true }
num_enum = { workspace = true }
apollo-cw-asset = { workspace = true }
dex-router-osmosis = {workspace = true}

## todo update this in dex router code first as this has been deprecated
cw-vault-multi-standard = {git = "https://github.com/quasar-finance/cw-vault-standard", branch ="master", features = ["lockup", "force-unlock"]}

[dev-dependencies]
Expand Down
Loading

0 comments on commit 1ded5c2

Please sign in to comment.