-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start cw20-ics20 as copy of cw20-escrow
- Loading branch information
Showing
21 changed files
with
1,689 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[alias] | ||
wasm = "build --release --target wasm32-unknown-unknown" | ||
wasm-debug = "build --target wasm32-unknown-unknown" | ||
unit-test = "test --lib" | ||
integration-test = "test --test integration" | ||
schema = "run --example schema" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "cw20-ics20" | ||
version = "0.5.0" | ||
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>"] | ||
edition = "2018" | ||
description = "IBC Enabled contracts that receives CW20 tokens and sends them over ICS20 to a remote chain" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/CosmWasm/cosmwasm-plus" | ||
homepage = "https://cosmwasm.com" | ||
documentation = "https://docs.cosmwasm.com" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
backtraces = ["cosmwasm-std/backtraces"] | ||
# use library feature to disable all init/handle/query exports | ||
library = [] | ||
|
||
[dependencies] | ||
cw0 = { path = "../../packages/cw0", version = "0.5.0" } | ||
cw2 = { path = "../../packages/cw2", version = "0.5.0" } | ||
cw20 = { path = "../../packages/cw20", version = "0.5.0" } | ||
cosmwasm-std = { version = "0.14.0-alpha2", features = ["iterator"] } | ||
cosmwasm-storage = { version = "0.14.0-alpha2", features = ["iterator"] } | ||
schemars = "0.7" | ||
serde = { version = "1.0.103", default-features = false, features = ["derive"] } | ||
thiserror = { version = "1.0.20" } | ||
|
||
[dev-dependencies] | ||
cosmwasm-schema = { version = "0.14.0-alpha2" } | ||
cw-multi-test = { path = "../../packages/multi-test", version = "0.5.0" } | ||
cw20-base = { path = "../cw20-base", version = "0.5.0", features = ["library"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CW20-ICS20: IBC Enabled contracts that receives CW20 tokens and sends them over ICS20 to a remote chain | ||
Copyright (C) 2020 Confio OÜ | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# CW20 ICS20 | ||
|
||
TODO: Define this protocol | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::env::current_dir; | ||
use std::fs::create_dir_all; | ||
|
||
use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; | ||
|
||
use cw20_ics20::msg::{DetailsResponse, HandleMsg, InitMsg, ListResponse, QueryMsg, ReceiveMsg}; | ||
|
||
fn main() { | ||
let mut out_dir = current_dir().unwrap(); | ||
out_dir.push("schema"); | ||
create_dir_all(&out_dir).unwrap(); | ||
remove_schemas(&out_dir).unwrap(); | ||
|
||
export_schema(&schema_for!(InitMsg), &out_dir); | ||
export_schema(&schema_for!(HandleMsg), &out_dir); | ||
export_schema(&schema_for!(QueryMsg), &out_dir); | ||
export_schema(&schema_for!(ReceiveMsg), &out_dir); | ||
export_schema(&schema_for!(DetailsResponse), &out_dir); | ||
export_schema(&schema_for!(ListResponse), &out_dir); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "DetailsResponse", | ||
"type": "object", | ||
"required": [ | ||
"arbiter", | ||
"cw20_balance", | ||
"cw20_whitelist", | ||
"id", | ||
"native_balance", | ||
"recipient", | ||
"source" | ||
], | ||
"properties": { | ||
"arbiter": { | ||
"description": "arbiter can decide to approve or refund the escrow", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/HumanAddr" | ||
} | ||
] | ||
}, | ||
"cw20_balance": { | ||
"description": "Balance in cw20 tokens", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Cw20CoinHuman" | ||
} | ||
}, | ||
"cw20_whitelist": { | ||
"description": "Whitelisted cw20 tokens", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/HumanAddr" | ||
} | ||
}, | ||
"end_height": { | ||
"description": "When end height set and block height exceeds this value, the escrow is expired. Once an escrow is expired, it can be returned to the original funder (via \"refund\").", | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"end_time": { | ||
"description": "When end time (in seconds since epoch 00:00:00 UTC on 1 January 1970) is set and block time exceeds this value, the escrow is expired. Once an escrow is expired, it can be returned to the original funder (via \"refund\").", | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"id": { | ||
"description": "id of this escrow", | ||
"type": "string" | ||
}, | ||
"native_balance": { | ||
"description": "Balance in native tokens", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Coin" | ||
} | ||
}, | ||
"recipient": { | ||
"description": "if approved, funds go to the recipient", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/HumanAddr" | ||
} | ||
] | ||
}, | ||
"source": { | ||
"description": "if refunded, funds go to the source", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/HumanAddr" | ||
} | ||
] | ||
} | ||
}, | ||
"definitions": { | ||
"Coin": { | ||
"type": "object", | ||
"required": [ | ||
"amount", | ||
"denom" | ||
], | ||
"properties": { | ||
"amount": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"denom": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"Cw20CoinHuman": { | ||
"type": "object", | ||
"required": [ | ||
"address", | ||
"amount" | ||
], | ||
"properties": { | ||
"address": { | ||
"$ref": "#/definitions/HumanAddr" | ||
}, | ||
"amount": { | ||
"$ref": "#/definitions/Uint128" | ||
} | ||
} | ||
}, | ||
"HumanAddr": { | ||
"type": "string" | ||
}, | ||
"Uint128": { | ||
"type": "string" | ||
} | ||
} | ||
} |
Oops, something went wrong.