diff --git a/CONTRACTS.md b/CONTRACTS.md index 0d589102f..5344cbb95 100644 --- a/CONTRACTS.md +++ b/CONTRACTS.md @@ -6,11 +6,11 @@ the interfaces defined in `packages/cw*`. ## Creating a new contract Use [`cosmwasm-template`](https://github.com/CosmWasm/cosmwasm-template) as a -basis, in particular the `cosmwasm-plus` branch. +basis, in particular the `cw-plus` branch. ```bash cd contracts -cargo generate --git https://github.com/CosmWasm/cosmwasm-template.git --branch cosmwasm-plus --name PROJECT_NAME +cargo generate --git https://github.com/CosmWasm/cosmwasm-template.git --branch cw-plus --name PROJECT_NAME cd PROJECT_NAME rm -rf .git rm .gitignore diff --git a/PATTERNS.md b/PATTERNS.md index 26b3b0176..f925e9450 100644 --- a/PATTERNS.md +++ b/PATTERNS.md @@ -31,11 +31,11 @@ with some clever use of the existing system. The first case is where we want to do action A, then finish our processing. A clear example is in `cw20-staking`, where we want to withdraw all rewards from the validator, then reinvest them, as one atomic operation. -In this case, we simply [return 2 messages](https://github.com/CosmWasm/cosmwasm-plus/blob/master/contracts/cw20-staking/src/contract.rs#L383-L395), +In this case, we simply [return 2 messages](https://github.com/CosmWasm/cw-plus/blob/master/contracts/cw20-staking/src/contract.rs#L383-L395), the first one calling the staking module, and the second one calling a protected function on our own contract `_BondAllTokens`. At the beginning of `_BondAllTokens`, we ensure this is -[called by our own contract](https://github.com/CosmWasm/cosmwasm-plus/blob/master/contracts/cw20-staking/src/contract.rs#L408-L410) +[called by our own contract](https://github.com/CosmWasm/cw-plus/blob/master/contracts/cw20-staking/src/contract.rs#L408-L410) to keep this a private callback and not a public entry point. The second case is where we want to get a result from the call, such as @@ -136,11 +136,11 @@ registers on `cw4-group` to be informed of any changes to the voting set. This is essential to manage proper vote counts when the voting set changes while a proposal is open. -* [Definition of the hooks in cw4 spec](https://github.com/CosmWasm/cosmwasm-plus/blob/c5e8fc92c0412fecd6cdd951c2c0261aa3c9445a/packages/cw4/src/hook.rs) -* [Adding/removing hooks](https://github.com/CosmWasm/cosmwasm-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L156-L190) - which may be refactored into common code -* [Dispatching updates to all registered hooks](https://github.com/CosmWasm/cosmwasm-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L91-L98) -* [`cw3-flex-multisig` registers ExecuteMsg variant](https://github.com/CosmWasm/cosmwasm-plus/blob/0e58f7ebc24c8a16d27e04a0507bac2e11489d0b/contracts/cw3-flex-multisig/src/msg.rs#L126-L127) -* [`cw3-flex-multisig` updates state based on the hook](https://github.com/CosmWasm/cosmwasm-plus/blob/61f436c2203bde7770d9b13724e6548ba26615e7/contracts/cw3-flex-multisig/src/contract.rs#L276-L309) +* [Definition of the hooks in cw4 spec](https://github.com/CosmWasm/cw-plus/blob/c5e8fc92c0412fecd6cdd951c2c0261aa3c9445a/packages/cw4/src/hook.rs) +* [Adding/removing hooks](https://github.com/CosmWasm/cw-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L156-L190) - which may be refactored into common code +* [Dispatching updates to all registered hooks](https://github.com/CosmWasm/cw-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L91-L98) +* [`cw3-flex-multisig` registers ExecuteMsg variant](https://github.com/CosmWasm/cw-plus/blob/0e58f7ebc24c8a16d27e04a0507bac2e11489d0b/contracts/cw3-flex-multisig/src/msg.rs#L126-L127) +* [`cw3-flex-multisig` updates state based on the hook](https://github.com/CosmWasm/cw-plus/blob/61f436c2203bde7770d9b13724e6548ba26615e7/contracts/cw3-flex-multisig/src/contract.rs#L276-L309) ### Listeners @@ -177,7 +177,7 @@ He was just an admin briefly in the deploy script, so he could swap out the permissions once the other contracts were set up. As an example, we use this pattern when -[setting up the `cw3-flex-multisig` test cases](https://github.com/CosmWasm/cosmwasm-plus/blob/61f436c2203bde7770d9b13724e6548ba26615e7/contracts/cw3-flex-multisig/src/contract.rs#L572-L591). +[setting up the `cw3-flex-multisig` test cases](https://github.com/CosmWasm/cw-plus/blob/61f436c2203bde7770d9b13724e6548ba26615e7/contracts/cw3-flex-multisig/src/contract.rs#L572-L591). The multisig needs to know the group to query memberships, and the group needs to have a registered hook to the multisig to update it. We set them up as "OWNER" and then step down, leaving the contracts pointing to each other. diff --git a/README.md b/README.md index 3d74c9c43..862fd5b1f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CosmWasm Plus -[![CircleCI](https://circleci.com/gh/CosmWasm/cosmwasm-plus/tree/master.svg?style=shield)](https://circleci.com/gh/CosmWasm/cosmwasm-plus/tree/master) +[![CircleCI](https://circleci.com/gh/CosmWasm/cw-plus/tree/master.svg?style=shield)](https://circleci.com/gh/CosmWasm/cw-plus/tree/master) | Specification | Crates.io | Docs | | ---------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------| @@ -21,21 +21,21 @@ | Contracts | Download | Docs | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------| -| cw1-subkeys | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw1_subkeys.wasm) | [![Docs](https://docs.rs/cw1-subkeys/badge.svg)](https://docs.rs/cw1-subkeys) | -| cw1-whitelist | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw1_whitelist.wasm) | [![Docs](https://docs.rs/cw1-whitelist/badge.svg)](https://docs.rs/cw1-whitelist) | -| cw3-fixed-multisig | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw3_fixed_multisig.wasm) | [![Docs](https://docs.rs/cw3-fixed-multisig/badge.svg)](https://docs.rs/cw3-fixed-multisig) | -| cw3-flex-multisig | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw3_flex_multisig.wasm) | [![Docs](https://docs.rs/cw3-flex-multisig/badge.svg)](https://docs.rs/cw3-flex-multisig) | -| cw4-group | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw4_group.wasm) | [![Docs](https://docs.rs/cw4-group/badge.svg)](https://docs.rs/cw4-group) | -| cw4-stake | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw4_stake.wasm) | [![Docs](https://docs.rs/cw4-stake/badge.svg)](https://docs.rs/cw4-stake) | -| cw20-atomic-swap | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_atomic_swap.wasm) | [![Docs](https://docs.rs/cw20-atomic-swap/badge.svg)](https://docs.rs/cw20-atomic-swap) | -| cw20-base | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_base.wasm) | [![Docs](https://docs.rs/cw20-base/badge.svg)](https://docs.rs/cw20-base) | -| cw20-bonding | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_bonding.wasm) | [![Docs](https://docs.rs/cw20-bonding/badge.svg)](https://docs.rs/cw20-bonding) | -| cw20-escrow | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_escrow.wasm) | [![Docs](https://docs.rs/cw20-escrow/badge.svg)](https://docs.rs/cw20-escrow) | -| cw20-ics20 | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_ics20.wasm) | [![Docs](https://docs.rs/cw20-ics20/badge.svg)](https://docs.rs/cw20-ics20) | -| cw20-staking | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_staking.wasm) | [![Docs](https://docs.rs/cw20-staking/badge.svg)](https://docs.rs/cw20-staking) | -| cw20-merkle-airdrop | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw20_merkle_airdrop.wasm) | [![Docs](https://docs.rs/cw20-merkle-airdrop/badge.svg)](https://docs.rs/cw20-merkle-airdrop) | -| cw721-base | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw721_base.wasm) | [![Docs](https://docs.rs/cw721-base/badge.svg)](https://docs.rs/cw721-base) | -| cw1155-base | [Release v0.8.1](https://github.com/CosmWasm/cosmwasm-plus/releases/download/v0.8.1/cw1155_base.wasm) | [![Docs](https://docs.rs/cw1155-base/badge.svg)](https://docs.rs/cw1155-base) | +| cw1-subkeys | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw1_subkeys.wasm) | [![Docs](https://docs.rs/cw1-subkeys/badge.svg)](https://docs.rs/cw1-subkeys) | +| cw1-whitelist | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw1_whitelist.wasm) | [![Docs](https://docs.rs/cw1-whitelist/badge.svg)](https://docs.rs/cw1-whitelist) | +| cw3-fixed-multisig | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw3_fixed_multisig.wasm) | [![Docs](https://docs.rs/cw3-fixed-multisig/badge.svg)](https://docs.rs/cw3-fixed-multisig) | +| cw3-flex-multisig | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw3_flex_multisig.wasm) | [![Docs](https://docs.rs/cw3-flex-multisig/badge.svg)](https://docs.rs/cw3-flex-multisig) | +| cw4-group | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw4_group.wasm) | [![Docs](https://docs.rs/cw4-group/badge.svg)](https://docs.rs/cw4-group) | +| cw4-stake | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw4_stake.wasm) | [![Docs](https://docs.rs/cw4-stake/badge.svg)](https://docs.rs/cw4-stake) | +| cw20-atomic-swap | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_atomic_swap.wasm) | [![Docs](https://docs.rs/cw20-atomic-swap/badge.svg)](https://docs.rs/cw20-atomic-swap) | +| cw20-base | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_base.wasm) | [![Docs](https://docs.rs/cw20-base/badge.svg)](https://docs.rs/cw20-base) | +| cw20-bonding | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_bonding.wasm) | [![Docs](https://docs.rs/cw20-bonding/badge.svg)](https://docs.rs/cw20-bonding) | +| cw20-escrow | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_escrow.wasm) | [![Docs](https://docs.rs/cw20-escrow/badge.svg)](https://docs.rs/cw20-escrow) | +| cw20-ics20 | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_ics20.wasm) | [![Docs](https://docs.rs/cw20-ics20/badge.svg)](https://docs.rs/cw20-ics20) | +| cw20-staking | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_staking.wasm) | [![Docs](https://docs.rs/cw20-staking/badge.svg)](https://docs.rs/cw20-staking) | +| cw20-merkle-airdrop | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw20_merkle_airdrop.wasm) | [![Docs](https://docs.rs/cw20-merkle-airdrop/badge.svg)](https://docs.rs/cw20-merkle-airdrop) | +| cw721-base | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw721_base.wasm) | [![Docs](https://docs.rs/cw721-base/badge.svg)](https://docs.rs/cw721-base) | +| cw1155-base | [Release v0.8.1](https://github.com/CosmWasm/cw-plus/releases/download/v0.8.1/cw1155_base.wasm) | [![Docs](https://docs.rs/cw1155-base/badge.svg)](https://docs.rs/cw1155-base) | This is a collection of specification and contracts designed for use on real networks. They are designed not just as examples, but to @@ -76,8 +76,8 @@ can handle many different fungible tokens, as long as they all adhere to the cw20 specification. If you have ideas for new specifications or want to make enhancements to -existing spec, please [raise an issue](https://github.com/CosmWasm/cosmwasm-plus/issues) -or [create a pull request](https://github.com/CosmWasm/cosmwasm-plus/pulls) on this repo. +existing spec, please [raise an issue](https://github.com/CosmWasm/cw-plus/issues) +or [create a pull request](https://github.com/CosmWasm/cw-plus/pulls) on this repo. ## Contracts diff --git a/contracts/cw1-subkeys/README.md b/contracts/cw1-subkeys/README.md index 488f7abd9..dc7d3164a 100644 --- a/contracts/cw1-subkeys/README.md +++ b/contracts/cw1-subkeys/README.md @@ -90,4 +90,4 @@ sha256sum cw1_subkeys.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw1-whitelist/README.md b/contracts/cw1-whitelist/README.md index 47ffbc958..ca4f9597f 100644 --- a/contracts/cw1-whitelist/README.md +++ b/contracts/cw1-whitelist/README.md @@ -41,4 +41,4 @@ sha256sum cw1_whitelist.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw20-atomic-swap/README.md b/contracts/cw20-atomic-swap/README.md index 8a112f957..3bfa5cb16 100644 --- a/contracts/cw20-atomic-swap/README.md +++ b/contracts/cw20-atomic-swap/README.md @@ -45,4 +45,4 @@ sha256sum cw20_atomic_swap.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw20-base/README.md b/contracts/cw20-base/README.md index 975a9cd6b..328b26742 100644 --- a/contracts/cw20-base/README.md +++ b/contracts/cw20-base/README.md @@ -29,7 +29,7 @@ sha256sum cw20_base.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. ## Importing this contract diff --git a/contracts/cw20-escrow/README.md b/contracts/cw20-escrow/README.md index da8210476..3b04148ac 100644 --- a/contracts/cw20-escrow/README.md +++ b/contracts/cw20-escrow/README.md @@ -43,4 +43,4 @@ sha256sum cw20_escrow.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw20-ics20/README.md b/contracts/cw20-ics20/README.md index 21baf6f2a..3feae9a19 100644 --- a/contracts/cw20-ics20/README.md +++ b/contracts/cw20-ics20/README.md @@ -18,7 +18,7 @@ unordered channels for the version negotiation. Once established, it manages a l [ts-relayer](https://github.com/confio/ts-relayer) `ibc-setup ics20` command to create these. After there is at least one channel, you can send any CW20 token to this contract via the -[receiver pattern](https://github.com/CosmWasm/cosmwasm-plus/blob/master/packages/cw20/README.md#receiver). +[receiver pattern](https://github.com/CosmWasm/cw-plus/blob/master/packages/cw20/README.md#receiver). The receive message must contain the channel to send over and the remote address to send to. It may optionally include a custom timeout. diff --git a/contracts/cw3-fixed-multisig/README.md b/contracts/cw3-fixed-multisig/README.md index 336af8673..6fabd6a61 100644 --- a/contracts/cw3-fixed-multisig/README.md +++ b/contracts/cw3-fixed-multisig/README.md @@ -62,4 +62,4 @@ sha256sum cw3_fixed_multisig.wasm ``` Or for a production-ready (optimized) build, run a build command in the -repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw3-flex-multisig/README.md b/contracts/cw3-flex-multisig/README.md index 0a298313b..8ca79ccb6 100644 --- a/contracts/cw3-flex-multisig/README.md +++ b/contracts/cw3-flex-multisig/README.md @@ -86,4 +86,4 @@ sha256sum cw3_fixed_multisig.wasm ``` Or for a production-ready (optimized) build, run a build command in -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. diff --git a/contracts/cw721-base/README.md b/contracts/cw721-base/README.md index 90ade082a..70e7d84b0 100644 --- a/contracts/cw721-base/README.md +++ b/contracts/cw721-base/README.md @@ -9,7 +9,7 @@ Implements: - [x] CW721 Base - [x] Metadata extension -- [ ] Enumerable extension (AllTokens done, but not Tokens - requires [#81](https://github.com/CosmWasm/cosmwasm-plus/issues/81)) +- [ ] Enumerable extension (AllTokens done, but not Tokens - requires [#81](https://github.com/CosmWasm/cw-plus/issues/81)) ## Implementation @@ -47,7 +47,7 @@ sha256sum cw20_base.wasm ``` Or for a production-ready (optimized) build, run a build command in the -the repository root: https://github.com/CosmWasm/cosmwasm-plus#compiling. +the repository root: https://github.com/CosmWasm/cw-plus#compiling. ## Importing this contract diff --git a/packages/multi-test/README.md b/packages/multi-test/README.md index 0ecfff56b..b0d659b69 100644 --- a/packages/multi-test/README.md +++ b/packages/multi-test/README.md @@ -2,10 +2,10 @@ Warning: **Alpha Software** Designed for internal use only. -This is used for testing cosmwasm-plus contracts, we have no API +This is used for testing cw-plus contracts, we have no API stability currently. We are working on refactoring it and will expose a more refined version for use in other contracts. (Ideally -in cosmwasm-plus 0.9 or 0.10). +in cw-plus 0.9 or 0.10). **Use at your own risk** diff --git a/packages/storage-plus/README.md b/packages/storage-plus/README.md index 421f14d59..f89ab2f85 100644 --- a/packages/storage-plus/README.md +++ b/packages/storage-plus/README.md @@ -6,7 +6,7 @@ more powerful and easy to use interfaces. Here are those interfaces. **Status: experimental** -You currently should not be using this crate outside of the `cosmwasm-plus` +You currently should not be using this crate outside of the `cw-plus` repo. This is a first draft of many types. We will update the status after they have been used more heavily and the interfaces stabilized. @@ -386,7 +386,7 @@ fn demo() -> StdResult<()> { ## IndexedMap -In cosmwasm-plus, there's currently one example of `IndexedMap` usage, in the `cw721-base` contract. +In cw-plus, there's currently one example of `IndexedMap` usage, in the `cw721-base` contract. Let's use it to illustrate `IndexedMap` definition and usage. ### Definition