Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lindlof committed Sep 27, 2020
0 parents commit 337a7b1
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib --features backtraces"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
contract.wasm.gz
252 changes: 252 additions & 0 deletions Cargo.lock

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

33 changes: 33 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "secret_rock_paper_scissors"
version = "0.1.0"
authors = ["Mikael Lindlof <[email protected]>"]
edition = "2018"

exclude = [
"contract.wasm",
"hash.txt",
]

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

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

[features]
default = []
backtraces = ["cosmwasm-std/backtraces"]

[dependencies]
cosmwasm-std = { git = "https://github.com/enigmampc/SecretNetwork", tag = "v1.0.0" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Mikael Lindlof

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Secret Rock Paper Scissors

Rock paper scissors game secret contract for Secret Network.

## Testing

Compile:
```
cargo wasm
```

Unit tests:
```
cargo unit-test
```

## Dev deployment

Compile optimized contract:
```
docker-compose -f docker-optimize.yaml up
```

Run dev node:
```
docker-compose up
```

Deploy contract:
```
docker exec -it srps_dev /bin/bash
secretcli tx compute store code/contract.wasm.gz --from a --gas auto --gas-adjustment 2 -y --keyring-backend test
secretcli tx compute instantiate 1 "{}" --from a --label "srps" -y --keyring-backend test
```
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.8"
services:
secretdev:
container_name: srps_dev
ports:
- '26657:26657'
- '26656:26656'
- '1317:1317'
volumes:
- '.:/root/code'
image: 'enigmampc/secret-network-sw-dev:v1.0.0'
6 changes: 6 additions & 0 deletions docker-optimize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.8'
services:
secret-contract-optimizer:
volumes:
- '.:/contract'
image: 'enigmampc/secret-contract-optimizer:1.0.3'
Loading

0 comments on commit 337a7b1

Please sign in to comment.