Skip to content

Commit

Permalink
Merge pull request #55 from securesecrets/dev
Browse files Browse the repository at this point in the history
Pre-MVP Release
  • Loading branch information
FloppyDisck authored Aug 25, 2021
2 parents 1f30218 + 5549cfd commit 23f37ba
Show file tree
Hide file tree
Showing 43 changed files with 1,399 additions and 590 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ contracts/hackatom/hash.txt

# Auto-gen
.cargo-ok

*.pyc
__pycache__/
163 changes: 163 additions & 0 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[workspace]
members = ["contracts/mint","contracts/oracle", "packages/shade_protocol"]
members = [
"packages/shade_protocol",
"contracts/mint",
"contracts/oracle",
"contracts/mock_band",
]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
| Contract | Reference | Description |
| --------------------------- | --------------------------------- | ------------------------------------- |
| [`mint`](./contracts/mint) | [doc](./contracts/mint/README.md) | Handles asset burning and silk minting|
| [`oracle`](./contracts/oracle) | [doc](./contracts/oracle/README.md) | Handles asset price queries |

## Development

## Development Environment
Instlal docker for local envirnment

Source from [testner](https://build.scrt.network/dev/quickstart.html#setup-the-local-developer-testnet)
Source from [testnet](https://build.scrt.network/dev/quickstart.html#setup-the-local-developer-testnet)

```
docker run -it --rm -p 26657:26657 -p 26656:26656 -p 1337:1337 -v $(pwd):/root/code --name secretdev enigmampc/secret-network-sw-dev
Expand Down Expand Up @@ -64,4 +65,7 @@ bash ./compile-contracts.sh

### Testing

You can optionally run extended tests inside a private testnet using the [contract tester](./contracts/compiled/contract_tester.py)
You can optionally run extended tests using the [tester](contracts/compiled/tester.py)

To run a test deployment on a public testnet you can run ```tester.py --testnet public```.
For the private testnet you can run ```tester.py --testnet private```.
8 changes: 7 additions & 1 deletion compile-contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
root_dir=$(git rev-parse --show-toplevel)
contracts_dir="${root_dir}/contracts"
compiled_dir="${contracts_dir}/compiled"
checksum_dir="${compiled_dir}/checksum"

compile_contract() {
# Run tests
(cd ${contracts_dir}/$1; cargo unit-test)
(cd ${contracts_dir}/$1; cargo integration-test)
#(cd ${contracts_dir}/$1; cargo integration-test)
(cd ${compiled_dir}; rm $1.wasm.gz)
(cd ${contracts_dir}; cargo build --release --target wasm32-unknown-unknown --locked)
wasm-opt -Oz ./target/wasm32-unknown-unknown/release/$1.wasm -o ./$1.wasm
echo $(md5sum $1.wasm | cut -f 1 -d " ") >> ${checksum_dir}/$1.txt
cat ./$1.wasm | gzip -n -9 > ${compiled_dir}/$1.wasm.gz
rm -f ./$1.wasm
}

# There should be a cleaner way to do this
rm -r ${checksum_dir}
mkdir ${checksum_dir}
compile_contract "mint"
compile_contract "oracle"
compile_contract "mock_band"
Empty file removed contracts/compiled/__init__.py
Empty file.
1 change: 1 addition & 0 deletions contracts/compiled/checksum/mint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5837fae4e377ec630732b06ce018adba
1 change: 1 addition & 0 deletions contracts/compiled/checksum/mock_band.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
581bb67ce7144b7993190b46ece45893
1 change: 1 addition & 0 deletions contracts/compiled/checksum/oracle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ef8dc00f91dbedbff4f39fcb7161146c
63 changes: 0 additions & 63 deletions contracts/compiled/contract_tester.py

This file was deleted.

Empty file.
Loading

0 comments on commit 23f37ba

Please sign in to comment.