Skip to content

Commit

Permalink
Merge pull request #19 from Cardinal-Cryptography/farming
Browse files Browse the repository at this point in the history
  • Loading branch information
deuszx authored Sep 7, 2023
2 parents 41935cb + c6e555d commit 5a39625
Show file tree
Hide file tree
Showing 11 changed files with 1,322 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ concurrency:
cancel-in-progress: true

on:
pull_request:
push:
branches:
- main
merge_group:

jobs:
Expand Down
146 changes: 130 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[workspace]
members = [
"uniswap-v2/contracts/**",
]
members = ["uniswap-v2/contracts/**", "farm/contracts"]

exclude = [
"e2e-tests",
"uniswap-v2/logics",
]
exclude = ["e2e-tests", "uniswap-v2/logics"]
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,33 @@ build-node-arm64:
build-node-x86_64:
@docker buildx build --pull --platform linux/amd64 -t aleph-onenode-chain-x86_64 --load docker

CONTRACTS = ./uniswap-v2/contracts
CONTRACT_PATHS := $(shell find $(CONTRACTS) -mindepth 1 -maxdepth 1 -type d)
UNI_CONTRACTS = ./uniswap-v2/contracts
UNI_CONTRACTS_PATHS := $(shell find $(UNI_CONTRACTS) -mindepth 1 -maxdepth 1 -type d)

FARM_CONTRACTS = ./farm
FARM_CONTRACTS_PATHS := $(shell find $(FARM_CONTRACTS) -mindepth 1 -maxdepth 1 -type d)

.PHONY: build-all
build-all: ## Builds all contracts.
@for d in $(CONTRACT_PATHS); do \
@for d in $(UNI_CONTRACTS_PATHS); do \
echo "Building $$d contract" ; \
cargo contract build --quiet --manifest-path $$d/Cargo.toml --release ; \
done
@for d in $(FARM_CONTRACTS_PATHS); do \
echo "Checking $$d" ; \
cargo contract build --quiet --manifest-path $$d/Cargo.toml --release ; \
done

.PHONY: check-all
check-all: ## Runs cargo checks and unit tests on all contracts.
@cargo check --quiet --all-targets --all-features --all
@cargo clippy --quiet --all-features -- --no-deps -D warnings
@cargo fmt --quiet --all --check
@for d in $(shell find $(CONTRACTS) -mindepth 1 -maxdepth 1 -type d); do \
@for d in $(UNI_CONTRACTS_PATHS); do \
echo "Checking $$d" ; \
cargo contract check --quiet --manifest-path $$d/Cargo.toml ; \
done
@for d in $(FARM_CONTRACTS_PATHS); do \
echo "Checking $$d" ; \
cargo contract check --quiet --manifest-path $$d/Cargo.toml ; \
done
Expand Down
40 changes: 40 additions & 0 deletions farm/contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "uniswap_v2_farm"
version = "0.1.0"
authors = ["Cardinal Cryptography"]
edition = "2021"

[dependencies]
ink = { version = "=4.3.0", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [
"derive",
] }
scale-info = { version = "2.3", default-features = false, features = [
"derive",
], optional = true }

openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.0", default-features = false }
primitive-types = { version = "=0.12.1", default-features = false, features = [
"codec",
] }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }

psp22-traits = { path = "../psp22-traits", default-features = false }

[lib]
path = "lib.rs"

[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
"psp22-traits/std",
"openbrush/std",
"primitive-types/std",
"primitive-types/scale-info",
"sp-arithmetic/std",
]
ink-as-dependency = []
Loading

0 comments on commit 5a39625

Please sign in to comment.