diff --git a/.circleci/config.yml b/.circleci/config.yml index 2aa0843fc..86971a51d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ workflows: version: 2 test: jobs: - - contract_atomic_swap + - contract_cw20_atomic_swap - contract_cw1_subkeys - contract_cw1_whitelist - contract_cw20_base @@ -26,10 +26,10 @@ workflows: ignore: /.*/ jobs: - contract_atomic_swap: + contract_cw20_atomic_swap: docker: - image: rust:1.44.1 - working_directory: ~/project/contracts/atomic-swap + working_directory: ~/project/contracts/cw20-atomic-swap steps: - checkout: path: ~/project @@ -38,7 +38,7 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-atomic-swap-rust:1.44.1-{{ checksum "~/project/Cargo.lock" }} + - cargocache-cw20-atomic-swap-rust:1.44.1-{{ checksum "~/project/Cargo.lock" }} - run: name: Add wasm32 target command: rustup target add wasm32-unknown-unknown @@ -65,7 +65,7 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-atomic-swap-rust:1.44.1-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-cw20-atomic-swap-rust:1.44.1-{{ checksum "~/project/Cargo.lock" }} contract_cw1_subkeys: docker: diff --git a/Cargo.lock b/Cargo.lock index df6dbf471..85f1898e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,23 +27,6 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -[[package]] -name = "atomic-swap" -version = "0.1.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cosmwasm-vm", - "cw2", - "cw20", - "hex 0.3.2", - "schemars", - "serde", - "sha2 0.8.2", - "snafu", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -275,6 +258,23 @@ dependencies = [ "serde", ] +[[package]] +name = "cw20-atomic-swap" +version = "0.1.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-storage", + "cosmwasm-vm", + "cw2", + "cw20", + "hex 0.3.2", + "schemars", + "serde", + "sha2 0.8.2", + "snafu", +] + [[package]] name = "cw20-base" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index e35833aba..7a1649c04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = ["packages/*", "contracts/*"] -[profile.release.package.atomic-swap] +[profile.release.package.cw20-atomic-swap] opt-level = 3 debug = false debug-assertions = false diff --git a/contracts/atomic-swap/.cargo/config b/contracts/cw20-atomic-swap/.cargo/config similarity index 100% rename from contracts/atomic-swap/.cargo/config rename to contracts/cw20-atomic-swap/.cargo/config diff --git a/contracts/atomic-swap/Cargo.toml b/contracts/cw20-atomic-swap/Cargo.toml similarity index 97% rename from contracts/atomic-swap/Cargo.toml rename to contracts/cw20-atomic-swap/Cargo.toml index c19b5615c..32430a5e7 100644 --- a/contracts/atomic-swap/Cargo.toml +++ b/contracts/cw20-atomic-swap/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "atomic-swap" +name = "cw20-atomic-swap" version = "0.1.0" authors = ["Mauro Lacy "] edition = "2018" diff --git a/contracts/atomic-swap/NOTICE b/contracts/cw20-atomic-swap/NOTICE similarity index 100% rename from contracts/atomic-swap/NOTICE rename to contracts/cw20-atomic-swap/NOTICE diff --git a/contracts/atomic-swap/README.md b/contracts/cw20-atomic-swap/README.md similarity index 89% rename from contracts/atomic-swap/README.md rename to contracts/cw20-atomic-swap/README.md index bff200b1f..36597a424 100644 --- a/contracts/atomic-swap/README.md +++ b/contracts/cw20-atomic-swap/README.md @@ -39,9 +39,9 @@ Once you are happy with the content, you can compile it to wasm via: ``` RUSTFLAGS='-C link-arg=-s' cargo wasm -cp ../../target/wasm32-unknown-unknown/release/atomic_swap.wasm . -ls -l atomic_swap.wasm -sha256sum atomic_swap.wasm +cp ../../target/wasm32-unknown-unknown/release/cw20_atomic_swap.wasm . +ls -l cw20_atomic_swap.wasm +sha256sum cw20_atomic_swap.wasm ``` Or for a production-ready (compressed) build, run the following from the @@ -51,6 +51,6 @@ repository root (not currently working with this monorepo...) docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="cosmwasm_plus_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.9.0 ./contracts/atomic-swap -mv contract.wasm atomic_swap.wasm + cosmwasm/rust-optimizer:0.9.0 ./contracts/cw20-atomic-swap +mv contract.wasm cw20_atomic_swap.wasm ``` diff --git a/contracts/atomic-swap/examples/schema.rs b/contracts/cw20-atomic-swap/examples/schema.rs similarity index 100% rename from contracts/atomic-swap/examples/schema.rs rename to contracts/cw20-atomic-swap/examples/schema.rs diff --git a/contracts/atomic-swap/schema/handle_msg.json b/contracts/cw20-atomic-swap/schema/handle_msg.json similarity index 100% rename from contracts/atomic-swap/schema/handle_msg.json rename to contracts/cw20-atomic-swap/schema/handle_msg.json diff --git a/contracts/atomic-swap/schema/init_msg.json b/contracts/cw20-atomic-swap/schema/init_msg.json similarity index 100% rename from contracts/atomic-swap/schema/init_msg.json rename to contracts/cw20-atomic-swap/schema/init_msg.json diff --git a/contracts/atomic-swap/src/contract.rs b/contracts/cw20-atomic-swap/src/contract.rs similarity index 99% rename from contracts/atomic-swap/src/contract.rs rename to contracts/cw20-atomic-swap/src/contract.rs index 9cf42dc25..834b05fa2 100644 --- a/contracts/atomic-swap/src/contract.rs +++ b/contracts/cw20-atomic-swap/src/contract.rs @@ -12,7 +12,7 @@ use crate::msg::{ use crate::state::{all_swap_ids, atomic_swaps, atomic_swaps_read, AtomicSwap}; // Version info, for migration info -const CONTRACT_NAME: &str = "crates.io:atomic-swap"; +const CONTRACT_NAME: &str = "crates.io:cw20-atomic-swap"; const CONTRACT_VERSION: &str = "v0.1.0"; pub fn init( diff --git a/contracts/atomic-swap/src/lib.rs b/contracts/cw20-atomic-swap/src/lib.rs similarity index 100% rename from contracts/atomic-swap/src/lib.rs rename to contracts/cw20-atomic-swap/src/lib.rs diff --git a/contracts/atomic-swap/src/msg.rs b/contracts/cw20-atomic-swap/src/msg.rs similarity index 100% rename from contracts/atomic-swap/src/msg.rs rename to contracts/cw20-atomic-swap/src/msg.rs diff --git a/contracts/atomic-swap/src/state.rs b/contracts/cw20-atomic-swap/src/state.rs similarity index 100% rename from contracts/atomic-swap/src/state.rs rename to contracts/cw20-atomic-swap/src/state.rs diff --git a/contracts/atomic-swap/tests/integration.rs b/contracts/cw20-atomic-swap/tests/integration.rs similarity index 100% rename from contracts/atomic-swap/tests/integration.rs rename to contracts/cw20-atomic-swap/tests/integration.rs