├── .devcontainer ├── Dockerfile ├── devcontainer.json └── library-scripts │ ├── README.md │ ├── common-debian.sh │ ├── go-debian.sh │ ├── rust-debian.sh │ └── sgx-debian.sh ├── .dockerignore ├── .env.local ├── .github ├── CODEOWNERS ├── actions │ └── check-objdump │ │ ├── README.md │ │ ├── action.yml │ │ ├── dist │ │ ├── 37.index.js │ │ ├── index.js │ │ └── package.json │ │ ├── index.js │ │ ├── package-lock.json │ │ └── package.json ├── dependabot.yml └── workflows │ ├── ci.yaml │ ├── codeql-analysis.yml │ ├── go-lint.yml │ └── release.yaml ├── .gitignore ├── .gitmodules ├── .gitpod.yml ├── .golangci.yml ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── app ├── ante.go ├── app.go ├── config.go ├── export.go ├── genesis.go ├── keepers │ └── keepers.go ├── migrations │ ├── migrate.go │ └── v170 │ │ └── migrate.go ├── modules.go └── upgrades │ ├── types.go │ ├── v1.10 │ └── upgrade.go │ ├── v1.11 │ └── upgrade.go │ ├── v1.12 │ └── upgrade.go │ ├── v1.13 │ └── upgrade.go │ ├── v1.14 │ └── upgrade.go │ ├── v1.15 │ └── upgrade.go │ ├── v1.16 │ └── upgrade.go │ ├── v1.17 │ └── upgrade.go │ ├── v1.18 │ └── upgrade.go │ ├── v1.19 │ └── upgrade.go │ ├── v1.4 │ ├── cos_patch.go │ ├── records.go │ └── upgrade.go │ ├── v1.5 │ └── upgrade.go │ ├── v1.6 │ └── upgrade.go │ ├── v1.7 │ └── upgrade.go │ └── v1.8 │ └── upgrade.go ├── azure-pipelines.yml ├── buf.gen.swagger.yaml ├── buf.work.yaml ├── buf.yaml ├── check-hw ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── README.md ├── build.rs ├── rust-toolchain └── src │ ├── enclave.rs │ ├── enclave_api.rs │ ├── main.rs │ └── types.rs ├── client └── docs │ ├── config.json │ ├── package.json │ ├── static │ ├── openapi │ │ ├── index.html │ │ └── openapi.yaml │ └── swagger │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── index.html │ │ ├── oauth2-redirect.html │ │ ├── swagger-ui-bundle.js │ │ ├── swagger-ui-standalone-preset.js │ │ ├── swagger-ui.css │ │ └── swagger.yaml │ ├── statik │ ├── init.go │ └── statik.go │ └── yarn.lock ├── cmd └── secretd │ ├── attestation.go │ ├── cli_attestation.go │ ├── config.go │ ├── genaccounts.go │ ├── init.go │ ├── main.go │ ├── root.go │ └── secret20.go ├── cosmwasm ├── .circleci │ └── config.yml ├── .editorconfig ├── .github │ └── workflows │ │ └── ci.yml ├── .gitignore ├── .mergify.yml ├── .prettierignore ├── .prettierrc.json ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── EntryPoints.md ├── IBC.md ├── LICENSE ├── MIGRATING.md ├── NOTICE ├── README.md ├── SEMANTICS.md ├── contracts │ ├── README.md │ ├── v010 │ │ ├── README.md │ │ ├── burner │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── schema │ │ │ │ ├── handle_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ ├── migrate_msg.json │ │ │ │ └── query_msg.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ ├── compute-tests │ │ │ ├── test-compute-contract-v2 │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.lock │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── build.rs │ │ │ │ └── src │ │ │ │ │ ├── contract.rs │ │ │ │ │ └── lib.rs │ │ │ └── test-compute-contract │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.lock │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── build.rs │ │ │ │ ├── contract.rs │ │ │ │ ├── rust-toolchain │ │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ └── lib.rs │ │ ├── dist │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── rustfmt.toml │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── erc20 │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Developing.md │ │ │ ├── Importing.md │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── Publishing.md │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── schema │ │ │ │ ├── allowance_response.json │ │ │ │ ├── balance_response.json │ │ │ │ ├── constants.json │ │ │ │ ├── handle_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ └── query_msg.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── tests.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ ├── escrow │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Developing.md │ │ │ ├── Importing.md │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── Publishing.md │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── rustfmt.toml │ │ │ ├── schema │ │ │ │ ├── handle_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ ├── query_msg.json │ │ │ │ └── state.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ ├── gov │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── rustfmt.toml │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── hackatom │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── schema │ │ │ │ ├── balance_response.json │ │ │ │ ├── handle_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ ├── migrate_msg.json │ │ │ │ ├── query_msg.json │ │ │ │ ├── state.json │ │ │ │ └── verifier_response.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ └── lib.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ ├── mint │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── rustfmt.toml │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── plaintext-logs │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── queue │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── schema │ │ │ │ ├── count_response.json │ │ │ │ ├── handle_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ ├── item.json │ │ │ │ ├── query_msg.json │ │ │ │ └── sum_response.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ └── lib.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ ├── reflect │ │ │ ├── .cargo │ │ │ │ └── config │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── schema.rs │ │ │ ├── rustfmt.toml │ │ │ ├── schema │ │ │ │ ├── custom_msg.json │ │ │ │ ├── handle_msg.json │ │ │ │ ├── handle_response_for__custom_msg.json │ │ │ │ ├── init_msg.json │ │ │ │ ├── owner_response.json │ │ │ │ ├── query_msg.json │ │ │ │ └── state.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ ├── state.rs │ │ │ │ └── testing.rs │ │ │ └── tests │ │ │ │ └── integration.rs │ │ └── staking │ │ │ ├── .cargo │ │ │ └── config │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── contract.wasm │ │ │ ├── contract.wasm.gz │ │ │ ├── rustfmt.toml │ │ │ ├── schema │ │ │ ├── balance_response.json │ │ │ ├── claims_response.json │ │ │ ├── handle_msg.json │ │ │ ├── init_msg.json │ │ │ ├── investment_info.json │ │ │ ├── investment_response.json │ │ │ ├── query_msg.json │ │ │ ├── supply.json │ │ │ └── token_info_response.json │ │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ └── v1 │ │ ├── burner │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── instantiate_msg.json │ │ │ └── migrate_msg.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── compute-tests │ │ ├── bench-contract │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── rust-toolchain │ │ │ └── src │ │ │ │ ├── benches │ │ │ │ ├── allocate.rs │ │ │ │ ├── cpu.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── read_storage.rs │ │ │ │ └── write_storage.rs │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ ├── state.rs │ │ │ │ └── viewing_key_obj.rs │ │ ├── evaporation │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── evaporate_contract_example.wasm │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── ibc-test-contract │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── rust-toolchain │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ ├── migration │ │ │ ├── contract-v1 │ │ │ │ ├── Cargo.lock │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ ├── migrate_contract_v1.wasm │ │ │ │ └── src │ │ │ │ │ ├── contract.rs │ │ │ │ │ ├── lib.rs │ │ │ │ │ └── msg.rs │ │ │ └── contract-v2 │ │ │ │ ├── Cargo.lock │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ ├── migrate_contract_v2.wasm │ │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ └── msg.rs │ │ ├── random-test │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── rust-toolchain │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ ├── test-compute-contract-v2 │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── rust-toolchain │ │ │ └── src │ │ │ │ ├── contract.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ └── test-compute-contract │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ ├── rust-toolchain │ │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ ├── crypto-verify │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── instantiate_msg.json │ │ │ └── query_msg.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── ethereum.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── debug-print │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── Makefile │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ ├── dist │ │ ├── .cargo │ │ │ └── config │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── README.md │ │ ├── rustfmt.toml │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ ├── erc20 │ │ ├── .cargo │ │ │ └── config │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── Developing.md │ │ ├── Importing.md │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── Publishing.md │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── allowance_response.json │ │ │ ├── balance_response.json │ │ │ ├── constants.json │ │ │ ├── handle_msg.json │ │ │ ├── init_msg.json │ │ │ └── query_msg.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── tests.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── escrow │ │ ├── .cargo │ │ │ └── config │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── Developing.md │ │ ├── Importing.md │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── Publishing.md │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── rustfmt.toml │ │ ├── schema │ │ │ ├── handle_msg.json │ │ │ ├── init_msg.json │ │ │ ├── query_msg.json │ │ │ └── state.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── floaty │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── balance_response.json │ │ │ ├── execute_msg.json │ │ │ ├── instantiate_msg.json │ │ │ ├── query_msg.json │ │ │ ├── state.json │ │ │ └── verifier_response.json │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── errors.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ ├── gov │ │ ├── .cargo │ │ │ └── config │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── README.md │ │ ├── rustfmt.toml │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ ├── hackatom │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── balance_response.json │ │ │ ├── execute_msg.json │ │ │ ├── instantiate_msg.json │ │ │ ├── migrate_msg.json │ │ │ ├── query_msg.json │ │ │ ├── state.json │ │ │ ├── sudo_msg.json │ │ │ └── verifier_response.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── errors.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── ibc-reflect-send │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── account_response.json │ │ │ ├── admin_response.json │ │ │ ├── execute_msg.json │ │ │ ├── instantiate_msg.json │ │ │ ├── list_accounts_response.json │ │ │ ├── packet_msg.json │ │ │ └── query_msg.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── ibc.rs │ │ │ ├── ibc_msg.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── ibc-reflect │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── acknowledgement_msg_balances.json │ │ │ ├── acknowledgement_msg_dispatch.json │ │ │ ├── acknowledgement_msg_who_am_i.json │ │ │ ├── instantiate_msg.json │ │ │ ├── packet_msg.json │ │ │ └── query_msg.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── mint │ │ ├── .cargo │ │ │ └── config │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── README.md │ │ ├── rustfmt.toml │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ ├── plaintext-logs │ │ ├── .cargo │ │ │ └── config │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── Makefile │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ ├── queue │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── examples │ │ │ └── schema.rs │ │ ├── schema │ │ │ ├── count_response.json │ │ │ ├── execute_msg.json │ │ │ ├── instantiate_msg.json │ │ │ ├── item.json │ │ │ ├── list_response.json │ │ │ ├── migrate_msg.json │ │ │ ├── query_msg.json │ │ │ └── sum_response.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── reflect │ │ ├── .cargo │ │ │ └── config │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── rustfmt.toml │ │ ├── schema │ │ │ ├── capitalized_response.json │ │ │ ├── chain_response.json │ │ │ ├── custom_msg.json │ │ │ ├── execute_msg.json │ │ │ ├── instantiate_msg.json │ │ │ ├── owner_response.json │ │ │ ├── query_msg.json │ │ │ ├── raw_response.json │ │ │ ├── response_for__custom_msg.json │ │ │ └── state.json │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── errors.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ ├── state.rs │ │ │ └── testing.rs │ │ └── tests │ │ │ └── integration.rs │ │ └── staking │ │ ├── .cargo │ │ └── config │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── examples │ │ └── schema.rs │ │ ├── rustfmt.toml │ │ ├── schema │ │ ├── balance_response.json │ │ ├── claims_response.json │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── investment_info.json │ │ ├── investment_response.json │ │ ├── query_msg.json │ │ ├── supply.json │ │ ├── token_info.json │ │ └── token_info_response.json │ │ ├── src │ │ ├── contract.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ │ └── tests │ │ └── integration.rs ├── devtools │ ├── check_contracts_fast.sh │ ├── check_contracts_full.sh │ ├── check_contracts_medium.sh │ ├── check_workspace.sh │ ├── clean.sh │ ├── clean_contracts.sh │ ├── format_md.sh │ ├── format_sh.sh │ ├── format_yml.sh │ ├── set_version.sh │ └── test_workspace.sh ├── docs │ ├── MSRV.md │ └── simulate_riffle_shuffle.py ├── enclaves │ ├── Cargo.lock │ ├── Cargo.toml │ ├── Xargo.toml │ ├── execute │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── Enclave.config.prod.xml │ │ ├── Enclave.config.xml │ │ ├── Enclave.edl │ │ ├── Enclave.lds │ │ ├── Enclave_private.pem │ │ ├── Intel_SGX_Attestation_RootCA.pem │ │ ├── Makefile │ │ ├── proto │ │ │ ├── README.md │ │ │ ├── cosmos │ │ │ │ ├── app │ │ │ │ │ ├── runtime │ │ │ │ │ │ └── v1alpha1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1alpha1 │ │ │ │ │ │ ├── config.proto │ │ │ │ │ │ ├── module.proto │ │ │ │ │ │ └── query.proto │ │ │ │ ├── auth │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── auth.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── authz │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── authz.proto │ │ │ │ │ │ ├── event.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── autocli │ │ │ │ │ └── v1 │ │ │ │ │ │ ├── options.proto │ │ │ │ │ │ └── query.proto │ │ │ │ ├── bank │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── authz.proto │ │ │ │ │ │ ├── bank.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── base │ │ │ │ │ ├── abci │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── abci.proto │ │ │ │ │ ├── node │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── query.proto │ │ │ │ │ ├── query │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── pagination.proto │ │ │ │ │ ├── reflection │ │ │ │ │ │ ├── v1beta1 │ │ │ │ │ │ │ └── reflection.proto │ │ │ │ │ │ └── v2alpha1 │ │ │ │ │ │ │ └── reflection.proto │ │ │ │ │ ├── tendermint │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ │ └── types.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ └── coin.proto │ │ │ │ ├── circuit │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1 │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ ├── tx.proto │ │ │ │ │ │ └── types.proto │ │ │ │ ├── consensus │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1 │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── crisis │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── crypto │ │ │ │ │ ├── ed25519 │ │ │ │ │ │ └── keys.proto │ │ │ │ │ ├── hd │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── hd.proto │ │ │ │ │ ├── keyring │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── record.proto │ │ │ │ │ ├── multisig │ │ │ │ │ │ ├── keys.proto │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── multisig.proto │ │ │ │ │ ├── secp256k1 │ │ │ │ │ │ └── keys.proto │ │ │ │ │ └── secp256r1 │ │ │ │ │ │ └── keys.proto │ │ │ │ ├── distribution │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── distribution.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── evidence │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── evidence.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── feegrant │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── feegrant.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── genutil │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ └── genesis.proto │ │ │ │ ├── gov │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ ├── v1 │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── gov.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── gov.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── group │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1 │ │ │ │ │ │ ├── events.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ ├── tx.proto │ │ │ │ │ │ └── types.proto │ │ │ │ ├── mint │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── mint.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── msg │ │ │ │ │ ├── textual │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── textual.proto │ │ │ │ │ └── v1 │ │ │ │ │ │ └── msg.proto │ │ │ │ ├── nft │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── event.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── nft.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── orm │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1alpha1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ ├── query │ │ │ │ │ │ └── v1alpha1 │ │ │ │ │ │ │ └── query.proto │ │ │ │ │ ├── v1 │ │ │ │ │ │ └── orm.proto │ │ │ │ │ └── v1alpha1 │ │ │ │ │ │ └── schema.proto │ │ │ │ ├── params │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── params.proto │ │ │ │ │ │ └── query.proto │ │ │ │ ├── query │ │ │ │ │ └── v1 │ │ │ │ │ │ └── query.proto │ │ │ │ ├── reflection │ │ │ │ │ └── v1 │ │ │ │ │ │ └── reflection.proto │ │ │ │ ├── slashing │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ ├── slashing.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── staking │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── authz.proto │ │ │ │ │ │ ├── genesis.proto │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ ├── staking.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── store │ │ │ │ │ ├── internal │ │ │ │ │ │ └── kv │ │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── kv.proto │ │ │ │ │ ├── snapshots │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── snapshot.proto │ │ │ │ │ ├── streaming │ │ │ │ │ │ └── abci │ │ │ │ │ │ │ └── grpc.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── commit_info.proto │ │ │ │ │ │ └── listening.proto │ │ │ │ ├── tx │ │ │ │ │ ├── config │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── config.proto │ │ │ │ │ ├── signing │ │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ │ └── signing.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── service.proto │ │ │ │ │ │ └── tx.proto │ │ │ │ ├── upgrade │ │ │ │ │ ├── module │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ │ ├── query.proto │ │ │ │ │ │ ├── tx.proto │ │ │ │ │ │ └── upgrade.proto │ │ │ │ └── vesting │ │ │ │ │ ├── module │ │ │ │ │ └── v1 │ │ │ │ │ │ └── module.proto │ │ │ │ │ └── v1beta1 │ │ │ │ │ ├── tx.proto │ │ │ │ │ └── vesting.proto │ │ │ └── gogoproto │ │ │ │ └── gogo.proto │ │ ├── src │ │ │ ├── ecalls.rs │ │ │ ├── lib.rs │ │ │ ├── registration │ │ │ │ ├── attestation.rs │ │ │ │ ├── cert.rs │ │ │ │ ├── check_patch_level.rs │ │ │ │ ├── fixtures │ │ │ │ │ ├── attestation_cert_hw_invalid_test.der │ │ │ │ │ ├── attestation_cert_hw_v2 │ │ │ │ │ ├── attestation_cert_out_of_date.der │ │ │ │ │ ├── attestation_cert_sw │ │ │ │ │ ├── attestation_cert_sw_config_needed.der │ │ │ │ │ ├── attestation_dcap.collateral │ │ │ │ │ ├── attestation_dcap.quote │ │ │ │ │ ├── ias_root_ca_cert.der │ │ │ │ │ ├── test_whitelist.txt │ │ │ │ │ └── tls_ra_cert_v3.der │ │ │ │ ├── hex.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── ocalls.rs │ │ │ │ ├── offchain.rs │ │ │ │ ├── onchain.rs │ │ │ │ ├── persistency.rs │ │ │ │ ├── print_report.rs │ │ │ │ ├── report.rs │ │ │ │ ├── seed_exchange.rs │ │ │ │ ├── seed_service.rs │ │ │ │ ├── sss_ca.pem │ │ │ │ └── sssd_ca.pem │ │ │ └── tests.rs │ │ └── whitelist.txt │ ├── ffi-types │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── cbindgen.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ └── types.rs │ ├── rust-toolchain │ ├── shared │ │ ├── block-verifier │ │ │ ├── Cargo.toml │ │ │ ├── fixtures │ │ │ │ ├── validator_whitelist.txt │ │ │ │ ├── validator_whitelist_emergency_prod.txt │ │ │ │ └── validator_whitelist_prod.txt │ │ │ └── src │ │ │ │ ├── lib.rs │ │ │ │ ├── submit_block_signatures.rs │ │ │ │ ├── txs.rs │ │ │ │ ├── validator_whitelist.rs │ │ │ │ ├── verify │ │ │ │ ├── block.rs │ │ │ │ ├── commit.rs │ │ │ │ ├── header.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── random.rs │ │ │ │ └── txs.rs │ │ │ │ └── wasm_messages.rs │ │ ├── contract-engine │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ └── src │ │ │ │ ├── contract_operations.rs │ │ │ │ ├── contract_validation.rs │ │ │ │ ├── cosmwasm_config.rs │ │ │ │ ├── db.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── execute_message.rs │ │ │ │ ├── external │ │ │ │ ├── ecalls.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── ocalls.rs │ │ │ │ └── results.rs │ │ │ │ ├── gas.rs │ │ │ │ ├── hardcoded_admins.rs │ │ │ │ ├── ibc_denom_utils.rs │ │ │ │ ├── ibc_message.rs │ │ │ │ ├── input_validation │ │ │ │ ├── contract_address_validation.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── msg_validation.rs │ │ │ │ ├── send_funds_validations.rs │ │ │ │ └── sender_validation.rs │ │ │ │ ├── io.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── message.rs │ │ │ │ ├── message_utils.rs │ │ │ │ ├── query_chain.rs │ │ │ │ ├── random.rs │ │ │ │ ├── reply_message.rs │ │ │ │ ├── types.rs │ │ │ │ └── wasm3 │ │ │ │ ├── gas.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── module_cache.rs │ │ │ │ └── validation.rs │ │ ├── cosmos-proto │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ └── src │ │ │ │ ├── base │ │ │ │ └── coin.rs │ │ │ │ ├── cosmwasm │ │ │ │ └── msg.rs │ │ │ │ ├── crypto │ │ │ │ ├── ed25519 │ │ │ │ │ └── keys.rs │ │ │ │ ├── multisig │ │ │ │ │ ├── keys.rs │ │ │ │ │ └── multisig.rs │ │ │ │ ├── secp256k1 │ │ │ │ │ └── keys.rs │ │ │ │ └── secp256r1 │ │ │ │ │ └── keys.rs │ │ │ │ ├── ibc │ │ │ │ ├── channel.rs │ │ │ │ ├── channel_upgrade.rs │ │ │ │ ├── client.rs │ │ │ │ ├── tx.rs │ │ │ │ └── upgrade.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── registration │ │ │ │ └── v1beta1 │ │ │ │ │ └── msg.rs │ │ │ │ └── tx │ │ │ │ ├── signing.rs │ │ │ │ └── tx.rs │ │ ├── cosmos-types │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ └── src │ │ │ │ ├── lib.rs │ │ │ │ ├── multisig.rs │ │ │ │ ├── single_address.rs │ │ │ │ ├── traits.rs │ │ │ │ └── types.rs │ │ ├── cosmwasm-types │ │ │ ├── generic │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ │ └── lib.rs │ │ │ ├── v0.10 │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ └── src │ │ │ │ │ ├── coins.rs │ │ │ │ │ ├── consts.rs │ │ │ │ │ ├── encoding.rs │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── math.rs │ │ │ │ │ ├── query.rs │ │ │ │ │ ├── std_error.rs │ │ │ │ │ ├── system_error.rs │ │ │ │ │ └── types.rs │ │ │ └── v1.0 │ │ │ │ ├── Cargo.toml │ │ │ │ ├── Makefile │ │ │ │ └── src │ │ │ │ ├── addresses.rs │ │ │ │ ├── coins.rs │ │ │ │ ├── errors │ │ │ │ ├── crypto_error.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── recover_pubkey_error.rs │ │ │ │ ├── std_error.rs │ │ │ │ └── verification_error.rs │ │ │ │ ├── ibc.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── math │ │ │ │ ├── mod.rs │ │ │ │ ├── uint128.rs │ │ │ │ └── uint64.rs │ │ │ │ ├── results │ │ │ │ ├── contract_result.rs │ │ │ │ ├── cosmos_msg.rs │ │ │ │ ├── empty.rs │ │ │ │ ├── events.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── response.rs │ │ │ │ └── submessages.rs │ │ │ │ ├── timestamp.rs │ │ │ │ └── types.rs │ │ ├── crypto │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ └── src │ │ │ │ ├── aes_gcm.rs │ │ │ │ ├── aes_siv.rs │ │ │ │ ├── consts.rs │ │ │ │ ├── dcap.rs │ │ │ │ ├── ed25519.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── hash │ │ │ │ ├── mod.rs │ │ │ │ ├── ripemd.rs │ │ │ │ └── sha.rs │ │ │ │ ├── hmac.rs │ │ │ │ ├── kdf.rs │ │ │ │ ├── keys.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── rng.rs │ │ │ │ ├── secp256k1.rs │ │ │ │ ├── storage.rs │ │ │ │ └── traits.rs │ │ └── utils │ │ │ ├── Cargo.toml │ │ │ ├── Makefile │ │ │ └── src │ │ │ ├── key_manager.rs │ │ │ ├── kv_cache.rs │ │ │ ├── lib.rs │ │ │ ├── logger.rs │ │ │ ├── macros.rs │ │ │ ├── oom_handler.rs │ │ │ ├── pointers.rs │ │ │ ├── random.rs │ │ │ ├── recursion_depth.rs │ │ │ ├── results.rs │ │ │ ├── storage.rs │ │ │ ├── tx_bytes.rs │ │ │ └── validator_set.rs │ ├── test │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── Makefile │ │ ├── build.rs │ │ └── src │ │ │ ├── enclave.rs │ │ │ ├── main.rs │ │ │ └── ocall_mock.rs │ └── xargo │ │ ├── sgx_tstd │ │ ├── build.rs │ │ └── cargo.toml │ │ └── x86_64-unknown-linux-sgx.json └── packages │ └── sgx-vm │ ├── Cargo.toml │ ├── README.md │ ├── rust-toolchain │ ├── src │ ├── attestation.rs │ ├── attestation_dcap.rs │ ├── backends │ │ ├── cranelift.rs │ │ ├── enclave.rs │ │ ├── mod.rs │ │ └── singlepass.rs │ ├── cache.rs │ ├── calls.rs │ ├── checksum.rs │ ├── compatability.rs │ ├── context.rs │ ├── conversion.rs │ ├── enclave.rs │ ├── enclave_config.rs │ ├── env_types.rs │ ├── errors │ │ ├── communication_error.rs │ │ ├── enclave.rs │ │ ├── mod.rs │ │ ├── region_validation_error.rs │ │ └── vm_error.rs │ ├── features.rs │ ├── ffi.rs │ ├── imports.rs │ ├── instance.rs │ ├── lib.rs │ ├── memory.rs │ ├── middleware │ │ ├── deterministic.rs │ │ └── mod.rs │ ├── modules.rs │ ├── random.rs │ ├── seed.rs │ ├── serde.rs │ ├── testing │ │ ├── calls.rs │ │ ├── instance.rs │ │ ├── mock.rs │ │ ├── mod.rs │ │ ├── querier.rs │ │ └── storage.rs │ ├── traits.rs │ └── wasmi │ │ ├── exports.rs │ │ ├── imports.rs │ │ ├── mod.rs │ │ ├── results.rs │ │ ├── utils.rs │ │ └── wrapper.rs │ └── testdata │ ├── README.md │ ├── contract.wasm │ ├── contract_0.10.wasm │ ├── contract_0.6.wasm │ ├── contract_0.7.wasm │ ├── contract_0.8.wasm │ ├── contract_0.9.wasm │ └── corrupted.wasm ├── deployment ├── azure-marketplace-legacy │ ├── README.md │ ├── mainnet │ │ └── docker-compose.yaml │ ├── quickstart │ │ ├── azuredeploy.json │ │ └── azuredeploy.parameters.json │ ├── secret-node-azure-template │ │ ├── README.md │ │ ├── Usage.md │ │ ├── createUiDefinition.json │ │ ├── docker │ │ │ └── docker-compose.yaml │ │ ├── mainTemplate.json │ │ ├── metadata.json │ │ └── scripts │ │ │ └── secretnode.sh │ └── testnet │ │ └── docker-compose.yaml ├── ci │ ├── bootstrap_init.sh │ ├── docker-compose.ci.yaml │ ├── enclave-test.sh │ ├── go-tests-bench.sh │ ├── go-tests.sh │ ├── node_init.sh │ ├── node_key.json │ ├── query-load-test │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── snip20-ibc.wasm.gz │ │ ├── snip20-ibc.wasm.gz.bk │ │ └── test.js │ ├── startup.sh │ └── wasmi-sgx-test.sh ├── deb │ ├── control │ ├── postinst │ ├── postrm │ └── triggers ├── docker │ ├── README.md │ ├── builder │ │ ├── build_deb.sh │ │ └── create_check_hw_tar.sh │ ├── docker-compose.example.mainnet.yaml │ ├── docker-compose.testnet.beta.yaml │ ├── localsecret │ │ ├── bootstrap_init_no_stop.sh │ │ ├── faucet │ │ │ └── faucet_server.js │ │ ├── node_init.sh │ │ └── node_start.sh │ ├── mainnet │ │ └── mainnet_node.sh │ ├── setup scripts │ │ ├── setup_host.sh │ │ └── setup_tmp_folder.sh │ └── testnet │ │ ├── Caddyfile │ │ ├── bootstrap_init.sh │ │ ├── nginx.conf │ │ ├── node_init.sh │ │ ├── node_key.json │ │ └── startup.sh └── dockerfiles │ ├── Dockerfile │ ├── Dockerfile.2004 │ ├── README.md │ ├── base-images │ ├── aesm.Dockerfile │ ├── app.Dockerfile │ ├── db-compile.Dockerfile │ ├── gitpod-local.Dockerfile │ └── secret-contract-optimizer.Dockerfile │ ├── ibc │ ├── README.md │ ├── c.mnemonic │ ├── d.mnemonic │ ├── docker-compose.yml │ ├── entrypoint-hermes.sh │ ├── hermes-alternative-config.toml │ ├── hermes-config.toml │ ├── hermes-history │ ├── hermes-v1.10.3-x86_64-unknown-linux-gnu.tar.gz │ └── hermes.Dockerfile │ └── tests │ ├── compile-contracts.Dockerfile │ ├── enclave-test.Dockerfile │ ├── integration-tests.Dockerfile │ └── system-tests.Dockerfile ├── docker-compose.yml ├── docs ├── SGX on WSL (SW).md ├── contract-with-migrate.wasm.gz ├── contract.wasm ├── migrate_contract_v2.wasm ├── node_init.sh ├── proposals │ ├── hardcode-admins-on-v1.10.md │ ├── prop112.json │ ├── prop274.json │ ├── prop76.json │ ├── secret-surge-month-1.json │ ├── v1.10.md │ ├── v1.11.md │ ├── v1.12.md │ ├── v1.3-shockwave-alpha.md │ ├── v1.4-shockwave-delta.md │ ├── v1.5.md │ ├── v1.6-shockwave-omega.md │ ├── v1.7.md │ ├── v1.8.md │ └── v1.9.md ├── random-usage.md ├── test-v1.12-upgrade-handler-premigrated-contract.md ├── test-v1.12-upgrade-handler.md ├── test-v1.4-upgrade-handler.md ├── test-v1.5-upgrade-handler.md ├── test-v1.6-upgrade-handler.md ├── test-v1.7-upgrade-handler.md └── upgrades │ ├── 1.11 │ ├── contract.wasm │ ├── docker-compose-111.yml │ ├── node_init.sh │ └── test-v1.11-upgrade-handler.md │ ├── 1.15 │ ├── cleanup.sh │ ├── contract.wasm │ ├── docker-compose-115.yml │ ├── init_proposal.sh │ ├── node_init.sh │ ├── test-v1.15-upgrade-handler.md │ └── update_binaries.sh │ ├── 1.16 │ ├── cleanup.sh │ ├── contract.wasm │ ├── docker-compose-115.yml │ ├── init_proposal.sh │ ├── node_init.sh │ ├── test-v1.16-upgrade-handler.md │ └── update_binaries.sh │ ├── 1.7 │ └── docker-compose-17.yml │ └── 1.9 │ ├── docker-compose-19-testnet.yml │ ├── docker-compose-19.yml │ ├── test-v1.9-upgrade-handler-testnet.md │ └── test-v1.9-upgrade-handler.md ├── eip191 └── eip191.go ├── go-cosmwasm ├── .editorconfig ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile.alpine ├── Dockerfile.centos7 ├── Dockerfile.cross ├── LICENSE ├── Makefile ├── README.md ├── api │ ├── bindings.h │ ├── callbacks.go │ ├── callbacks_cgo.go │ ├── callbacks_cgo_mock.go │ ├── callbacks_mock.go │ ├── iterator.go │ ├── lib.go │ ├── lib_mock.go │ ├── link_muslc.go │ ├── link_std.go │ ├── link_std_sw.go │ ├── memory.go │ └── testdata │ │ ├── contract.wasm │ │ ├── download_releases.sh │ │ ├── hackatom.wasm │ │ ├── queue.wasm │ │ └── reflect.wasm ├── build.rs ├── build │ ├── README.md │ ├── build.sh │ ├── build_linux.sh │ ├── build_muslc.sh │ ├── build_osx.sh │ └── cargo-config ├── cbindgen.toml ├── clippy.toml ├── cmd │ └── main.go ├── lib.go ├── rust-toolchain ├── spec │ ├── Architecture.md │ ├── Index.md │ └── Specification.md ├── src │ ├── api.rs │ ├── db.rs │ ├── error │ │ ├── go.rs │ │ ├── mod.rs │ │ └── rust.rs │ ├── gas_meter.rs │ ├── iterator.rs │ ├── lib.rs │ ├── logger.rs │ ├── memory.rs │ └── querier.rs └── types │ ├── env.go │ ├── env_test.go │ ├── queries.go │ ├── queries_test.go │ ├── stderror.go │ ├── systemerror.go │ ├── types.go │ ├── v010 │ └── msg_v010.go │ └── v1 │ ├── ibc.go │ ├── msg_v1.go │ ├── subcall.go │ └── type.go ├── go.mod ├── go.sum ├── ias_keys ├── develop │ ├── api_key.txt │ └── spid.txt └── sw_dummy │ ├── api_key.txt │ └── spid.txt ├── integration-tests ├── Makefile ├── basic-tests.sh ├── contract-info.json ├── contract-v0.10 │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── Makefile │ ├── README.md │ ├── rust-toolchain │ └── src │ │ ├── contract.rs │ │ └── lib.rs ├── contract-v1 │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── Makefile │ ├── rust-toolchain │ └── src │ │ ├── contract.rs │ │ ├── ibc.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs ├── error-resp.json ├── integration_test_funcs.sh ├── jest.config.js ├── package.json ├── test-contracts │ └── contract.wasm.gz ├── test.ts ├── tsconfig.json ├── utils.ts └── yarn.lock ├── proto ├── buf.gen.gogo.yaml ├── buf.lock ├── buf.yaml └── secret │ ├── compute │ └── v1beta1 │ │ ├── genesis.proto │ │ ├── msg.proto │ │ ├── params.proto │ │ ├── query.proto │ │ └── types.proto │ ├── emergencybutton │ └── v1beta1 │ │ ├── genesis.proto │ │ ├── params.proto │ │ ├── query.proto │ │ └── tx.proto │ └── registration │ ├── remote_attestation │ └── v1beta1 │ │ └── types.proto │ └── v1beta1 │ ├── genesis.proto │ ├── msg.proto │ ├── query.proto │ └── types.proto ├── rust-toolchain ├── scripts ├── add_azure_drive.sh ├── add_validator.sh ├── create_keys.sh ├── devnote.txt ├── faucet │ └── faucet_server.js ├── install-everything.sh ├── install-sgx.sh ├── install-wasm-tools.sh ├── protoc-swagger-gen.sh ├── protoc-swagger-openapi-gen.sh ├── protocgen.sh ├── public-node-updater.sh ├── start-node.sh ├── start_bootstrap_node.sh └── start_full_node.sh ├── sn-logo.png ├── third_party ├── build │ ├── Cargo.lock │ ├── Cargo.toml │ ├── buildenv.mk │ └── src │ │ └── lib.rs └── proto │ ├── amino │ └── amino.proto │ ├── buf.yaml │ ├── cosmos │ ├── app │ │ ├── runtime │ │ │ └── v1alpha1 │ │ │ │ └── module.proto │ │ └── v1alpha1 │ │ │ ├── config.proto │ │ │ ├── module.proto │ │ │ └── query.proto │ ├── auth │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── auth.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── authz │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── authz.proto │ │ │ ├── event.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── autocli │ │ └── v1 │ │ │ ├── options.proto │ │ │ └── query.proto │ ├── bank │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── authz.proto │ │ │ ├── bank.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── base │ │ ├── abci │ │ │ └── v1beta1 │ │ │ │ └── abci.proto │ │ ├── node │ │ │ └── v1beta1 │ │ │ │ └── query.proto │ │ ├── query │ │ │ └── v1beta1 │ │ │ │ └── pagination.proto │ │ ├── reflection │ │ │ ├── v1beta1 │ │ │ │ └── reflection.proto │ │ │ └── v2alpha1 │ │ │ │ └── reflection.proto │ │ ├── tendermint │ │ │ └── v1beta1 │ │ │ │ ├── query.proto │ │ │ │ └── types.proto │ │ └── v1beta1 │ │ │ └── coin.proto │ ├── circuit │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1 │ │ │ ├── query.proto │ │ │ ├── tx.proto │ │ │ └── types.proto │ ├── consensus │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1 │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── crypto │ │ ├── ed25519 │ │ │ └── keys.proto │ │ ├── hd │ │ │ └── v1 │ │ │ │ └── hd.proto │ │ ├── keyring │ │ │ └── v1 │ │ │ │ └── record.proto │ │ ├── multisig │ │ │ ├── keys.proto │ │ │ └── v1beta1 │ │ │ │ └── multisig.proto │ │ ├── secp256k1 │ │ │ └── keys.proto │ │ └── secp256r1 │ │ │ └── keys.proto │ ├── distribution │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── distribution.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── evidence │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── evidence.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── feegrant │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── feegrant.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── genutil │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ └── genesis.proto │ ├── gov │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ ├── v1 │ │ │ ├── genesis.proto │ │ │ ├── gov.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ │ └── v1beta1 │ │ │ ├── genesis.proto │ │ │ ├── gov.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── ics23 │ │ └── v1 │ │ │ └── proofs.proto │ ├── mint │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── genesis.proto │ │ │ ├── mint.proto │ │ │ ├── query.proto │ │ │ └── tx.proto │ ├── msg │ │ ├── textual │ │ │ └── v1 │ │ │ │ └── textual.proto │ │ └── v1 │ │ │ └── msg.proto │ ├── orm │ │ ├── module │ │ │ └── v1alpha1 │ │ │ │ └── module.proto │ │ ├── query │ │ │ └── v1alpha1 │ │ │ │ └── query.proto │ │ ├── v1 │ │ │ └── orm.proto │ │ └── v1alpha1 │ │ │ └── schema.proto │ ├── params │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── params.proto │ │ │ └── query.proto │ ├── query │ │ └── v1 │ │ │ └── query.proto │ ├── reflection │ │ └── v1 │ │ │ └── reflection.proto │ ├── slashing │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ ├── slashing.proto │ │ │ └── tx.proto │ ├── staking │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── authz.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ ├── staking.proto │ │ │ └── tx.proto │ ├── store │ │ ├── internal │ │ │ └── kv │ │ │ │ └── v1beta1 │ │ │ │ └── kv.proto │ │ ├── snapshots │ │ │ └── v1 │ │ │ │ └── snapshot.proto │ │ ├── streaming │ │ │ └── abci │ │ │ │ └── grpc.proto │ │ └── v1beta1 │ │ │ ├── commit_info.proto │ │ │ └── listening.proto │ ├── tx │ │ ├── config │ │ │ └── v1 │ │ │ │ └── config.proto │ │ ├── signing │ │ │ └── v1beta1 │ │ │ │ └── signing.proto │ │ └── v1beta1 │ │ │ ├── service.proto │ │ │ └── tx.proto │ ├── upgrade │ │ ├── module │ │ │ └── v1 │ │ │ │ └── module.proto │ │ └── v1beta1 │ │ │ ├── query.proto │ │ │ ├── tx.proto │ │ │ └── upgrade.proto │ └── vesting │ │ ├── module │ │ └── v1 │ │ │ └── module.proto │ │ └── v1beta1 │ │ ├── tx.proto │ │ └── vesting.proto │ ├── cosmos_proto │ └── cosmos.proto │ ├── gogoproto │ └── gogo.proto │ ├── google │ ├── api │ │ ├── annotations.proto │ │ ├── http.proto │ │ └── httpbody.proto │ └── protobuf │ │ ├── any.proto │ │ ├── duration.proto │ │ ├── empty.proto │ │ └── timestamp.proto │ ├── ibc-apps │ └── packetforward │ │ └── v1 │ │ ├── genesis.proto │ │ ├── query.proto │ │ └── tx.proto │ ├── ibc │ ├── applications │ │ ├── fee │ │ │ └── v1 │ │ │ │ ├── ack.proto │ │ │ │ ├── fee.proto │ │ │ │ ├── genesis.proto │ │ │ │ ├── metadata.proto │ │ │ │ ├── query.proto │ │ │ │ └── tx.proto │ │ ├── interchain_accounts │ │ │ ├── controller │ │ │ │ └── v1 │ │ │ │ │ ├── controller.proto │ │ │ │ │ ├── query.proto │ │ │ │ │ └── tx.proto │ │ │ ├── genesis │ │ │ │ └── v1 │ │ │ │ │ └── genesis.proto │ │ │ ├── host │ │ │ │ └── v1 │ │ │ │ │ ├── host.proto │ │ │ │ │ ├── query.proto │ │ │ │ │ └── tx.proto │ │ │ └── v1 │ │ │ │ ├── account.proto │ │ │ │ ├── metadata.proto │ │ │ │ └── packet.proto │ │ └── transfer │ │ │ ├── v1 │ │ │ ├── authz.proto │ │ │ ├── genesis.proto │ │ │ ├── query.proto │ │ │ ├── transfer.proto │ │ │ └── tx.proto │ │ │ └── v2 │ │ │ └── packet.proto │ ├── core │ │ ├── channel │ │ │ └── v1 │ │ │ │ ├── NoteToDev.txt │ │ │ │ ├── channel.proto │ │ │ │ ├── channel_upgrade.proto │ │ │ │ ├── genesis.proto │ │ │ │ ├── query.proto │ │ │ │ └── tx.proto │ │ ├── client │ │ │ └── v1 │ │ │ │ ├── client.proto │ │ │ │ ├── genesis.proto │ │ │ │ ├── query.proto │ │ │ │ └── tx.proto │ │ ├── commitment │ │ │ └── v1 │ │ │ │ └── commitment.proto │ │ ├── connection │ │ │ └── v1 │ │ │ │ ├── connection.proto │ │ │ │ ├── genesis.proto │ │ │ │ ├── query.proto │ │ │ │ └── tx.proto │ │ └── types │ │ │ └── v1 │ │ │ └── genesis.proto │ └── lightclients │ │ ├── localhost │ │ └── v2 │ │ │ └── localhost.proto │ │ ├── solomachine │ │ ├── v2 │ │ │ └── solomachine.proto │ │ └── v3 │ │ │ └── solomachine.proto │ │ └── tendermint │ │ └── v1 │ │ └── tendermint.proto │ └── tendermint │ ├── abci │ └── types.proto │ ├── blocksync │ ├── message.go │ ├── types.pb.go │ └── types.proto │ ├── consensus │ ├── message.go │ ├── types.pb.go │ ├── types.proto │ ├── wal.pb.go │ └── wal.proto │ ├── crypto │ ├── keys.pb.go │ ├── keys.proto │ ├── proof.pb.go │ └── proof.proto │ ├── libs │ └── bits │ │ ├── types.pb.go │ │ └── types.proto │ ├── mempool │ ├── message.go │ ├── types.pb.go │ └── types.proto │ ├── p2p │ ├── conn.pb.go │ ├── conn.proto │ ├── pex.go │ ├── pex.pb.go │ ├── pex.proto │ ├── types.pb.go │ └── types.proto │ ├── privval │ ├── types.pb.go │ └── types.proto │ ├── rpc │ └── grpc │ │ ├── types.pb.go │ │ └── types.proto │ ├── state │ ├── types.pb.go │ └── types.proto │ ├── statesync │ ├── message.go │ ├── types.pb.go │ └── types.proto │ ├── store │ ├── types.pb.go │ └── types.proto │ ├── types │ ├── block.pb.go │ ├── block.proto │ ├── canonical.pb.go │ ├── canonical.proto │ ├── events.pb.go │ ├── events.proto │ ├── evidence.pb.go │ ├── evidence.proto │ ├── params.pb.go │ ├── params.proto │ ├── types.pb.go │ ├── types.proto │ ├── validator.pb.go │ └── validator.proto │ └── version │ ├── types.pb.go │ └── types.proto ├── types ├── alias.go └── util │ └── prefix.go └── x ├── compute ├── README.md ├── alias.go ├── client │ ├── cli │ │ ├── helpers.go │ │ ├── query.go │ │ └── tx.go │ └── utils │ │ ├── utils.go │ │ └── utils_test.go ├── handler.go ├── ibc.go ├── internal │ ├── keeper │ │ ├── ante.go │ │ ├── api.go │ │ ├── bench_test.go │ │ ├── distribution_test.go │ │ ├── genesis.go │ │ ├── gov_test.go │ │ ├── handler_plugin.go │ │ ├── handler_plugin_test.go │ │ ├── hardcoded_admins.go │ │ ├── ibc.go │ │ ├── ibc_test.go │ │ ├── ioutil.go │ │ ├── ioutil_test.go │ │ ├── keeper.go │ │ ├── keeper_test.go │ │ ├── migrations.go │ │ ├── migrations │ │ │ ├── v1 │ │ │ │ └── types.go │ │ │ └── v2 │ │ │ │ └── types.go │ │ ├── mint_test.go │ │ ├── msg_dispatcher.go │ │ ├── msg_server.go │ │ ├── param_verification_test.go │ │ ├── params.go │ │ ├── querier.go │ │ ├── querier_test.go │ │ ├── query_plugins.go │ │ ├── recurse_test.go │ │ ├── relay.go │ │ ├── secret_contracts_exec_test.go │ │ ├── secret_contracts_init_test.go │ │ ├── secret_contracts_migrate_test.go │ │ ├── secret_contracts_query_test.go │ │ ├── secret_contracts_submsgs_test.go │ │ ├── secret_contracts_utils_test.go │ │ ├── secret_contracts_v010_test.go │ │ ├── secret_contracts_v1_v010_test.go │ │ ├── staking_test.go │ │ ├── test_common.go │ │ ├── test_fuzz.go │ │ ├── testdata │ │ │ ├── bench_contract.wasm │ │ │ ├── burner.wasm │ │ │ ├── contract-v2.wasm │ │ │ ├── contract.wasm │ │ │ ├── contract.wasm.gzip │ │ │ ├── contract_with_floats.wasm │ │ │ ├── dist.wasm │ │ │ ├── erc20.wasm │ │ │ ├── evaporate.wasm │ │ │ ├── genesis.json │ │ │ ├── gov.wasm │ │ │ ├── hackatom.wasm │ │ │ ├── ibc.wasm │ │ │ ├── migrate_contract_v1.wasm │ │ │ ├── migrate_contract_v2.wasm │ │ │ ├── mint.wasm │ │ │ ├── plaintext_logs.wasm │ │ │ ├── reflect.wasm │ │ │ ├── staking.wasm │ │ │ ├── static-too-high-initial-memory.wasm │ │ │ ├── test_gzip_contract.wasm.gz │ │ │ ├── test_gzip_contract_raw.wasm │ │ │ ├── too-high-initial-memory.wasm │ │ │ ├── v1-contract-2.wasm │ │ │ ├── v1-contract-3.wasm │ │ │ ├── v1-contract-v2.wasm │ │ │ ├── v1-contract.wasm │ │ │ └── v1_random_test.wasm │ │ └── wasm_snapshotter.go │ └── types │ │ ├── ante.go │ │ ├── codec.go │ │ ├── context.go │ │ ├── errors.go │ │ ├── events.go │ │ ├── expected_keepers.go │ │ ├── exported_keepers.go │ │ ├── gas.go │ │ ├── gas_store.go │ │ ├── gas_store_test.go │ │ ├── genesis.go │ │ ├── genesis.pb.go │ │ ├── genesis_test.go │ │ ├── keys.go │ │ ├── msg.go │ │ ├── msg.pb.go │ │ ├── msg_test.go │ │ ├── params.go │ │ ├── params.pb.go │ │ ├── query.pb.go │ │ ├── query.pb.gw.go │ │ ├── test_fixtures.go │ │ ├── types.go │ │ ├── types.pb.go │ │ ├── types_test.go │ │ └── validation.go ├── migrations │ ├── v106 │ │ └── types.go │ └── v120 │ │ ├── migrate.go │ │ └── types.go ├── module.go └── testdata │ └── escrow_0.7.wasm ├── emergencybutton ├── alias.go ├── client │ ├── cli │ │ ├── query.go │ │ └── tx.go │ ├── grpc │ │ └── grpc_query.go │ └── querier.go ├── exported │ └── exported.go ├── ibc_middleware.go ├── keeper │ ├── genesis.go │ ├── keeper.go │ ├── migrator.go │ ├── msg_server.go │ └── params.go ├── migrations │ └── v2 │ │ └── migrate.go ├── module.go └── types │ ├── codec.go │ ├── errors.go │ ├── genesis.go │ ├── genesis.pb.go │ ├── keys.go │ ├── legacy_params.go │ ├── msgs.go │ ├── params.go │ ├── params.pb.go │ ├── query.pb.go │ ├── query.pb.gw.go │ └── tx.pb.go ├── ibc-hooks ├── .cargo │ └── config ├── README.md ├── client │ └── cli │ │ └── query.go ├── hooks.go ├── ibc_module.go ├── ics4_middleware.go ├── keeper │ └── keeper.go ├── sdkmodule.go ├── types │ ├── errors.go │ └── keys.go └── wasm_hook.go └── registration ├── README.md ├── alias.go ├── client └── cli │ ├── query.go │ └── tx.go ├── handler.go ├── internal ├── keeper │ ├── enclave │ │ └── enclave.go │ ├── enclave_interface.go │ ├── genesis.go │ ├── genesis_test.go │ ├── ioutil.go │ ├── ioutil_test.go │ ├── keeper.go │ ├── keeper_test.go │ ├── mock │ │ └── enclave.go │ ├── msg_server.go │ ├── querier.go │ ├── querier_test.go │ ├── registration.go │ ├── test_common.go │ └── testdata │ │ └── contract.wasm └── types │ ├── codec.go │ ├── errors.go │ ├── genesis.go │ ├── genesis.pb.go │ ├── keys.go │ ├── msg.go │ ├── msg.pb.go │ ├── msg_test.go │ ├── query.pb.go │ ├── query.pb.gw.go │ ├── reg_keys.go │ ├── reg_keys_secretcli.go │ ├── types.go │ └── types.pb.go ├── migrations ├── v106 │ └── types.go ├── v120 │ ├── migrate.go │ └── types.go └── v170 │ ├── migrate.go │ └── types.go ├── module.go ├── module_test.go ├── remote_attestation ├── corpus │ ├── 0 │ ├── 1 │ └── 2 ├── fuzz_test.go ├── ra_test.go ├── remote_attestation.go ├── reset_fuzzing.sh ├── types.go ├── types.pb.go └── utils.go └── testdata ├── attestation_cert_hw_old ├── attestation_cert_hw_v2 ├── attestation_cert_invalid ├── attestation_cert_sw ├── attestation_cert_sw.combined └── escrow.wasm /.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile* 2 | docker-compose* 3 | docs 4 | *.md 5 | **/target 6 | **/*.a 7 | 8 | **/Enclave_t.* 9 | **/Enclave_u.* 10 | third_party/vendor 11 | *.bin 12 | 13 | .gitpod.yml 14 | .golangci.yml 15 | azure-pipelines.yml 16 | sn-logo.png 17 | README.md 18 | .gitignore 19 | 20 | .vscode 21 | .github 22 | .git 23 | .idea 24 | **/.idea 25 | 26 | cosmwasm-js 27 | -------------------------------------------------------------------------------- /.env.local: -------------------------------------------------------------------------------- 1 | API_KEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 2 | SPID=00000000000000000000000000000000 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Cashmaney @toml01 @liorbond @valdok 2 | -------------------------------------------------------------------------------- /.github/actions/check-objdump/README.md: -------------------------------------------------------------------------------- 1 | # install-rust 2 | 3 | A small github action to check the number of sfence/lfence instructions to validate the appearance of compiler flags 4 | -------------------------------------------------------------------------------- /.github/actions/check-objdump/dist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /.github/actions/check-objdump/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@actions/core": "^1.10.0", 4 | "node-fetch": "3.3.1" 5 | }, 6 | "devDependencies": { 7 | "@vercel/ncc": "^0.36.1" 8 | }, 9 | "name": "actions-check-objdump", 10 | "scripts": { 11 | "build": "ncc build" 12 | }, 13 | "type": "module", 14 | "keywords": [ 15 | "github", 16 | "actions" 17 | ], 18 | "version": "1.3.0", 19 | "description": "", 20 | "main": "index.js", 21 | "repository": "", 22 | "author": "", 23 | "license": "MIT", 24 | "private": true 25 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | 8 | - package-ecosystem: gomod 9 | directory: "/" 10 | schedule: 11 | interval: daily 12 | 13 | - package-ecosystem: npm 14 | directory: "/" 15 | schedule: 16 | interval: daily 17 | 18 | - package-ecosystem: cargo 19 | directory: "/cosmwasm" 20 | schedule: 21 | interval: daily 22 | 23 | - package-ecosystem: gitsubmodule 24 | schedule: 25 | interval: "daily" 26 | directory: "/" -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/incubator-teaclave-sgx-sdk"] 2 | path = third_party/incubator-teaclave-sgx-sdk 3 | url = https://github.com/scrtlabs/incubator-teaclave-sgx-sdk 4 | branch = secret-1.x 5 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: ghcr.io/scrtlabs/secretnetwork-dev:latest 2 | 3 | tasks: 4 | - name: set up permissions 5 | command: | 6 | sudo chown gitpod:gitpod /go -R 7 | sudo chown gitpod:gitpod /usr/local/cargo -R 8 | export SCRT_ENCLAVE_DIR=/workspace/SecretNetwork/go-cosmwasm/ 9 | 10 | vscode: 11 | extensions: 12 | - rust-lang.rust 13 | - vadimcn.vscode-lldb 14 | - serayuzgur.crates 15 | - bungcip.better-toml 16 | - golang.Go 17 | 18 | jetbrains: 19 | goland: 20 | prebuilds: 21 | version: stable -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | timeout: 5m 4 | issues: 5 | exclude-files: 6 | - x/compute/internal/keeper/test_common.go 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["golang.go", "peterj.proto", "rust-lang.rust-analyzer"] 3 | } 4 | -------------------------------------------------------------------------------- /buf.gen.swagger.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | plugins: 3 | - name: swagger 4 | out: ./tmp-swagger-gen 5 | opt: 6 | - logtostderr=true 7 | - fqn_for_swagger_name=true 8 | - simple_operation_ids=true 9 | strategy: all -------------------------------------------------------------------------------- /buf.work.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | directories: 3 | - proto -------------------------------------------------------------------------------- /buf.yaml: -------------------------------------------------------------------------------- 1 | # This module represents buf.build/cosmos/cosmos-sdk 2 | version: v1 3 | deps: 4 | - buf.build/cosmos/cosmos-proto 5 | - buf.build/cosmos/cosmos-sdk 6 | - buf.build/cosmos/gogo-proto 7 | - buf.build/googleapis/googleapis 8 | breaking: 9 | use: 10 | - FILE 11 | lint: 12 | use: 13 | - DEFAULT 14 | - COMMENTS 15 | - FILE_LOWER_SNAKE_CASE 16 | except: 17 | - UNARY_RPC 18 | - COMMENT_FIELD 19 | - SERVICE_SUFFIX 20 | - PACKAGE_VERSION_SUFFIX 21 | - RPC_REQUEST_STANDARD_NAME 22 | ignore: 23 | - tendermint 24 | -------------------------------------------------------------------------------- /check-hw/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | check-hw 3 | build -------------------------------------------------------------------------------- /check-hw/Makefile: -------------------------------------------------------------------------------- 1 | FEATURES ?= 2 | 3 | all: 4 | cargo build --release --features "$(FEATURES)" 5 | cp target/release/check-hw . 6 | 7 | clean: 8 | cargo clean 9 | rm -f check-hw check_hw_enclave.so 10 | 11 | # Enforce HW because SW doesn't make sense 12 | clippy: 13 | SGX_MODE=HW cargo clippy -------------------------------------------------------------------------------- /check-hw/README.md: -------------------------------------------------------------------------------- 1 | # Check hardware tool 2 | 3 | ## How to run 4 | 5 | Extract `check_hw_.tar.gz`: 6 | 7 | ```bash 8 | tar -xzf check_hw_.tar.gz 9 | ``` 10 | 11 | Run the `check-hw` tool: 12 | 13 | ```bash 14 | cd check-hw/ 15 | LOG_LEVEL=WARN ./check-hw 16 | ``` 17 | 18 | If your machine is compatible and patched, you should get: 19 | 20 | ```bash 21 | Creating enclave instance.. 22 | Platform Okay! 23 | ``` 24 | -------------------------------------------------------------------------------- /check-hw/rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2023-03-13 -------------------------------------------------------------------------------- /client/docs/static/swagger/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/client/docs/static/swagger/favicon-16x16.png -------------------------------------------------------------------------------- /client/docs/static/swagger/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/client/docs/static/swagger/favicon-32x32.png -------------------------------------------------------------------------------- /client/docs/statik/init.go: -------------------------------------------------------------------------------- 1 | package statik 2 | 3 | // This just for fixing the error in importing empty github.com/cosmos/cosmos-sdk/client/docs/statik 4 | -------------------------------------------------------------------------------- /cmd/secretd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" 7 | "github.com/scrtlabs/SecretNetwork/app" 8 | ) 9 | 10 | func main() { 11 | rootCmd, _ := NewRootCmd() 12 | if err := svrcmd.Execute(rootCmd, "SECRET_NETWORK", app.DefaultNodeHome); err != nil { 13 | os.Exit(1) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | 13 | [*.py] 14 | indent_size = 4 15 | -------------------------------------------------------------------------------- /cosmwasm/.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | .DS_Store 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # Build results 8 | target/ 9 | artifacts/ 10 | 11 | # IDEs 12 | .vscode/ 13 | .idea/ 14 | *.iml 15 | 16 | # Auto-gen 17 | .cargo-ok 18 | 19 | # Log files (e.g. memory profiling) 20 | *.log 21 | -------------------------------------------------------------------------------- /cosmwasm/.prettierignore: -------------------------------------------------------------------------------- 1 | # Used for *.md formatting in devtools/format_md.sh 2 | target/ 3 | -------------------------------------------------------------------------------- /cosmwasm/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": "*.md", 5 | "options": { 6 | "proseWrap": "always" 7 | } 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /cosmwasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["packages/*"] 3 | exclude = ["enclaves", "contracts/v010", "contracts/v1"] 4 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/README.md: -------------------------------------------------------------------------------- 1 | # Burner Contract 2 | 3 | This is a simple contract to demonstrate using migrations to shutdown (or 4 | "burn") contracts using the migration feature added in CosmWasm 0.9. 5 | 6 | This contract cannot be installed directly (via `init`), but is only designed to 7 | be used for `migrate`. When migrating any existing contract to this burner 8 | contract, we delete all storage and send all bank tokens to a specified address, 9 | doing a basic cleanup of the contract. 10 | 11 | You can use this contract as-is, or fork it and customize it more if you want to 12 | do more detailed cleanup. 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/schema/handle_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "HandleMsg", 4 | "description": "HandleMsg is a placeholder where we don't take any input", 5 | "type": "object" 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/schema/init_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InitMsg", 4 | "description": "InitMsg is a placeholder where we don't take any input", 5 | "type": "object" 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/schema/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "payout" 7 | ], 8 | "properties": { 9 | "payout": { 10 | "$ref": "#/definitions/HumanAddr" 11 | } 12 | }, 13 | "definitions": { 14 | "HumanAddr": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/schema/query_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "description": "QueryMsg is a placeholder where we don't take any input", 5 | "type": "object" 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/burner/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | cosmwasm_std::create_entry_points_with_migration!(contract); 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract-v2/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /x/compute/internal/keeper/testdata/test-contract/target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract-v2/Makefile: -------------------------------------------------------------------------------- 1 | Rust_Crate_Source := $(shell find -type f | grep -P '(\.rs|\.toml|\.lock)$$' | grep -vP '^\./target') 2 | 3 | .PHONY: all 4 | all: contract.wasm 5 | 6 | contract.wasm: $(Rust_Crate_Source) 7 | rustup target add wasm32-unknown-unknown 8 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 9 | rm -f ./contract-v2.wasm 10 | mv -f ./target/wasm32-unknown-unknown/release/test_contract_v2.wasm ./contract-v2.wasm 11 | 12 | setup: 13 | apt-get install wabt 14 | 15 | clean: 16 | cargo clean 17 | -rm -f ./*.wasm 18 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract-v2/README.md: -------------------------------------------------------------------------------- 1 | Just `make`. :rainbow: 2 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract-v2/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rerun-if-changed=./src/contract.rs"); 3 | } 4 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /x/compute/internal/keeper/testdata/test-contract/target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract/README.md: -------------------------------------------------------------------------------- 1 | Just `make`. :rainbow: 2 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rerun-if-changed=./src/contract.rs"); 3 | } 4 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/compute-tests/test-compute-contract/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.71 2 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/dist/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::HumanAddr; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InitMsg {} 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum HandleMsg { 12 | Rewards { address: HumanAddr }, 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | unit-test = "test --lib --features backtraces" 4 | integration-test = "test --test integration" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/.gitignore: -------------------------------------------------------------------------------- 1 | # Rust build system 2 | target/ 3 | 4 | # IDE: IntelliJ IDEA 5 | .idea/ 6 | *.iml 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Simon Warta 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/README.md: -------------------------------------------------------------------------------- 1 | # An ERC20 token contract 2 | 3 | This is an implementation of Ethereum's [ERC20](https://eips.ethereum.org/EIPS/eip-20) interface. 4 | Please note that ERC20 has some fundamental flaws, many of which have been resolved with [ERC777](https://eips.ethereum.org/EIPS/eip-777). 5 | This projects intents to serve as a simple example that token developers can familiarize with easily, not as a modern token contract. 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/schema/allowance_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AllowanceResponse", 4 | "type": "object", 5 | "required": [ 6 | "allowance" 7 | ], 8 | "properties": { 9 | "allowance": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/schema/balance_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "BalanceResponse", 4 | "type": "object", 5 | "required": [ 6 | "balance" 7 | ], 8 | "properties": { 9 | "balance": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/schema/constants.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Constants", 4 | "type": "object", 5 | "required": [ 6 | "decimals", 7 | "name", 8 | "symbol" 9 | ], 10 | "properties": { 11 | "decimals": { 12 | "type": "integer", 13 | "format": "uint8", 14 | "minimum": 0.0 15 | }, 16 | "name": { 17 | "type": "string" 18 | }, 19 | "symbol": { 20 | "type": "string" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/erc20/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(test)] 5 | mod tests; 6 | 7 | #[cfg(target_arch = "wasm32")] 8 | cosmwasm_std::create_entry_points!(contract); 9 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | unit-test = "test --lib --features backtraces" 4 | integration-test = "test --test integration" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | *.iml 4 | .idea 5 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Ethan Frey 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/escrow/schema/query_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "enum": [] 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/gov/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 5 | pub struct InitMsg {} 6 | 7 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 8 | #[serde(rename_all = "snake_case")] 9 | pub enum HandleMsg { 10 | Proposals {}, 11 | Vote {}, 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/hackatom/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/hackatom/schema/init_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InitMsg", 4 | "type": "object", 5 | "required": [ 6 | "beneficiary", 7 | "verifier" 8 | ], 9 | "properties": { 10 | "beneficiary": { 11 | "$ref": "#/definitions/HumanAddr" 12 | }, 13 | "verifier": { 14 | "$ref": "#/definitions/HumanAddr" 15 | } 16 | }, 17 | "definitions": { 18 | "HumanAddr": { 19 | "type": "string" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/hackatom/schema/verifier_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifierResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifier" 7 | ], 8 | "properties": { 9 | "verifier": { 10 | "$ref": "#/definitions/HumanAddr" 11 | } 12 | }, 13 | "definitions": { 14 | "HumanAddr": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/hackatom/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | cosmwasm_std::create_entry_points_with_migration!(contract); 5 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/mint/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 5 | pub struct InitMsg {} 6 | 7 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 8 | #[serde(rename_all = "snake_case")] 9 | pub enum HandleMsg { 10 | InflationRate {}, 11 | BondedRatio {}, 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/plaintext-logs/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/plaintext-logs/.gitignore: -------------------------------------------------------------------------------- 1 | contract.wasm.gz 2 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/plaintext-logs/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | cosmwasm_std::create_entry_points!(contract); 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/plaintext-logs/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// InitMsg is a placeholder where we don't take any input 5 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 6 | pub struct InitMsg {} 7 | 8 | /// HandleMsg is a placeholder where we don't take any input 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | pub struct HandleMsg {} 11 | 12 | /// QueryMsg is a placeholder where we don't take any input 13 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 14 | pub struct QueryMsg {} 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/schema/count_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "CountResponse", 4 | "type": "object", 5 | "required": [ 6 | "count" 7 | ], 8 | "properties": { 9 | "count": { 10 | "type": "integer", 11 | "format": "uint32", 12 | "minimum": 0.0 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/schema/init_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InitMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/schema/item.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Item", 4 | "type": "object", 5 | "required": [ 6 | "value" 7 | ], 8 | "properties": { 9 | "value": { 10 | "type": "integer", 11 | "format": "int32" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/schema/sum_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "SumResponse", 4 | "type": "object", 5 | "required": [ 6 | "sum" 7 | ], 8 | "properties": { 9 | "sum": { 10 | "type": "integer", 11 | "format": "int32" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/queue/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | 3 | #[cfg(target_arch = "wasm32")] 4 | cosmwasm_std::create_entry_points!(contract); 5 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/schema/init_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InitMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/schema/owner_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "OwnerResponse", 4 | "type": "object", 5 | "required": [ 6 | "owner" 7 | ], 8 | "properties": { 9 | "owner": { 10 | "$ref": "#/definitions/HumanAddr" 11 | } 12 | }, 13 | "definitions": { 14 | "HumanAddr": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/reflect/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | 5 | #[cfg(not(target_arch = "wasm32"))] 6 | pub mod testing; 7 | 8 | #[cfg(target_arch = "wasm32")] 9 | cosmwasm_std::create_entry_points!(contract); 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/contracts/v010/staking/contract.wasm -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/contract.wasm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/contracts/v010/staking/contract.wasm.gz -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/schema/balance_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "BalanceResponse", 4 | "type": "object", 5 | "required": [ 6 | "balance" 7 | ], 8 | "properties": { 9 | "balance": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/schema/claims_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ClaimsResponse", 4 | "type": "object", 5 | "required": [ 6 | "claims" 7 | ], 8 | "properties": { 9 | "claims": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v010/staking/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | 5 | #[cfg(target_arch = "wasm32")] 6 | cosmwasm_std::create_entry_points!(contract); 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/README.md: -------------------------------------------------------------------------------- 1 | # Burner Contract 2 | 3 | This is a simple contract to demonstrate using migrations to shutdown (or 4 | "burn") contracts using the migration feature added in CosmWasm 0.9. 5 | 6 | This contract cannot be installed directly (via `instantiate`), but is only 7 | designed to be used for `migrate`. When migrating any existing contract to this 8 | burner contract, we delete all storage and send all bank tokens to a specified 9 | address, doing a basic cleanup of the contract. 10 | 11 | You can use this contract as-is, or fork it and customize it more if you want to 12 | do more detailed cleanup. 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::env::current_dir; 2 | use std::fs::create_dir_all; 3 | 4 | use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; 5 | 6 | use burner::msg::{InstantiateMsg, MigrateMsg}; 7 | 8 | fn main() { 9 | let mut out_dir = current_dir().unwrap(); 10 | out_dir.push("schema"); 11 | create_dir_all(&out_dir).unwrap(); 12 | remove_schemas(&out_dir).unwrap(); 13 | 14 | export_schema(&schema_for!(InstantiateMsg), &out_dir); 15 | export_schema(&schema_for!(MigrateMsg), &out_dir); 16 | } 17 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "A placeholder where we don't take any input", 5 | "type": "object" 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/schema/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "payout" 7 | ], 8 | "properties": { 9 | "payout": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/burner/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 5 | pub struct MigrateMsg { 6 | pub payout: String, 7 | } 8 | 9 | /// A placeholder where we don't take any input 10 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 11 | pub struct InstantiateMsg {} 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src src src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | cp ./target/wasm32-unknown-unknown/release/bench_contract.wasm ./bench_contract.wasm 5 | cp ./target/wasm32-unknown-unknown/release/bench_contract.wasm ../../../../../x/compute/internal/keeper/testdata/bench_contract.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./v1-contract.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.63 -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/src/benches/cpu.rs: -------------------------------------------------------------------------------- 1 | use sha2::{Digest, Sha256}; 2 | 3 | // use crate::msg::BenchResponse; 4 | use cosmwasm_std::StdError; 5 | 6 | const BENCH_NAME: &str = "bench_cpu_sha256"; 7 | 8 | pub fn do_cpu_loop(num_of_runs: usize) -> Result<(), StdError> { 9 | let mut hashed: Vec = BENCH_NAME.into(); 10 | for _i in 1..num_of_runs { 11 | hashed = Sha256::digest(&hashed).to_vec() 12 | } 13 | 14 | Ok(()) 15 | // Ok(BenchResponse { 16 | // name: BENCH_NAME.to_string(), 17 | // time: 0, 18 | // }) 19 | } 20 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod benches; 2 | pub mod contract; 3 | pub mod msg; 4 | pub mod state; 5 | mod viewing_key_obj; 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/bench-contract/src/viewing_key_obj.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, JsonSchema, Clone, Debug)] 5 | pub struct ViewingKeyObj(pub String); 6 | 7 | impl ViewingKeyObj { 8 | pub fn as_bytes(&self) -> &[u8] { 9 | self.0.as_bytes() 10 | } 11 | 12 | pub fn as_str(&self) -> &str { 13 | self.0.as_str() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/evaporation/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src src src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | cp ./target/wasm32-unknown-unknown/release/evaporate_contract_example.wasm ./evaporate_contract_example.wasm 5 | cp ./target/wasm32-unknown-unknown/release/evaporate_contract_example.wasm ../../../../../x/compute/internal/keeper/testdata/evaporate.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./v1-contract.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/evaporation/evaporate_contract_example.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/contracts/v1/compute-tests/evaporation/evaporate_contract_example.wasm -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/evaporation/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/evaporation/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)] 5 | pub enum InstantiateMsg { 6 | Nop {}, 7 | } 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum ExecuteMsg { 12 | Evaporate { amount: u32 }, 13 | CheckGas {}, 14 | UseExact { amount: u32 }, 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src/lib.rs src/msg.rs src/state.rs Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./ibc.wasm 5 | mv -f ./target/wasm32-unknown-unknown/release/ibc.wasm ./ibc.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./ibc.wasm -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.61 -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] 5 | #[serde(rename_all = "snake_case")] 6 | pub enum InstantiateMsg { 7 | Init {}, 8 | } 9 | 10 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] 11 | #[serde(rename_all = "snake_case")] 12 | pub enum ExecuteMsg { 13 | Increment { addition: u64 }, 14 | } 15 | 16 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 17 | #[serde(rename_all = "snake_case")] 18 | pub enum QueryMsg { 19 | Q {}, 20 | } 21 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/ibc-test-contract/src/state.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Storage}; 2 | use cosmwasm_storage::{ 3 | singleton, singleton_read, ReadonlySingleton, Singleton, 4 | }; 5 | 6 | pub const COUNT_KEY: &[u8] = b"count"; 7 | 8 | pub fn count(storage: &mut dyn Storage) -> Singleton { 9 | singleton(storage, COUNT_KEY) 10 | } 11 | 12 | pub fn count_read(storage: &dyn Storage) -> ReadonlySingleton { 13 | singleton_read(storage, COUNT_KEY) 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v1/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./migrate_contract_v1.wasm 5 | mv ./target/wasm32-unknown-unknown/release/migrate_contract_v1.wasm ./migrate_contract_v1.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./*.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v1/migrate_contract_v1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/contracts/v1/compute-tests/migration/contract-v1/migrate_contract_v1.wasm -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v1/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v1/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)] 5 | pub enum InstantiateMsg { 6 | Nop {}, 7 | } 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum ExecuteMsg { 12 | Test { }, 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v2/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./migrate_contract_v2.wasm 5 | mv ./target/wasm32-unknown-unknown/release/migrate_contract_v2.wasm ./migrate_contract_v2.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./*.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v2/migrate_contract_v2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/contracts/v1/compute-tests/migration/contract-v2/migrate_contract_v2.wasm -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/migration/contract-v2/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./v1_random_test.wasm 5 | mv -f ./target/wasm32-unknown-unknown/release/v1_random_test.wasm ./v1_random_test.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./v1_random_test.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.71 -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] 5 | #[serde(rename_all = "snake_case")] 6 | pub enum InstantiateMsg { 7 | GetEnv {}, 8 | } 9 | 10 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] 11 | #[serde(rename_all = "snake_case")] 12 | pub enum ExecuteMsg { 13 | GetEnv {}, 14 | } 15 | 16 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 17 | #[serde(rename_all = "snake_case")] 18 | pub enum QueryMsg { 19 | GetEnv {}, 20 | } 21 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/random-test/src/state.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Storage}; 2 | use cosmwasm_storage::{ 3 | singleton, singleton_read, ReadonlySingleton, Singleton, 4 | }; 5 | 6 | pub const EXPIRATION_KEY: &[u8] = b"expire"; 7 | 8 | pub fn expiration(storage: &mut dyn Storage) -> Singleton { 9 | singleton(storage, EXPIRATION_KEY) 10 | } 11 | 12 | pub fn expiration_read(storage: &dyn Storage) -> ReadonlySingleton { 13 | singleton_read(storage, EXPIRATION_KEY) 14 | } 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract-v2/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract-v2/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src src src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./v1-contract-v2.wasm 5 | mv -f ./target/wasm32-unknown-unknown/release/v1_sanity_contract_v2.wasm ./v1-contract-v2.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./v1-contract.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract-v2/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.71 -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract-v2/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src src src Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | rm -f ./v1-contract.wasm 5 | mv -f ./target/wasm32-unknown-unknown/release/v1_sanity_contract.wasm ./v1-contract.wasm 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./v1-contract.wasm 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.71 -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/compute-tests/test-compute-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/crypto-verify/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/crypto-verify/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::env::current_dir; 2 | use std::fs::create_dir_all; 3 | 4 | use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; 5 | 6 | use crypto_verify::msg::{InstantiateMsg, QueryMsg}; 7 | 8 | fn main() { 9 | let mut out_dir = current_dir().unwrap(); 10 | out_dir.push("schema"); 11 | create_dir_all(&out_dir).unwrap(); 12 | remove_schemas(&out_dir).unwrap(); 13 | 14 | export_schema(&schema_for!(InstantiateMsg), &out_dir); 15 | export_schema(&schema_for!(QueryMsg), &out_dir); 16 | } 17 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/crypto-verify/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/crypto-verify/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod ethereum; 3 | pub mod msg; 4 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/debug-print/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/debug-print/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | cosmwasm_std::create_entry_points!(contract); 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/debug-print/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// InitMsg is a placeholder where we don't take any input 5 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 6 | pub struct InitMsg {} 7 | 8 | /// HandleMsg is a placeholder where we don't take any input 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | pub struct HandleMsg {} 11 | 12 | /// QueryMsg is a placeholder where we don't take any input 13 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 14 | pub struct QueryMsg {} 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/dist/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::{Binary, CosmosMsg, HumanAddr, QueryRequest}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InitMsg {} 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum HandleMsg { 12 | Rewards { address: HumanAddr }, 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | unit-test = "test --lib --features backtraces" 4 | integration-test = "test --test integration" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/.gitignore: -------------------------------------------------------------------------------- 1 | # Rust build system 2 | target/ 3 | 4 | # IDE: IntelliJ IDEA 5 | .idea/ 6 | *.iml 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Simon Warta 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/README.md: -------------------------------------------------------------------------------- 1 | # An ERC20 token contract 2 | 3 | This is an implementation of Ethereum's [ERC20](https://eips.ethereum.org/EIPS/eip-20) interface. 4 | Please note that ERC20 has some fundamental flaws, many of which have been resolved with [ERC777](https://eips.ethereum.org/EIPS/eip-777). 5 | This projects intents to serve as a simple example that token developers can familiarize with easily, not as a modern token contract. 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/schema/allowance_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AllowanceResponse", 4 | "type": "object", 5 | "required": [ 6 | "allowance" 7 | ], 8 | "properties": { 9 | "allowance": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/schema/balance_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "BalanceResponse", 4 | "type": "object", 5 | "required": [ 6 | "balance" 7 | ], 8 | "properties": { 9 | "balance": { 10 | "$ref": "#/definitions/Uint128" 11 | } 12 | }, 13 | "definitions": { 14 | "Uint128": { 15 | "type": "string" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/schema/constants.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Constants", 4 | "type": "object", 5 | "required": [ 6 | "decimals", 7 | "name", 8 | "symbol" 9 | ], 10 | "properties": { 11 | "decimals": { 12 | "type": "integer", 13 | "format": "uint8", 14 | "minimum": 0.0 15 | }, 16 | "name": { 17 | "type": "string" 18 | }, 19 | "symbol": { 20 | "type": "string" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/erc20/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(test)] 5 | mod tests; 6 | 7 | #[cfg(target_arch = "wasm32")] 8 | cosmwasm_std::create_entry_points!(contract); 9 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | unit-test = "test --lib --features backtraces" 4 | integration-test = "test --test integration" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | *.iml 4 | .idea 5 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Ethan Frey 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/escrow/schema/query_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "enum": [] 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/schema/execute_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "anyOf": [ 5 | { 6 | "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", 7 | "type": "object", 8 | "required": [ 9 | "release" 10 | ], 11 | "properties": { 12 | "release": { 13 | "type": "object" 14 | } 15 | }, 16 | "additionalProperties": false 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "required": [ 6 | "beneficiary", 7 | "verifier" 8 | ], 9 | "properties": { 10 | "beneficiary": { 11 | "type": "string" 12 | }, 13 | "verifier": { 14 | "type": "string" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/schema/verifier_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifierResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifier" 7 | ], 8 | "properties": { 9 | "verifier": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum HackError { 6 | #[error("{0}")] 7 | /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error 8 | Std(#[from] StdError), 9 | // this is whatever we want 10 | #[error("Unauthorized")] 11 | Unauthorized {}, 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/floaty/src/state.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::Addr; 5 | 6 | pub const CONFIG_KEY: &[u8] = b"config"; 7 | 8 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 9 | pub struct State { 10 | pub verifier: Addr, 11 | pub beneficiary: Addr, 12 | pub funder: Addr, 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/gov/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::{Binary, CosmosMsg, HumanAddr, QueryRequest}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InitMsg {} 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum HandleMsg { 12 | Proposals {}, 13 | Vote {}, 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "required": [ 6 | "beneficiary", 7 | "verifier" 8 | ], 9 | "properties": { 10 | "beneficiary": { 11 | "type": "string" 12 | }, 13 | "verifier": { 14 | "type": "string" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/schema/verifier_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifierResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifier" 7 | ], 8 | "properties": { 9 | "verifier": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum HackError { 6 | #[error("{0}")] 7 | /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error 8 | Std(#[from] StdError), 9 | // this is whatever we want 10 | #[error("Unauthorized")] 11 | Unauthorized {}, 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | 6 | #[cfg(target_arch = "wasm32")] 7 | cosmwasm_std::create_entry_points_with_migration!(contract); 8 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/hackatom/src/state.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::Addr; 5 | 6 | pub const CONFIG_KEY: &[u8] = b"config"; 7 | 8 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 9 | pub struct State { 10 | pub verifier: Addr, 11 | pub beneficiary: Addr, 12 | pub funder: Addr, 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect-send/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect-send/schema/admin_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AdminResponse", 4 | "type": "object", 5 | "required": [ 6 | "admin" 7 | ], 8 | "properties": { 9 | "admin": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect-send/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "This needs no info. Owner of the contract is whoever signed the InstantiateMsg.", 5 | "type": "object" 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect-send/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod ibc; 3 | pub mod ibc_msg; 4 | pub mod msg; 5 | pub mod state; 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "Just needs to know the code_id of a reflect contract to spawn sub-accounts", 5 | "type": "object", 6 | "required": [ 7 | "reflect_code_id" 8 | ], 9 | "properties": { 10 | "reflect_code_id": { 11 | "type": "integer", 12 | "format": "uint64", 13 | "minimum": 0.0 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/ibc-reflect/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked 3 | ## The following line is not necessary, may work only on linux (extra size optimization) 4 | wasm-opt -Os ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm 5 | cat ./contract.wasm | gzip -9 > ./contract.wasm.gz 6 | 7 | clean: 8 | cargo clean 9 | -rm -f ./contract.wasm ./contract.wasm.gz 10 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/mint/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::{Binary, CosmosMsg, HumanAddr, QueryRequest}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InitMsg {} 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum HandleMsg { 12 | InflationRate {}, 13 | BondedRatio {}, 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/plaintext-logs/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib --features backtraces" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/plaintext-logs/.gitignore: -------------------------------------------------------------------------------- 1 | contract.wasm.gz 2 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/plaintext-logs/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | cosmwasm_std::create_entry_points!(contract); 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/plaintext-logs/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// InitMsg is a placeholder where we don't take any input 5 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 6 | pub struct InitMsg {} 7 | 8 | /// HandleMsg is a placeholder where we don't take any input 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | pub struct HandleMsg {} 11 | 12 | /// QueryMsg is a placeholder where we don't take any input 13 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 14 | pub struct QueryMsg {} 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/schema/count_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "CountResponse", 4 | "type": "object", 5 | "required": [ 6 | "count" 7 | ], 8 | "properties": { 9 | "count": { 10 | "type": "integer", 11 | "format": "uint32", 12 | "minimum": 0.0 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/schema/item.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Item", 4 | "type": "object", 5 | "required": [ 6 | "value" 7 | ], 8 | "properties": { 9 | "value": { 10 | "type": "integer", 11 | "format": "int32" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/schema/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/schema/sum_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "SumResponse", 4 | "type": "object", 5 | "required": [ 6 | "sum" 7 | ], 8 | "properties": { 9 | "sum": { 10 | "type": "integer", 11 | "format": "int32" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | 4 | #[cfg(target_arch = "wasm32")] 5 | cosmwasm_std::create_entry_points!(contract); 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/queue/src/msg.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 5 | pub struct InstantiateMsg {} 6 | 7 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 8 | pub struct MigrateMsg {} 9 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # macOS 8 | .DS_Store 9 | 10 | # IDEs 11 | *.iml 12 | .idea 13 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/schema/capitalized_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "CapitalizedResponse", 4 | "type": "object", 5 | "required": [ 6 | "text" 7 | ], 8 | "properties": { 9 | "text": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/schema/chain_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ChainResponse", 4 | "type": "object", 5 | "required": [ 6 | "data" 7 | ], 8 | "properties": { 9 | "data": { 10 | "$ref": "#/definitions/Binary" 11 | } 12 | }, 13 | "definitions": { 14 | "Binary": { 15 | "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", 16 | "type": "string" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/schema/instantiate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object" 5 | } 6 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/schema/owner_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "OwnerResponse", 4 | "type": "object", 5 | "required": [ 6 | "owner" 7 | ], 8 | "properties": { 9 | "owner": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum ReflectError { 6 | #[error("{0}")] 7 | // let thiserror implement From for you 8 | Std(#[from] StdError), 9 | // this is whatever we want 10 | #[error("Permission denied: the sender is not the current owner")] 11 | NotCurrentOwner { expected: String, actual: String }, 12 | #[error("Messages empty. Must reflect at least one message")] 13 | MessagesEmpty, 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/reflect/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | 6 | #[cfg(not(target_arch = "wasm32"))] 7 | pub mod testing; 8 | 9 | #[cfg(target_arch = "wasm32")] 10 | cosmwasm_std::create_entry_points!(contract); 11 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/staking/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --example schema" 7 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/staking/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | 6 | # unstable... should we require `rustup run nightly cargo fmt` ? 7 | # or just update the style guide when they are stable? 8 | #fn_single_line = true 9 | #format_code_in_doc_comments = true 10 | #overflow_delimited_expr = true 11 | #reorder_impl_items = true 12 | #struct_field_align_threshold = 20 13 | #struct_lit_single_line = true 14 | #report_todo = "Always" 15 | 16 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/staking/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use snafu::Snafu; 3 | 4 | #[derive(Snafu, Debug)] 5 | #[snafu(visibility = "pub(crate)")] 6 | pub enum StakingError { 7 | /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error 8 | #[snafu(display("StdError: {}", original))] 9 | Std { original: StdError }, 10 | #[snafu(display("Unauthorized"))] 11 | Unauthorized { backtrace: Option }, 12 | } 13 | 14 | impl From for StakingError { 15 | fn from(original: StdError) -> Self { 16 | Std { original }.build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cosmwasm/contracts/v1/staking/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /cosmwasm/devtools/check_contracts_fast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | for contract_dir in contracts/*/; do 6 | ( 7 | cd "$contract_dir" 8 | cargo fmt 9 | mkdir -p target/wasm32-unknown-unknown/release/ 10 | touch target/wasm32-unknown-unknown/release/"$(basename "$contract_dir" | tr - _)".wasm 11 | cargo check --tests 12 | ) 13 | done 14 | -------------------------------------------------------------------------------- /cosmwasm/devtools/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | (cd packages/std && cargo clean) 6 | (cd packages/crypto && cargo clean) 7 | (cd packages/storage && cargo clean) 8 | (cd packages/schema && cargo clean) 9 | (cd packages/vm && cargo clean) 10 | -------------------------------------------------------------------------------- /cosmwasm/devtools/clean_contracts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | for contract_dir in contracts/*/; do 6 | (cd "$contract_dir" && cargo clean) 7 | done 8 | -------------------------------------------------------------------------------- /cosmwasm/devtools/format_md.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="write" 7 | while getopts c option; do 8 | case "${option}" in 9 | 10 | c) op="check" ;; 11 | *) ;; 12 | esac 13 | done 14 | 15 | npx prettier@2.2.1 --$op "./**/*.md" 16 | -------------------------------------------------------------------------------- /cosmwasm/devtools/format_sh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="w" 7 | while getopts c option; do 8 | case "${option}" in 9 | 10 | c) op="d" ;; 11 | esac 12 | done 13 | 14 | shfmt -$op devtools packages 15 | -------------------------------------------------------------------------------- /cosmwasm/devtools/format_yml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="write" 7 | while getopts c option; do 8 | case "${option}" in 9 | 10 | c) op="check" ;; 11 | esac 12 | done 13 | 14 | npx prettier@2.2.1 --$op "./**/*.yml" 15 | -------------------------------------------------------------------------------- /cosmwasm/devtools/test_workspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | cargo fmt 6 | (cd packages/crypto && cargo test) 7 | (cd packages/std && cargo test --features iterator) 8 | (cd packages/storage && cargo test --features iterator) 9 | (cd packages/schema && cargo test) 10 | (cd packages/vm && cargo test --features iterator,stargate) 11 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.o 3 | *.h 4 | *.c 5 | lib/ 6 | 7 | !Cargo.lock 8 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/Enclave.config.prod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 3 5 | 0x800000 6 | 0x80000000 7 | 8 8 | 1 9 | 1 10 | 0 11 | 0xFFFFFFFF 12 | 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/Enclave.config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 0 5 | 0x800000 6 | 0x20000000 7 | 8 8 | 1 9 | 0 10 | 0 11 | 0xFFFFFFFF 12 | 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/Enclave.lds: -------------------------------------------------------------------------------- 1 | librust_cosmwasm_enclave.so 2 | { 3 | global: 4 | g_global_data_sim; 5 | g_global_data; 6 | enclave_entry; 7 | local: 8 | *; 9 | }; 10 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/app/v1alpha1/query.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.app.v1alpha1; 4 | 5 | import "cosmos/app/v1alpha1/config.proto"; 6 | 7 | // Query is the app module query service. 8 | service Query { 9 | 10 | // Config returns the current app config. 11 | rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} 12 | } 13 | 14 | // QueryConfigRequest is the Query/Config request type. 15 | message QueryConfigRequest {} 16 | 17 | // QueryConfigRequest is the Query/Config response type. 18 | message QueryConfigResponse { 19 | 20 | // config is the current app config. 21 | Config config = 1; 22 | } 23 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/authz/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.authz.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the authz module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/authz" 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/authz/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | // Since: cosmos-sdk 0.43 2 | syntax = "proto3"; 3 | package cosmos.authz.v1beta1; 4 | 5 | import "gogoproto/gogo.proto"; 6 | import "cosmos/authz/v1beta1/authz.proto"; 7 | import "amino/amino.proto"; 8 | 9 | option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; 10 | 11 | // GenesisState defines the authz module's genesis state. 12 | message GenesisState { 13 | repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/circuit/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.circuit.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the circuit module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/circuit" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/consensus/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.consensus.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the consensus module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/consensus" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/crisis/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.crisis.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the crisis module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/crisis" 11 | }; 12 | 13 | // fee_collector_name is the name of the FeeCollector ModuleAccount. 14 | string fee_collector_name = 1; 15 | 16 | // authority defines the custom module authority. If not set, defaults to the governance module. 17 | string authority = 2; 18 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/crisis/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.crisis.v1beta1; 3 | 4 | option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; 5 | 6 | import "gogoproto/gogo.proto"; 7 | import "cosmos/base/v1beta1/coin.proto"; 8 | import "amino/amino.proto"; 9 | 10 | // GenesisState defines the crisis module's genesis state. 11 | message GenesisState { 12 | // constant_fee is the fee used to verify the invariant in the crisis 13 | // module. 14 | cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/distribution/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.distribution.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the distribution module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/distribution" 11 | }; 12 | 13 | string fee_collector_name = 1; 14 | 15 | // authority defines the custom module authority. If not set, defaults to the governance module. 16 | string authority = 2; 17 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/evidence/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.evidence.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the evidence module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/evidence" 11 | }; 12 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/evidence/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.evidence.v1beta1; 3 | 4 | option go_package = "cosmossdk.io/x/evidence/types"; 5 | 6 | import "google/protobuf/any.proto"; 7 | 8 | // GenesisState defines the evidence module's genesis state. 9 | message GenesisState { 10 | // evidence defines all the evidence at genesis. 11 | repeated google.protobuf.Any evidence = 1; 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/feegrant/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.feegrant.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the feegrant module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/feegrant" 11 | }; 12 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/feegrant/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | // Since: cosmos-sdk 0.43 2 | syntax = "proto3"; 3 | package cosmos.feegrant.v1beta1; 4 | 5 | import "gogoproto/gogo.proto"; 6 | import "cosmos/feegrant/v1beta1/feegrant.proto"; 7 | import "amino/amino.proto"; 8 | 9 | option go_package = "cosmossdk.io/x/feegrant"; 10 | 11 | // GenesisState contains a set of fee allowances, persisted from the store 12 | message GenesisState { 13 | repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/genutil/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.genutil.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object for the genutil module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/genutil" 11 | }; 12 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/genutil/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.genutil.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | import "amino/amino.proto"; 6 | 7 | option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; 8 | 9 | // GenesisState defines the raw genesis transaction in JSON. 10 | message GenesisState { 11 | // gen_txs defines the genesis transactions. 12 | repeated bytes gen_txs = 1 [ 13 | (gogoproto.casttype) = "encoding/json.RawMessage", 14 | (gogoproto.jsontag) = "gentxs", 15 | (amino.field_name) = "gentxs", 16 | (amino.dont_omitempty) = true 17 | ]; 18 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/mint/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.mint.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the mint module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/mint" 11 | }; 12 | 13 | string fee_collector_name = 1; 14 | 15 | // authority defines the custom module authority. If not set, defaults to the governance module. 16 | string authority = 2; 17 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/nft/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.nft.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the nft module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/nft" 11 | }; 12 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/orm/module/v1alpha1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.orm.module.v1alpha1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module defines the ORM module which adds providers to the app container for 8 | // ORM ModuleDB's and in the future will automatically register query 9 | // services for modules that use the ORM. 10 | message Module { 11 | option (cosmos.app.v1alpha1.module) = { 12 | go_import: "cosmossdk.io/orm" 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/params/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.params.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the params module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/params" 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/slashing/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.slashing.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the slashing module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/slashing" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/store/internal/kv/v1beta1/kv.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.store.internal.kv.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option go_package = "cosmossdk.io/store/internal/kv"; 7 | 8 | // This is duplicated from the base kv directory to avoid a circular dependency with the cosmos-sdk 9 | 10 | // Pairs defines a repeated slice of Pair objects. 11 | message Pairs { 12 | repeated Pair pairs = 1 [(gogoproto.nullable) = false]; 13 | } 14 | 15 | // Pair defines a key/value bytes tuple. 16 | message Pair { 17 | bytes key = 1; 18 | bytes value = 2; 19 | } 20 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/upgrade/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.upgrade.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the upgrade module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/upgrade" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/proto/cosmos/vesting/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.vesting.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the vesting module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" 11 | }; 12 | } -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_hw_invalid_test.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_hw_invalid_test.der -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_hw_v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_hw_v2 -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_out_of_date.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_out_of_date.der -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_sw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_sw -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_sw_config_needed.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_cert_sw_config_needed.der -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_dcap.collateral: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_dcap.collateral -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/attestation_dcap.quote: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/attestation_dcap.quote -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/ias_root_ca_cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/ias_root_ca_cert.der -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/test_whitelist.txt: -------------------------------------------------------------------------------- 1 | AAAMEgAAaUI= -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/src/registration/fixtures/tls_ra_cert_v3.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/src/registration/fixtures/tls_ra_cert_v3.der -------------------------------------------------------------------------------- /cosmwasm/enclaves/execute/whitelist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/enclaves/execute/whitelist.txt -------------------------------------------------------------------------------- /cosmwasm/enclaves/ffi-types/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/ffi-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "enclave-ffi-types" 3 | version = "0.1.0" 4 | authors = ["Reuven Podmazo "] 5 | edition = "2018" 6 | 7 | [features] 8 | default = [] 9 | build_headers = ["cbindgen", "thiserror"] 10 | 11 | [dependencies] 12 | derive_more = "0.99" 13 | 14 | [build-dependencies] 15 | cbindgen = { version = "0.13", optional = true } 16 | thiserror = { version = "1", optional = true } 17 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2023-03-13 2 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/block-verifier/fixtures/validator_whitelist.txt: -------------------------------------------------------------------------------- 1 | AC665413F74DFC432FAC519BB0918E28BF9345EF,7FBB40975FC54398288C54856C75D82384719DB1,5FAD81F7FF6A060D63F0C021FEEC49C09AAFC970,506A2E9628D82725FC16CC262B2ECCE6B12996A3,C09948051ECC493D05B93C89A21DF6CF7D238135,4CDD962EFD0AD6413B5CE0B4026EA3B1081B8F66,303A3DE6E6A17F66C95243E101A7837B825B600A,E11089339CEAF3A49DEF947F623AC054F44455C6 -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/block-verifier/src/verify/commit.rs: -------------------------------------------------------------------------------- 1 | use log::error; 2 | use sgx_types::sgx_status_t; 3 | use tendermint::block::Commit; 4 | use tendermint_proto::v0_38::types::Commit as RawCommit; 5 | use tendermint_proto::Protobuf; 6 | 7 | pub fn decode(commit_slice: &[u8]) -> Result { 8 | let commit = >::decode(commit_slice).map_err(|e| { 9 | error!("Error parsing commit from proto: {:?}", e); 10 | sgx_status_t::SGX_ERROR_INVALID_PARAMETER 11 | })?; 12 | 13 | Ok(commit) 14 | } 15 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/block-verifier/src/verify/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod block; 2 | pub mod commit; 3 | pub mod header; 4 | pub mod txs; 5 | 6 | #[cfg(feature = "random")] 7 | pub mod random; 8 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/contract-engine/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/contract-engine/src/external/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ecalls; 2 | pub mod ocalls; 3 | pub mod results; 4 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/contract-engine/src/input_validation/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod contract_address_validation; 2 | pub(crate) mod msg_validation; 3 | pub(crate) mod send_funds_validations; 4 | pub(crate) mod sender_validation; 5 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmos-proto/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmos_proto" 3 | version = "1.11.0" 4 | authors = ["SCRT Labs "] 5 | edition = "2018" 6 | 7 | [features] 8 | build-protobuf = ["protoc-rust", "dirs"] 9 | 10 | [dependencies] 11 | protobuf = { version = "2.25.2"} 12 | 13 | [build-dependencies] 14 | protoc-rust = { version = "=2.25", optional = true } 15 | dirs = { version = "3.0", optional = true } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmos-types/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmos-types/src/traits.rs: -------------------------------------------------------------------------------- 1 | use cw_types_v010::types::CanonicalAddr; 2 | 3 | // https://github.com/tendermint/tendermint/blob/v0.33.3/crypto/crypto.go#L22 4 | pub trait CosmosAminoPubkey: PartialEq { 5 | /// derive the canonical address for this public key 6 | fn get_address(&self) -> CanonicalAddr; 7 | /// Serialize this public key to the legacy Amino format 8 | fn amino_bytes(&self) -> Vec; 9 | } 10 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v0.10/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v0.10/src/coins.rs: -------------------------------------------------------------------------------- 1 | //! must keep this file in sync with cosmwasm/packages/std/src/coins.rs 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use super::math::Uint128; 6 | 7 | #[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq)] 8 | pub struct Coin { 9 | pub denom: String, 10 | pub amount: Uint128, 11 | } 12 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v0.10/src/consts.rs: -------------------------------------------------------------------------------- 1 | pub const BECH32_PREFIX_ACC_ADDR: &str = "secret"; 2 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v0.10/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Trick to get the IDE to use sgx_tstd even when it doesn't know we're targeting SGX 2 | #[cfg(not(target_env = "sgx"))] 3 | extern crate sgx_tstd as std; 4 | 5 | pub mod coins; 6 | pub mod consts; 7 | pub mod encoding; 8 | pub mod math; 9 | pub mod query; 10 | pub mod std_error; 11 | pub mod system_error; 12 | pub mod types; 13 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-feature=+aes,+ssse3" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/src/errors/mod.rs: -------------------------------------------------------------------------------- 1 | mod crypto_error; 2 | mod recover_pubkey_error; 3 | mod std_error; 4 | mod verification_error; 5 | 6 | pub use crypto_error::CryptoError; 7 | pub use recover_pubkey_error::RecoverPubkeyError; 8 | pub use std_error::{DivideByZeroError, OverflowError, OverflowOperation, StdError, StdResult}; 9 | pub use verification_error::VerificationError; 10 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod addresses; 2 | pub mod coins; 3 | pub mod errors; 4 | pub mod ibc; 5 | pub mod math; 6 | pub mod results; 7 | pub mod timestamp; 8 | pub mod types; 9 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/src/math/mod.rs: -------------------------------------------------------------------------------- 1 | mod uint128; 2 | mod uint64; 3 | 4 | pub use uint128::Uint128; 5 | pub use uint64::Uint64; 6 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/src/results/empty.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | /// An empty struct that serves as a placeholder in different places, 4 | /// such as contracts that don't set a custom message. 5 | /// 6 | /// It is designed to be expressable in correct JSON and JSON Schema but 7 | /// contains no meaningful data. Previously we used enums without cases, 8 | /// but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451) 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] 10 | pub struct Empty {} 11 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/cosmwasm-types/v1.0/src/results/mod.rs: -------------------------------------------------------------------------------- 1 | //! This module contains the messages that are sent from the contract to the VM as an execution result 2 | 3 | mod contract_result; 4 | mod cosmos_msg; 5 | mod empty; 6 | mod events; 7 | mod response; 8 | mod submessages; 9 | 10 | pub use contract_result::*; 11 | pub use cosmos_msg::*; 12 | pub use empty::*; 13 | pub use events::*; 14 | pub use response::*; 15 | pub use submessages::*; 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/crypto/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/crypto/src/hash/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ripemd; 2 | pub mod sha; 3 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/crypto/src/hash/ripemd.rs: -------------------------------------------------------------------------------- 1 | use ripemd160::{Digest, Ripemd160}; 2 | 3 | pub const RIPEMD160_HASH_SIZE: usize = 20; 4 | 5 | pub fn ripemd160(data: &[u8]) -> [u8; RIPEMD160_HASH_SIZE] { 6 | let mut hasher = Ripemd160::new(); 7 | hasher.update(data); 8 | let hash = hasher.finalize().to_vec(); 9 | 10 | let mut result = [0u8; RIPEMD160_HASH_SIZE]; 11 | 12 | result.copy_from_slice(hash.as_ref()); 13 | 14 | result 15 | } 16 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/crypto/src/rng.rs: -------------------------------------------------------------------------------- 1 | use crate::CryptoError; 2 | use sgx_trts::trts::rsgx_read_rand; 3 | 4 | pub fn rand_slice(rand: &mut [u8]) -> Result<(), CryptoError> { 5 | rsgx_read_rand(rand).map_err(|_e| CryptoError::RandomError {}) 6 | } 7 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/utils/Makefile: -------------------------------------------------------------------------------- 1 | SGX_MODE ?= HW 2 | 3 | ifeq ($(SGX_MODE), SW) 4 | Rust_Flags := "-Z force-unstable-if-unmarked" 5 | else 6 | Rust_Flags := "-Z force-unstable-if-unmarked -C target-cpu=skylake" 7 | endif 8 | 9 | Rust_Target_Path = "$(CURDIR)/../../xargo" 10 | 11 | .PHONY: check 12 | check: 13 | RUST_TARGET_PATH=$(Rust_Target_Path) RUSTFLAGS=$(Rust_Flags) xargo check --features "$(FEATURES)" --target x86_64-unknown-linux-sgx 14 | 15 | .PHONY: clean 16 | clean: 17 | xargo clean 18 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/shared/utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(btree_drain_filter)] 2 | #![allow(unused_imports)] 3 | 4 | extern crate sgx_trts; 5 | extern crate sgx_types; 6 | 7 | extern crate core; 8 | #[cfg(not(target_env = "sgx"))] 9 | extern crate sgx_tstd as std; 10 | 11 | pub mod key_manager; 12 | pub mod kv_cache; 13 | pub mod logger; 14 | pub mod macros; 15 | pub mod oom_handler; 16 | pub mod pointers; 17 | pub mod recursion_depth; 18 | mod results; 19 | pub mod storage; 20 | pub mod tx_bytes; 21 | pub mod validator_set; 22 | 23 | pub use key_manager::Keychain; 24 | pub use key_manager::KEY_MANAGER; 25 | 26 | #[cfg(feature = "random")] 27 | pub mod random; 28 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/test/.gitignore: -------------------------------------------------------------------------------- 1 | enclave-ffi-types.h 2 | -------------------------------------------------------------------------------- /cosmwasm/enclaves/test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "enclave-test" 3 | version = "0.1.0" 4 | authors = ["SCRT Labs "] 5 | edition = "2021" 6 | 7 | [dependencies] 8 | sgx_types = { path = "../../../third_party/incubator-teaclave-sgx-sdk/sgx_types" } 9 | sgx_urts = { path = "../../../third_party/incubator-teaclave-sgx-sdk/sgx_urts" } 10 | lazy_static = "1.4.0" 11 | log = "0.4.17" 12 | parking_lot = "0.12.1" 13 | 14 | enclave-ffi-types = {path = "../ffi-types"} 15 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2023-03-13 2 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/src/backends/enclave.rs: -------------------------------------------------------------------------------- 1 | #![cfg(any(feature = "enclave", feature = "default-enclave"))] 2 | use crate::traits::{Querier, Storage}; 3 | use crate::wasmi::Module; 4 | 5 | /// Get how many more gas units can be used in the instance. 6 | #[allow(unused)] 7 | pub fn get_gas_left(instance: &Module) -> u64 8 | where 9 | S: Storage, 10 | Q: Querier, 11 | { 12 | instance.gas_left() 13 | } 14 | 15 | /// Get how many gas units were used in the instance. 16 | pub fn get_gas_used(instance: &Module) -> u64 17 | where 18 | S: Storage, 19 | Q: Querier, 20 | { 21 | instance.gas_used() 22 | } 23 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/src/errors/mod.rs: -------------------------------------------------------------------------------- 1 | mod communication_error; 2 | mod region_validation_error; 3 | mod vm_error; 4 | 5 | mod enclave; 6 | 7 | pub use communication_error::CommunicationError; 8 | pub use region_validation_error::RegionValidationError; 9 | pub use vm_error::VmError; 10 | 11 | pub use enclave::EnclaveError; 12 | 13 | pub type CommunicationResult = core::result::Result; 14 | pub type RegionValidationResult = core::result::Result; 15 | pub type VmResult = core::result::Result; 16 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/src/middleware/mod.rs: -------------------------------------------------------------------------------- 1 | mod deterministic; 2 | 3 | pub use deterministic::DeterministicMiddleware; 4 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/src/wasmi/mod.rs: -------------------------------------------------------------------------------- 1 | mod exports; 2 | mod imports; 3 | mod results; 4 | mod utils; 5 | mod wrapper; 6 | 7 | pub(crate) use exports::FullContext; 8 | pub use imports::*; 9 | pub use wrapper::*; 10 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/README.md: -------------------------------------------------------------------------------- 1 | # Test data 2 | 3 | The contracts here are compilations of the Hackatom contract. 4 | 5 | ## contract.wasm 6 | 7 | Is a symbolic link to a recent hackatom contract. 8 | 9 | ## corrupted.wasm 10 | 11 | A corrupted contract files, created by 12 | 13 | ```sh 14 | cp contract.wasm corrupted.wasm 15 | printf '\x11\x11\x11\x11\x11\x11\x11\x11' | dd of=corrupted.wasm bs=1 seek=1000 count=8 conv=notrunc 16 | ``` 17 | -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract.wasm: -------------------------------------------------------------------------------- 1 | contract_0.10.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract_0.10.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/contract_0.10.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract_0.6.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/contract_0.6.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract_0.7.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/contract_0.7.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract_0.8.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/contract_0.8.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/contract_0.9.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/contract_0.9.wasm -------------------------------------------------------------------------------- /cosmwasm/packages/sgx-vm/testdata/corrupted.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/cosmwasm/packages/sgx-vm/testdata/corrupted.wasm -------------------------------------------------------------------------------- /deployment/azure-marketplace-legacy/README.md: -------------------------------------------------------------------------------- 1 | # Old Azure Marketplace Image Code 2 | 3 | Just so we have this somewhere useful in case we need it in the future. 4 | 5 | Azure marketplace image wasn't really used, and Azure were found to be significantly more expensive than alternatives 6 | making constant support for keeping the image up to date not worth it. 7 | 8 | Still, it's a bitch and a half creating a marketplace image, so we're keeping the code around in the unfortunate event that 9 | we'll want to do something similar in the future. Also could be useful to set up K8s or templates for Azure in the future. -------------------------------------------------------------------------------- /deployment/azure-marketplace-legacy/secret-node-azure-template/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Secret Node Template", 5 | "description": "Deploy a VM with secret node software.", 6 | "summary": "This template deploys a single VM and allows you to run an SGX-enabled secret node as a part of the Secret Network", 7 | "githubUsername": "enigmampc", 8 | "dateUpdated": "2020-06-23" 9 | } -------------------------------------------------------------------------------- /deployment/ci/enclave-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | source /opt/sgxsdk/environment 5 | make enclave-tests 6 | -------------------------------------------------------------------------------- /deployment/ci/go-tests-bench.sh: -------------------------------------------------------------------------------- 1 | set -euv 2 | 3 | export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/sgxsdk/sdk_libs:/usr/lib/x86_64-linux-gnu/ 4 | # Run bench mark tests 5 | # go test -count 1 -v ./x/compute/internal/... -run "TestRunBenchmarks" 6 | LOG_LEVEL=ERROR go test -tags "sgx hw test" -count 1 -v ./x/compute/internal/... -run "TestRunExecuteBenchmarks" 7 | LOG_LEVEL=ERROR go test -tags "sgx hw test" -count 1 -v ./x/compute/internal/... -run "TestRunQueryBenchmarks" -------------------------------------------------------------------------------- /deployment/ci/go-tests.sh: -------------------------------------------------------------------------------- 1 | set -euv 2 | 3 | export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/sgxsdk/sdk_libs:/usr/lib/x86_64-linux-gnu/ 4 | # Run go system tests for compute module 5 | mkdir -p ./x/compute/internal/keeper/.sgx_secrets 6 | LOG_LEVEL=ERROR GOMAXPROCS=8 SCRT_SGX_STORAGE='./' go test -tags "sgx hw test" -failfast -timeout 90m -v ./x/compute/internal/... 7 | -------------------------------------------------------------------------------- /deployment/ci/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"XdyGXS0UGmyKMAb8VA6rjS2A//rQ48pQvK8R89/kIl0Xv/U95n3pHNb3H7kQUc8ST89j6sz9obU3bvNXo5TGSg=="}} -------------------------------------------------------------------------------- /deployment/ci/query-load-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-package", 3 | "devDependencies": { 4 | "@types/node": "^17.0.23", 5 | "axios": "^0.26.1", 6 | "secretjs": "1.15.0-beta.3", 7 | "typescript": "^4.6.3" 8 | }, 9 | "dependencies": { 10 | "assert": "^2.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /deployment/ci/query-load-test/snip20-ibc.wasm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/deployment/ci/query-load-test/snip20-ibc.wasm.gz -------------------------------------------------------------------------------- /deployment/ci/query-load-test/snip20-ibc.wasm.gz.bk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/deployment/ci/query-load-test/snip20-ibc.wasm.gz.bk -------------------------------------------------------------------------------- /deployment/ci/startup.sh: -------------------------------------------------------------------------------- 1 | if [ "$SECRET_LOCAL_NODE_TYPE" == "BOOTSTRAP" ] 2 | then 3 | ./bootstrap_init.sh 4 | else 5 | ./node_init.sh 6 | fi 7 | -------------------------------------------------------------------------------- /deployment/deb/control: -------------------------------------------------------------------------------- 1 | Package: secretnetwork 2 | Priority: optional 3 | Architecture: amd64 4 | Homepage: https://github.com/scrtlabs/SecretNetwork 5 | Maintainer: https://github.com/scrtlabs 6 | Provides: secretnetwork 7 | Conflicts: secretnetwork 8 | Replaces: secretnetwork 9 | Depends: libsnappy1v5 10 | Description: More Privacy. Limitless Possibilities. 11 | Secret Network is the first blockchain with customizable privacy. You get to choose what you share, with whom, and how. This protects users, and empowers developers to build a better Web3. Visit 12 | -------------------------------------------------------------------------------- /deployment/deb/postrm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This `DEBIAN/postrm` script is run post-uninstallation 3 | 4 | set -e 5 | 6 | systemctl stop secret-node || true 7 | systemctl disable secret-node || true 8 | rm -f /etc/systemd/system/secret-node.service || true 9 | systemctl daemon-reload || true 10 | -------------------------------------------------------------------------------- /deployment/deb/triggers: -------------------------------------------------------------------------------- 1 | activate-noawait ldconfig 2 | -------------------------------------------------------------------------------- /deployment/docker/README.md: -------------------------------------------------------------------------------- 1 | ## Docker scripts and files 2 | 3 | This folder contains mostly dev-related scripts. -------------------------------------------------------------------------------- /deployment/docker/builder/build_deb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | make deb-no-compile 4 | 5 | cp ./secretnetwork_"$VERSION"_amd64.deb /build/ -------------------------------------------------------------------------------- /deployment/docker/builder/create_check_hw_tar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p /build/check-hw/ 4 | cp ./check-hw/check-hw /build/check-hw/ 5 | cp ./check-hw/check_hw_enclave.so /build/check-hw/ 6 | cp ./check-hw/check_hw_enclave_testnet.so /build/check-hw/ 7 | cp ./check-hw/README.md /build/check-hw/ 8 | 9 | cd /build/ 10 | tar -czf check_hw_"$VERSION".tar.gz check-hw 11 | -------------------------------------------------------------------------------- /deployment/docker/setup scripts/setup_tmp_folder.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Aesm service relies on this folder and having write permissions 4 | # shellcheck disable=SC2174 5 | mkdir -p -m 777 /tmp/aesmd 6 | chmod -R -f 777 /tmp/aesmd || sudo chmod -R -f 777 /tmp/aesmd || true -------------------------------------------------------------------------------- /deployment/docker/testnet/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | 3 | events { 4 | worker_connections 1000; 5 | } 6 | http { 7 | server { 8 | listen 1337; 9 | location / { 10 | proxy_pass http://node:1317; 11 | } 12 | } 13 | server { 14 | listen 9091; 15 | location / { 16 | proxy_pass http://node:9091; 17 | } 18 | } 19 | server { 20 | listen 9090; 21 | location / { 22 | proxy_pass http://node:9090; 23 | } 24 | } 25 | 26 | 27 | } -------------------------------------------------------------------------------- /deployment/docker/testnet/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"XdyGXS0UGmyKMAb8VA6rjS2A//rQ48pQvK8R89/kIl0Xv/U95n3pHNb3H7kQUc8ST89j6sz9obU3bvNXo5TGSg=="}} -------------------------------------------------------------------------------- /deployment/docker/testnet/startup.sh: -------------------------------------------------------------------------------- 1 | if [ "$SECRET_NODE_TYPE" == "BOOTSTRAP" ] 2 | then 3 | ./bootstrap_init.sh 4 | else 5 | ./node_init.sh 6 | fi 7 | -------------------------------------------------------------------------------- /deployment/dockerfiles/ibc/c.mnemonic: -------------------------------------------------------------------------------- 1 | chair love bleak wonder skirt permit say assist aunt credit roast size obtain minute throw sand usual age smart exact enough room shadow charge -------------------------------------------------------------------------------- /deployment/dockerfiles/ibc/d.mnemonic: -------------------------------------------------------------------------------- 1 | word twist toast cloth movie predict advance crumble escape whale sail such angry muffin balcony keen move employ cook valve hurt glimpse breeze brick -------------------------------------------------------------------------------- /deployment/dockerfiles/ibc/entrypoint-hermes.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | echo "veryfing balances" 4 | hermes keys balance --chain secretdev-1 5 | hermes keys balance --chain secretdev-2 6 | hermes --config /home/hermes-user/.hermes/alternative-config.toml keys balance --chain secretdev-1 7 | hermes --config /home/hermes-user/.hermes/alternative-config.toml keys balance --chain secretdev-2 8 | 9 | echo "creating chain" 10 | hermes create channel --a-chain secretdev-1 --b-chain secretdev-2 --a-port transfer --b-port transfer --new-client-connection --yes 11 | 12 | echo "relaying forever" 13 | hermes start 14 | -------------------------------------------------------------------------------- /deployment/dockerfiles/ibc/hermes-v1.10.3-x86_64-unknown-linux-gnu.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/deployment/dockerfiles/ibc/hermes-v1.10.3-x86_64-unknown-linux-gnu.tar.gz -------------------------------------------------------------------------------- /deployment/dockerfiles/tests/integration-tests.Dockerfile: -------------------------------------------------------------------------------- 1 | # This dockerfile contains tests that require a full network to run, and require a running node that is connected to the network 2 | 3 | FROM ghcr.io/scrtlabs/compile-contracts:1.15.2 4 | 5 | COPY deployment/ci/query-load-test query-load-test 6 | 7 | WORKDIR query-load-test 8 | 9 | RUN npm install 10 | 11 | ENTRYPOINT ["node", "test.js"] 12 | -------------------------------------------------------------------------------- /docs/contract-with-migrate.wasm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/contract-with-migrate.wasm.gz -------------------------------------------------------------------------------- /docs/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/contract.wasm -------------------------------------------------------------------------------- /docs/migrate_contract_v2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/migrate_contract_v2.wasm -------------------------------------------------------------------------------- /docs/proposals/prop274.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Decrease max block size from 21MiB to 1MiB", 3 | "description": "SCRT Labs proposes to decrease the max block size from 21MiB to 1MiB.", 4 | "changes": [ 5 | { 6 | "subspace": "baseapp", 7 | "key": "BlockParams", 8 | "value": { 9 | "max_bytes": "1048576" 10 | } 11 | } 12 | ], 13 | "deposit": "1000000000uscrt" 14 | } -------------------------------------------------------------------------------- /docs/upgrades/1.11/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/upgrades/1.11/contract.wasm -------------------------------------------------------------------------------- /docs/upgrades/1.15/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o xtrace 3 | 4 | sudo rm -fr /tmp/secretd 5 | sudo rm -fr /tmp/secretcli 6 | mkdir /tmp/secretd 7 | mkdir /tmp/secretcli 8 | -------------------------------------------------------------------------------- /docs/upgrades/1.15/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/upgrades/1.15/contract.wasm -------------------------------------------------------------------------------- /docs/upgrades/1.16/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o xtrace 3 | 4 | sudo rm -fr /tmp/secretd 5 | sudo rm -fr /tmp/secretcli 6 | mkdir /tmp/secretd 7 | mkdir /tmp/secretcli 8 | -------------------------------------------------------------------------------- /docs/upgrades/1.16/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/docs/upgrades/1.16/contract.wasm -------------------------------------------------------------------------------- /go-cosmwasm/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_style = space 12 | indent_size = 4 13 | 14 | [{Makefile,*.go}] 15 | indent_style = tab 16 | indent_size = 4 17 | -------------------------------------------------------------------------------- /go-cosmwasm/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | *.iml 4 | .idea 5 | libgo_cosmwasm* 6 | 7 | *.so 8 | *.o 9 | *.h 10 | *.c 11 | lib/ 12 | 13 | # no static binaries (35MB+) 14 | libgo*.a 15 | # artifacts from compile tests 16 | muslc.exe 17 | tmp 18 | a.out 19 | -------------------------------------------------------------------------------- /go-cosmwasm/api/link_muslc.go: -------------------------------------------------------------------------------- 1 | //go:build linux && muslc 2 | // +build linux,muslc 3 | 4 | package api 5 | 6 | // #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm_muslc 7 | import "C" 8 | -------------------------------------------------------------------------------- /go-cosmwasm/api/link_std.go: -------------------------------------------------------------------------------- 1 | //go:build !secretcli && linux && !muslc && !darwin && sgx 2 | // +build !secretcli,linux,!muslc,!darwin,sgx 3 | 4 | package api 5 | 6 | // #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_epid 7 | import "C" 8 | -------------------------------------------------------------------------------- /go-cosmwasm/api/link_std_sw.go: -------------------------------------------------------------------------------- 1 | //go:build !secretcli && linux && !muslc && !darwin && !sgx 2 | // +build !secretcli,linux,!muslc,!darwin,!sgx 3 | 4 | package api 5 | 6 | // #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm -lsgx_dcap_ql -lsgx_dcap_quoteverify 7 | import "C" 8 | -------------------------------------------------------------------------------- /go-cosmwasm/api/testdata/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/go-cosmwasm/api/testdata/contract.wasm -------------------------------------------------------------------------------- /go-cosmwasm/api/testdata/download_releases.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck > /dev/null && shellcheck "$0" 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: ./download_releases.sh RELEASE_TAG" 7 | exit 1 8 | fi 9 | 10 | tag="$1" 11 | 12 | for contract in hackatom queue reflect ; do 13 | url="https://github.com/CosmWasm/cosmwasm/releases/download/$tag/$contract.wasm" 14 | echo "Downloading $url ..." 15 | wget -O "$contract.wasm" "$url" 16 | done 17 | -------------------------------------------------------------------------------- /go-cosmwasm/api/testdata/hackatom.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/go-cosmwasm/api/testdata/hackatom.wasm -------------------------------------------------------------------------------- /go-cosmwasm/api/testdata/queue.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/go-cosmwasm/api/testdata/queue.wasm -------------------------------------------------------------------------------- /go-cosmwasm/api/testdata/reflect.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/go-cosmwasm/api/testdata/reflect.wasm -------------------------------------------------------------------------------- /go-cosmwasm/build/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 6 | 7 | "$DIR/build_linux.sh" 8 | "$DIR/build_osx.sh" -------------------------------------------------------------------------------- /go-cosmwasm/build/build_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cargo build --release 4 | cp target/release/deps/libgo_cosmwasm.so api 5 | # FIXME: re-enable stripped so when we approach a production release, symbols are nice for debugging 6 | # strip api/libgo_cosmwasm.so 7 | -------------------------------------------------------------------------------- /go-cosmwasm/build/build_muslc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cargo build --release --features backtraces --example muslc 4 | cp /code/target/release/examples/libmuslc.a /code/api/libgo_cosmwasm_muslc.a 5 | -------------------------------------------------------------------------------- /go-cosmwasm/build/build_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ref: https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html 4 | export PATH="/opt/osxcross/target/bin:$PATH" 5 | export LIBZ_SYS_STATIC=1 6 | export CC=o64-clang 7 | export CXX=o64-clang++ 8 | 9 | cargo build --release --target x86_64-apple-darwin 10 | cp target/x86_64-apple-darwin/release/deps/libgo_cosmwasm.dylib api 11 | -------------------------------------------------------------------------------- /go-cosmwasm/build/cargo-config: -------------------------------------------------------------------------------- 1 | [target.x86_64-apple-darwin] 2 | linker = "x86_64-apple-darwin14-clang" 3 | ar = "x86_64-apple-darwin14-ar" -------------------------------------------------------------------------------- /go-cosmwasm/clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-arguments-threshold = 9 2 | -------------------------------------------------------------------------------- /go-cosmwasm/rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2023-03-13 2 | -------------------------------------------------------------------------------- /go-cosmwasm/src/error/mod.rs: -------------------------------------------------------------------------------- 1 | mod go; 2 | mod rust; 3 | 4 | pub use go::GoResult; 5 | pub use rust::{clear_error, handle_c_error, handle_c_error_default, set_error, Error}; 6 | -------------------------------------------------------------------------------- /go-cosmwasm/src/gas_meter.rs: -------------------------------------------------------------------------------- 1 | /// An opaque type. `*gas_meter_t` represents a pointer to Go memory holding the gas meter. 2 | #[repr(C)] 3 | pub struct gas_meter_t { 4 | _private: [u8; 0], 5 | } 6 | -------------------------------------------------------------------------------- /go-cosmwasm/types/v1/type.go: -------------------------------------------------------------------------------- 1 | package v1types 2 | 3 | // Contains static analysis info of the contract (the Wasm code to be precise). 4 | // This type is returned by VM.AnalyzeCode(). 5 | type AnalysisReport struct { 6 | HasIBCEntryPoints bool 7 | RequiredFeatures string 8 | } 9 | -------------------------------------------------------------------------------- /ias_keys/develop/api_key.txt: -------------------------------------------------------------------------------- 1 | 024bfdb2e8b842a79d2237a295962efc -------------------------------------------------------------------------------- /ias_keys/develop/spid.txt: -------------------------------------------------------------------------------- 1 | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -------------------------------------------------------------------------------- /ias_keys/sw_dummy/api_key.txt: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000000000 -------------------------------------------------------------------------------- /ias_keys/sw_dummy/spid.txt: -------------------------------------------------------------------------------- 1 | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -------------------------------------------------------------------------------- /integration-tests/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | $(MAKE) -C contract-v1 3 | $(MAKE) -C contract-v0.10 4 | 5 | run-localsecret: 6 | docker compose -f ../deployment/dockerfiles/ibc/docker-compose.yml up 7 | 8 | kill-localsecret: 9 | docker compose -f ../deployment/dockerfiles/ibc/docker-compose.yml stop 10 | docker compose -f ../deployment/dockerfiles/ibc/docker-compose.yml rm -f -------------------------------------------------------------------------------- /integration-tests/contract-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_infos": [ 3 | { 4 | "contract_address": "secret1u4g0zlxkfh9xamcscptp7lj2v8c4jdcjaeg7q6", 5 | "contract_info": { 6 | "code_id": "1", 7 | "creator": "secret1njjhv3zuqvq3tcssepkm76knm7ysymlr4y20ug", 8 | "label": "counterContract", 9 | "created": null, 10 | "ibc_port_id": "", 11 | "admin": "", 12 | "admin_proof": null 13 | } 14 | } 15 | ] 16 | } 17 | 18 | -------------------------------------------------------------------------------- /integration-tests/contract-v0.10/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /integration-tests/contract-v0.10/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src/lib.rs Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | cp ./target/wasm32-unknown-unknown/release/contract_v010.wasm ./contract.wasm 5 | 6 | clean: 7 | cargo clean 8 | -rm -f ./contract.wasm -------------------------------------------------------------------------------- /integration-tests/contract-v0.10/README.md: -------------------------------------------------------------------------------- 1 | Just `make`. :rainbow: 2 | -------------------------------------------------------------------------------- /integration-tests/contract-v0.10/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.63 -------------------------------------------------------------------------------- /integration-tests/contract-v1/.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | /target 3 | *.wasm 4 | 5 | # Text file backups 6 | **/*.rs.bk 7 | 8 | # macOS 9 | .DS_Store 10 | 11 | # IDEs 12 | *.iml 13 | .idea 14 | -------------------------------------------------------------------------------- /integration-tests/contract-v1/Makefile: -------------------------------------------------------------------------------- 1 | all: src/contract.rs src/lib.rs src/msg.rs Cargo.toml Cargo.lock 2 | rustup target add wasm32-unknown-unknown 3 | RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown 4 | cp ./target/wasm32-unknown-unknown/release/contract_v1.wasm ./contract.wasm 5 | 6 | clean: 7 | cargo clean 8 | -rm -f ./contract.wasm -------------------------------------------------------------------------------- /integration-tests/contract-v1/rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.63 -------------------------------------------------------------------------------- /integration-tests/contract-v1/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod ibc; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /integration-tests/jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ 2 | module.exports = { 3 | preset: "ts-jest", 4 | testEnvironment: "node", 5 | testTimeout: 60_000, 6 | verbose: true, 7 | // modulePathIgnorePatterns: ["dist", "scripts"], 8 | // globalSetup: "/test/globalSetup.ts", 9 | // globalTeardown: "/test/globalTeardown.js", 10 | // setupFilesAfterEnv: ["/test/setup.ts"], 11 | // globals: { 12 | // TEST_ACCOUNTS: {}, 13 | // }, 14 | }; 15 | -------------------------------------------------------------------------------- /integration-tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "integration-tests", 3 | "version": "1.22.22", 4 | "license": "MIT", 5 | "scripts": { 6 | "test": "make && jest --forceExit" 7 | }, 8 | "devDependencies": { 9 | "@noble/hashes": "1.1.2", 10 | "@types/jest": "28.1.7", 11 | "@types/node": "18.7.9", 12 | "jest": "28.1.3", 13 | "prettier": "2.7.1", 14 | "secretjs": "1.18.0-beta.0", 15 | "ts-jest": "28.0.8", 16 | "ts-node": "10.9.1", 17 | "typescript": "4.7.4" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/test-contracts/contract.wasm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/integration-tests/test-contracts/contract.wasm.gz -------------------------------------------------------------------------------- /integration-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": ["jest", "node"], 4 | "esModuleInterop": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /proto/buf.gen.gogo.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | plugins: 3 | - name: gocosmos 4 | out: .. 5 | opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm 6 | - name: grpc-gateway 7 | out: .. 8 | opt: logtostderr=true,allow_colon_final_segments=true 9 | -------------------------------------------------------------------------------- /proto/buf.yaml: -------------------------------------------------------------------------------- 1 | # This module represents buf.build/cosmos/cosmos-sdk 2 | version: v1 3 | deps: 4 | - buf.build/cosmos/cosmos-proto 5 | - buf.build/cosmos/cosmos-sdk 6 | - buf.build/cosmos/gogo-proto 7 | - buf.build/googleapis/googleapis 8 | breaking: 9 | use: 10 | - FILE 11 | lint: 12 | use: 13 | - DEFAULT 14 | - COMMENTS 15 | - FILE_LOWER_SNAKE_CASE 16 | except: 17 | - UNARY_RPC 18 | - COMMENT_FIELD 19 | - SERVICE_SUFFIX 20 | - PACKAGE_VERSION_SUFFIX 21 | - RPC_REQUEST_STANDARD_NAME 22 | ignore: 23 | - tendermint 24 | -------------------------------------------------------------------------------- /proto/secret/emergencybutton/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package secret.emergencybutton.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | import "secret/emergencybutton/v1beta1/params.proto"; 6 | 7 | option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; 8 | 9 | // GenesisState - genesis state of x/wasm 10 | message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; } -------------------------------------------------------------------------------- /proto/secret/emergencybutton/v1beta1/params.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package secret.emergencybutton.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; 7 | 8 | // Params defines the parameters for the ibc-rate-limit module. 9 | message Params { 10 | string switch_status = 1 [ (gogoproto.jsontag) = "switch_status,omitempty" ]; 11 | string pauser_address = 2 12 | [ (gogoproto.jsontag) = "pauser_address,omitempty" ]; 13 | } 14 | -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2023-03-13 -------------------------------------------------------------------------------- /sn-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/sn-logo.png -------------------------------------------------------------------------------- /third_party/build/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "eng_edl" 7 | version = "0.0.0" 8 | dependencies = [ 9 | "sgx_edl", 10 | ] 11 | 12 | [[package]] 13 | name = "sgx_edl" 14 | version = "1.1.6" 15 | -------------------------------------------------------------------------------- /third_party/build/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eng_edl" 3 | version = "0.0.0" 4 | authors = ["The Teaclave Authors"] 5 | edition = "2021" 6 | 7 | [lib] 8 | name = "eng_edl" 9 | 10 | [dependencies] 11 | sgx_edl = { path = "../../third_party/incubator-teaclave-sgx-sdk/sgx_edl"} 12 | -------------------------------------------------------------------------------- /third_party/build/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/third_party/build/src/lib.rs -------------------------------------------------------------------------------- /third_party/proto/buf.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | breaking: 3 | use: 4 | - FILE 5 | lint: 6 | use: 7 | - DEFAULT 8 | ignore: 9 | - tendermint 10 | - confio 11 | - gogoproto 12 | - google 13 | - cosmos_proto 14 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/app/v1alpha1/query.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.app.v1alpha1; 4 | 5 | import "cosmos/app/v1alpha1/config.proto"; 6 | 7 | // Query is the app module query service. 8 | service Query { 9 | 10 | // Config returns the current app config. 11 | rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} 12 | } 13 | 14 | // QueryConfigRequest is the Query/Config request type. 15 | message QueryConfigRequest {} 16 | 17 | // QueryConfigRequest is the Query/Config response type. 18 | message QueryConfigResponse { 19 | 20 | // config is the current app config. 21 | Config config = 1; 22 | } 23 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/authz/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.authz.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the authz module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/authz" 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/authz/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | // Since: cosmos-sdk 0.43 2 | syntax = "proto3"; 3 | package cosmos.authz.v1beta1; 4 | 5 | import "gogoproto/gogo.proto"; 6 | import "cosmos/authz/v1beta1/authz.proto"; 7 | import "amino/amino.proto"; 8 | 9 | option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; 10 | 11 | // GenesisState defines the authz module's genesis state. 12 | message GenesisState { 13 | repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; 14 | } 15 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/circuit/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.circuit.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the circuit module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/circuit" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/consensus/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.consensus.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the consensus module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/consensus" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/distribution/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.distribution.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the distribution module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/distribution" 11 | }; 12 | 13 | string fee_collector_name = 1; 14 | 15 | // authority defines the custom module authority. If not set, defaults to the governance module. 16 | string authority = 2; 17 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/evidence/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.evidence.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the evidence module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/evidence" 11 | }; 12 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/evidence/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.evidence.v1beta1; 3 | 4 | option go_package = "cosmossdk.io/x/evidence/types"; 5 | 6 | import "google/protobuf/any.proto"; 7 | 8 | // GenesisState defines the evidence module's genesis state. 9 | message GenesisState { 10 | // evidence defines all the evidence at genesis. 11 | repeated google.protobuf.Any evidence = 1; 12 | } 13 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/feegrant/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.feegrant.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the feegrant module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/feegrant" 11 | }; 12 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/feegrant/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | // Since: cosmos-sdk 0.43 2 | syntax = "proto3"; 3 | package cosmos.feegrant.v1beta1; 4 | 5 | import "gogoproto/gogo.proto"; 6 | import "cosmos/feegrant/v1beta1/feegrant.proto"; 7 | import "amino/amino.proto"; 8 | 9 | option go_package = "cosmossdk.io/x/feegrant"; 10 | 11 | // GenesisState contains a set of fee allowances, persisted from the store 12 | message GenesisState { 13 | repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; 14 | } 15 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/genutil/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.genutil.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object for the genutil module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/genutil" 11 | }; 12 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/genutil/v1beta1/genesis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.genutil.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | import "amino/amino.proto"; 6 | 7 | option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; 8 | 9 | // GenesisState defines the raw genesis transaction in JSON. 10 | message GenesisState { 11 | // gen_txs defines the genesis transactions. 12 | repeated bytes gen_txs = 1 [ 13 | (gogoproto.casttype) = "encoding/json.RawMessage", 14 | (gogoproto.jsontag) = "gentxs", 15 | (amino.field_name) = "gentxs", 16 | (amino.dont_omitempty) = true 17 | ]; 18 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/gov/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.gov.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the gov module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/gov" 11 | }; 12 | 13 | // max_metadata_len defines the maximum proposal metadata length. 14 | // Defaults to 255 if not explicitly set. 15 | uint64 max_metadata_len = 1; 16 | 17 | // authority defines the custom module authority. If not set, defaults to the governance module. 18 | string authority = 2; 19 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/mint/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.mint.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the mint module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/mint" 11 | }; 12 | 13 | string fee_collector_name = 1; 14 | 15 | // authority defines the custom module authority. If not set, defaults to the governance module. 16 | string authority = 2; 17 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/orm/module/v1alpha1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.orm.module.v1alpha1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module defines the ORM module which adds providers to the app container for 8 | // ORM ModuleDB's and in the future will automatically register query 9 | // services for modules that use the ORM. 10 | message Module { 11 | option (cosmos.app.v1alpha1.module) = { 12 | go_import: "cosmossdk.io/orm" 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/params/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.params.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the params module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/params" 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/slashing/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.slashing.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the slashing module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/slashing" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } 16 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/store/internal/kv/v1beta1/kv.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package cosmos.store.internal.kv.v1beta1; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option go_package = "cosmossdk.io/store/internal/kv"; 7 | 8 | // This is duplicated from the base kv directory to avoid a circular dependency with the cosmos-sdk 9 | 10 | // Pairs defines a repeated slice of Pair objects. 11 | message Pairs { 12 | repeated Pair pairs = 1 [(gogoproto.nullable) = false]; 13 | } 14 | 15 | // Pair defines a key/value bytes tuple. 16 | message Pair { 17 | bytes key = 1; 18 | bytes value = 2; 19 | } 20 | -------------------------------------------------------------------------------- /third_party/proto/cosmos/upgrade/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.upgrade.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the upgrade module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "cosmossdk.io/x/upgrade" 11 | }; 12 | 13 | // authority defines the custom module authority. If not set, defaults to the governance module. 14 | string authority = 1; 15 | } -------------------------------------------------------------------------------- /third_party/proto/cosmos/vesting/module/v1/module.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package cosmos.vesting.module.v1; 4 | 5 | import "cosmos/app/v1alpha1/module.proto"; 6 | 7 | // Module is the config object of the vesting module. 8 | message Module { 9 | option (cosmos.app.v1alpha1.module) = { 10 | go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" 11 | }; 12 | } -------------------------------------------------------------------------------- /third_party/proto/ibc/applications/fee/v1/ack.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package ibc.applications.fee.v1; 4 | 5 | option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; 6 | 7 | // IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware 8 | message IncentivizedAcknowledgement { 9 | // the underlying app acknowledgement bytes 10 | bytes app_acknowledgement = 1; 11 | // the relayer address which submits the recv packet message 12 | string forward_relayer_address = 2; 13 | // success flag of the base application callback 14 | bool underlying_app_success = 3; 15 | } 16 | -------------------------------------------------------------------------------- /third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package ibc.applications.interchain_accounts.controller.v1; 4 | 5 | option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; 6 | 7 | // Params defines the set of on-chain interchain accounts parameters. 8 | // The following parameters may be used to disable the controller submodule. 9 | message Params { 10 | // controller_enabled enables or disables the controller submodule. 11 | bool controller_enabled = 1; 12 | } 13 | -------------------------------------------------------------------------------- /third_party/proto/ibc/core/channel/v1/NoteToDev.txt: -------------------------------------------------------------------------------- 1 | When building the enclave we pull in multiple files named upgrade.proto which results in 2 | overwriting the generated upgrade.rs file. 3 | In an attempt to resolve this naming collision we chose to rename ibc/channel/v1/upgrade.proto 4 | to channel_upgrade.proto and modify tx.proto and query.proto to point to channel_upgrade.proto 5 | 6 | In future upgrades we may have to do the same. -------------------------------------------------------------------------------- /third_party/proto/ibc/lightclients/localhost/v2/localhost.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package ibc.lightclients.localhost.v2; 4 | 5 | option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost;localhost"; 6 | 7 | import "ibc/core/client/v1/client.proto"; 8 | import "gogoproto/gogo.proto"; 9 | 10 | // ClientState defines the 09-localhost client state 11 | message ClientState { 12 | option (gogoproto.goproto_getters) = false; 13 | 14 | // the latest block height 15 | ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; 16 | } 17 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/crypto/keys.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.crypto; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; 5 | 6 | import "gogoproto/gogo.proto"; 7 | 8 | // PublicKey defines the keys available for use with Validators 9 | message PublicKey { 10 | option (gogoproto.compare) = true; 11 | option (gogoproto.equal) = true; 12 | 13 | oneof sum { 14 | bytes ed25519 = 1; 15 | bytes secp256k1 = 2; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/libs/bits/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.libs.bits; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/libs/bits"; 5 | 6 | message BitArray { 7 | int64 bits = 1; 8 | repeated uint64 elems = 2; 9 | } 10 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/mempool/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.mempool; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/mempool"; 5 | 6 | message Txs { 7 | repeated bytes txs = 1; 8 | } 9 | 10 | message Message { 11 | oneof sum { 12 | Txs txs = 1; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/p2p/pex.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.p2p; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; 5 | 6 | import "tendermint/p2p/types.proto"; 7 | import "gogoproto/gogo.proto"; 8 | 9 | message PexRequest {} 10 | 11 | message PexAddrs { 12 | repeated NetAddress addrs = 1 [(gogoproto.nullable) = false]; 13 | } 14 | 15 | message Message { 16 | oneof sum { 17 | PexRequest pex_request = 1; 18 | PexAddrs pex_addrs = 2; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/store/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.store; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/store"; 5 | 6 | message BlockStoreState { 7 | int64 base = 1; 8 | int64 height = 2; 9 | } 10 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/types/block.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.types; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; 5 | 6 | import "gogoproto/gogo.proto"; 7 | import "tendermint/types/types.proto"; 8 | import "tendermint/types/evidence.proto"; 9 | 10 | message Block { 11 | Header header = 1 [(gogoproto.nullable) = false]; 12 | Data data = 2 [(gogoproto.nullable) = false]; 13 | tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; 14 | Commit last_commit = 4; 15 | } 16 | -------------------------------------------------------------------------------- /third_party/proto/tendermint/types/events.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package tendermint.types; 3 | 4 | option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; 5 | 6 | message EventDataRoundState { 7 | int64 height = 1; 8 | int32 round = 2; 9 | string step = 3; 10 | } 11 | -------------------------------------------------------------------------------- /x/compute/internal/keeper/migrations/v1/types.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | // if needed v1 types go here 4 | -------------------------------------------------------------------------------- /x/compute/internal/keeper/migrations/v2/types.go: -------------------------------------------------------------------------------- 1 | package v2 2 | 3 | // if needed v2 types go here 4 | -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/bench_contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/bench_contract.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/burner.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/burner.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/contract-v2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/contract-v2.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/contract.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/contract.wasm.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/contract.wasm.gzip -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/contract_with_floats.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/contract_with_floats.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/dist.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/dist.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/erc20.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/erc20.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/evaporate.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/evaporate.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/gov.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/gov.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/hackatom.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/hackatom.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/ibc.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/ibc.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/migrate_contract_v1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/migrate_contract_v1.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/migrate_contract_v2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/migrate_contract_v2.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/mint.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/mint.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/plaintext_logs.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/plaintext_logs.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/reflect.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/reflect.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/staking.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/staking.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/static-too-high-initial-memory.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/static-too-high-initial-memory.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/test_gzip_contract.wasm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/test_gzip_contract.wasm.gz -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/test_gzip_contract_raw.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/test_gzip_contract_raw.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/too-high-initial-memory.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/too-high-initial-memory.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/v1-contract-2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/v1-contract-2.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/v1-contract-3.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/v1-contract-3.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/v1-contract-v2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/v1-contract-v2.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/v1-contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/v1-contract.wasm -------------------------------------------------------------------------------- /x/compute/internal/keeper/testdata/v1_random_test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/internal/keeper/testdata/v1_random_test.wasm -------------------------------------------------------------------------------- /x/compute/internal/types/context.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | sdk "github.com/cosmos/cosmos-sdk/types" 5 | ) 6 | 7 | const contextKeyCallDepth contextKey = iota 8 | 9 | func WithCallDepth(ctx sdk.Context, counter uint32) sdk.Context { 10 | return ctx.WithValue(contextKeyCallDepth, counter) 11 | } 12 | 13 | func CallDepth(ctx sdk.Context) (uint32, bool) { 14 | val, ok := ctx.Value(contextKeyCallDepth).(uint32) 15 | return val, ok 16 | } 17 | -------------------------------------------------------------------------------- /x/compute/migrations/v120/types.go: -------------------------------------------------------------------------------- 1 | package v120 2 | 3 | const ( 4 | ModuleName = "compute" 5 | ) 6 | -------------------------------------------------------------------------------- /x/compute/testdata/escrow_0.7.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/compute/testdata/escrow_0.7.wasm -------------------------------------------------------------------------------- /x/emergencybutton/alias.go: -------------------------------------------------------------------------------- 1 | package emergencybutton 2 | 3 | import ( 4 | "github.com/scrtlabs/SecretNetwork/x/emergencybutton/keeper" 5 | "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types" 6 | ) 7 | 8 | const ( 9 | ModuleName = types.ModuleName 10 | StoreKey = types.StoreKey 11 | TStoreKey = types.TStoreKey 12 | QuerierRoute = types.QuerierRoute 13 | RouterKey = types.QuerierRoute 14 | ) 15 | 16 | var ( 17 | NewKeeper = keeper.NewKeeper 18 | NewMsgServerImpl = keeper.NewMsgServerImpl 19 | ) 20 | 21 | type ( 22 | GenesisState = types.GenesisState 23 | Keeper = keeper.Keeper 24 | ) 25 | -------------------------------------------------------------------------------- /x/emergencybutton/client/querier.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | sdk "github.com/cosmos/cosmos-sdk/types" 5 | 6 | ibcswitch "github.com/scrtlabs/SecretNetwork/x/emergencybutton/keeper" 7 | "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types" 8 | ) 9 | 10 | // This file should evolve to being code gen'd, off of `proto/twap/v1beta/query.yml` 11 | 12 | type Querier struct { 13 | K ibcswitch.Keeper 14 | } 15 | 16 | func (q Querier) Params(ctx sdk.Context, 17 | _ types.ParamsRequest, 18 | ) (*types.ParamsResponse, error) { 19 | params := q.K.GetParams(ctx) 20 | return &types.ParamsResponse{Params: params}, nil 21 | } 22 | -------------------------------------------------------------------------------- /x/emergencybutton/exported/exported.go: -------------------------------------------------------------------------------- 1 | package exported 2 | 3 | import ( 4 | sdk "github.com/cosmos/cosmos-sdk/types" 5 | paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" 6 | ) 7 | 8 | type ( 9 | ParamSet = paramtypes.ParamSet 10 | 11 | // Subspace defines an interface that implements the legacy x/params Subspace 12 | // type. 13 | // 14 | // NOTE: This is used solely for migration of x/params managed parameters. 15 | Subspace interface { 16 | GetParamSet(ctx sdk.Context, ps ParamSet) 17 | } 18 | ) 19 | -------------------------------------------------------------------------------- /x/emergencybutton/types/errors.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "cosmossdk.io/errors" 5 | ) 6 | 7 | var ( 8 | ErrIbcOff = errors.Register(ModuleName, 1, "ibc processing failed") 9 | ErrUnauthorizedToggle = errors.Register(ModuleName, 2, "emergency button toggle failed") 10 | ErrPauserUnset = errors.Register(ModuleName, 3, "emergency button toggle failed") 11 | ) 12 | -------------------------------------------------------------------------------- /x/emergencybutton/types/genesis.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // DefaultGenesis creates a default GenesisState object. 4 | func DefaultGenesis() *GenesisState { 5 | return &GenesisState{ 6 | Params: DefaultParams(), 7 | } 8 | } 9 | 10 | // Validate performs basic genesis state validation returning an error upon any 11 | // failure. 12 | func (gs GenesisState) Validate() error { 13 | return gs.Params.Validate() 14 | } 15 | -------------------------------------------------------------------------------- /x/emergencybutton/types/keys.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const ( 4 | ModuleName = "emergencybutton" 5 | StoreKey = "emergencybutton" 6 | TStoreKey = "emergencybutton" 7 | QuerierRoute = "emergencybutton" 8 | ) 9 | 10 | // RouterKey is the message route. Can only contain 11 | // alphanumeric characters. 12 | var ( 13 | RouterKey = QuerierRoute 14 | ParamsKey = []byte{0x01} 15 | ) 16 | 17 | const ( 18 | // IbcSwitchStatusOff - IBC messages halted 19 | IbcSwitchStatusOff string = "off" 20 | // IbcSwitchStatusOn - IBC messages enabled 21 | IbcSwitchStatusOn string = "on" 22 | ) 23 | -------------------------------------------------------------------------------- /x/emergencybutton/types/msgs.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | sdk "github.com/cosmos/cosmos-sdk/types" 5 | ) 6 | 7 | const ( 8 | TypeMsgToggleIbcSwitch = "toggle_switch" 9 | ) 10 | 11 | var _ sdk.Msg = &MsgToggleIbcSwitch{} 12 | 13 | // NewMsgToggleIbcSwitch creates a message to toggle switch 14 | func NewMsgToggleIbcSwitch(sender sdk.AccAddress) *MsgToggleIbcSwitch { 15 | return &MsgToggleIbcSwitch{sender.String()} 16 | } 17 | -------------------------------------------------------------------------------- /x/ibc-hooks/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | -------------------------------------------------------------------------------- /x/ibc-hooks/types/keys.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const ( 4 | ModuleName = "ibchooks" 5 | StoreKey = "hooks-for-ibc" // not using the module name because of collisions with key "ibc" 6 | IBCCallbackKey = "ibc_callback" 7 | SenderPrefix = "ibc-wasm-hook-intermediary" 8 | ) 9 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/enclave/enclave.go: -------------------------------------------------------------------------------- 1 | package enclave 2 | 3 | import ( 4 | "github.com/scrtlabs/SecretNetwork/go-cosmwasm/api" 5 | ) 6 | 7 | type Api struct{} 8 | 9 | func (Api) LoadSeed(masterKey []byte, seed []byte, apiKey []byte) (bool, error) { 10 | return api.LoadSeedToEnclave(masterKey, seed, apiKey) 11 | } 12 | 13 | func (Api) GetEncryptedSeed(masterCert []byte) ([]byte, error) { 14 | return api.GetEncryptedSeed(masterCert) 15 | } 16 | 17 | func (Api) GetEncryptedGenesisSeed(pk []byte) ([]byte, error) { 18 | return api.GetEncryptedGenesisSeed(pk) 19 | } 20 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/enclave_interface.go: -------------------------------------------------------------------------------- 1 | package keeper 2 | 3 | type EnclaveInterface interface { 4 | LoadSeed(masterKey []byte, seed []byte, apiKey []byte) (bool, error) 5 | GetEncryptedSeed(masterCert []byte) ([]byte, error) 6 | GetEncryptedGenesisSeed(pk []byte) ([]byte, error) 7 | } 8 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/ioutil.go: -------------------------------------------------------------------------------- 1 | package keeper 2 | 3 | import ( 4 | "io" 5 | "os" 6 | ) 7 | 8 | func getFile(src string) ([]byte, error) { 9 | file, err := os.Open(src) 10 | if err != nil { 11 | // log.Fatal(err) 12 | return nil, err 13 | } 14 | defer file.Close() 15 | 16 | b, err := io.ReadAll(file) 17 | return b, err 18 | } 19 | 20 | func fileExists(src string) bool { 21 | if _, err := os.Stat(src); err == nil { 22 | return true 23 | } 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/ioutil_test.go: -------------------------------------------------------------------------------- 1 | package keeper 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | func TestGetFile(t *testing.T) { 11 | _, err := getFile("./testdata/contract.wasm") 12 | require.NoError(t, err) 13 | } 14 | 15 | func TestFileExists(t *testing.T) { 16 | val := fileExists("./testdata/contract.wasm") 17 | assert.Equal(t, val, true) 18 | 19 | val = fileExists("./testdata/contractXYZ.wasm") 20 | assert.Equal(t, val, false) 21 | } 22 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/mock/enclave.go: -------------------------------------------------------------------------------- 1 | package mock 2 | 3 | // To be able to run unit tests without needing the enclave 4 | 5 | type MockEnclaveApi struct{} 6 | 7 | func (MockEnclaveApi) LoadSeed(_ []byte, _ []byte, _ []byte) (bool, error) { 8 | return true, nil 9 | } 10 | 11 | func (MockEnclaveApi) GetEncryptedSeed(_ []byte) ([]byte, error) { 12 | return []byte(""), nil 13 | } 14 | 15 | func (MockEnclaveApi) GetEncryptedGenesisSeed(_ []byte) ([]byte, error) { 16 | return []byte(""), nil 17 | } 18 | -------------------------------------------------------------------------------- /x/registration/internal/keeper/testdata/contract.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/internal/keeper/testdata/contract.wasm -------------------------------------------------------------------------------- /x/registration/internal/types/genesis.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // ValidateGenesis performs basic validation of supply genesis data returning an 4 | // error for any failed validation criteria. 5 | func ValidateGenesis(data GenesisState) error { 6 | // todo: do we want to use this, or just fail if they don't exist? 7 | 8 | // if data.IoMasterCertificate == nil { 9 | // return ErrCertificateInvalid 10 | //} 11 | // if data.NodeExchMasterCertificate == nil { 12 | // return ErrCertificateInvalid 13 | //} 14 | 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /x/registration/internal/types/reg_keys.go: -------------------------------------------------------------------------------- 1 | //go:build !test && !secretcli 2 | 3 | package types 4 | 5 | func GetApiKey() ([]byte, error) { 6 | apiKeyFile, err := Asset("api_key.txt") 7 | if err != nil { 8 | return nil, err 9 | } 10 | 11 | return apiKeyFile, nil 12 | } 13 | 14 | func GetSpid() ([]byte, error) { 15 | apiKeyFile, err := Asset("spid.txt") 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | return apiKeyFile, nil 21 | } 22 | -------------------------------------------------------------------------------- /x/registration/internal/types/reg_keys_secretcli.go: -------------------------------------------------------------------------------- 1 | //go:build test || secretcli 2 | 3 | package types 4 | 5 | func GetApiKey() ([]byte, error) { 6 | return nil, nil 7 | } 8 | 9 | func GetSpid() ([]byte, error) { 10 | return nil, nil 11 | } 12 | -------------------------------------------------------------------------------- /x/registration/migrations/v106/types.go: -------------------------------------------------------------------------------- 1 | package v106 2 | 3 | const ( 4 | ModuleName = "register" 5 | ) 6 | 7 | type ( 8 | Certificate []byte 9 | 10 | RegistrationNodeInfo struct { 11 | Certificate Certificate 12 | EncryptedSeed []byte 13 | } 14 | 15 | // GenesisState is the struct representation of the export genesis 16 | GenesisState struct { 17 | Registration []RegistrationNodeInfo `json:"reg_info"` 18 | NodeExchMasterCertificate []byte `json:"node_exch_cert"` 19 | IoMasterCertificate []byte `json:"io_exch_cert"` 20 | } 21 | ) 22 | -------------------------------------------------------------------------------- /x/registration/migrations/v170/types.go: -------------------------------------------------------------------------------- 1 | package v170 2 | 3 | const ( 4 | ModuleName = "register" 5 | ) 6 | -------------------------------------------------------------------------------- /x/registration/remote_attestation/corpus/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/remote_attestation/corpus/0 -------------------------------------------------------------------------------- /x/registration/remote_attestation/corpus/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/remote_attestation/corpus/1 -------------------------------------------------------------------------------- /x/registration/remote_attestation/corpus/2: -------------------------------------------------------------------------------- 1 | 0��0�9�0 *�H�=010U EnigmaTEE0 200525075434Z 200823075334Z0'1%0#U EnigmaChain Node Certificate0Y0*�H�=*�H�=Bxmw_��`*x��y���7�f��p͊C;���W��l�|D�i�A����{��i0g0e `�H��B X0HGroqi28HpS5hXM83sd6k/iIlgcrFc3r+NjGkdwUMzdBBBqY+7yex8seuxDZxoeoRfKIzGLY03+UWkg9v+uyQ==0 *�H�=H0E P�qk{�P�����i�gGa*)���Q~Il�Z%!�S�۱�7��2������Ŝ@l�#;�*,v -------------------------------------------------------------------------------- /x/registration/remote_attestation/fuzz_test.go: -------------------------------------------------------------------------------- 1 | // rename this to fuzz.go if you want to run the fuzzer 2 | 3 | //go:build gofuzz 4 | // +build gofuzz 5 | 6 | package remote_attestation 7 | 8 | func Fuzz(data []byte) int { 9 | if _, err := VerifyRaCert(data); err != nil { 10 | return 0 11 | } 12 | return 1 13 | } 14 | -------------------------------------------------------------------------------- /x/registration/remote_attestation/reset_fuzzing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | echo "Clearing old results.." 5 | rm crashers/* 6 | rm suppressions/* 7 | 8 | 9 | echo "Building new package.." 10 | /home/bob/go/bin/go-fuzz-build github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation 11 | 12 | /home/bob/go/bin/go-fuzz -bin=remote_attestation-fuzz.zip -workdir=. 13 | -------------------------------------------------------------------------------- /x/registration/remote_attestation/utils.go: -------------------------------------------------------------------------------- 1 | package remote_attestation 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | func isSgxHardwareMode() bool { 8 | return os.Getenv("SGX_MODE") != "SW" 9 | } 10 | -------------------------------------------------------------------------------- /x/registration/testdata/attestation_cert_hw_old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/testdata/attestation_cert_hw_old -------------------------------------------------------------------------------- /x/registration/testdata/attestation_cert_hw_v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/testdata/attestation_cert_hw_v2 -------------------------------------------------------------------------------- /x/registration/testdata/attestation_cert_invalid: -------------------------------------------------------------------------------- 1 | 0��0�9�0 *�H�=010U EnigmaTEE0 200525075434Z 200823075334Z0'1%0#U EnigmaChain Node Certificate0Y0*�H�=*�H�=Bxmw_��`*x��y���7�f��p͊C;���W��l�|D�i�A����{��i0g0e `�H��B X0HGroqi28HpS5hXM83sd6k/iIlgcrFc3r+NjGkdwUMzdBBBqY+7yex8seuxDZxoeoRfKIzGLY03+UWkg9v+uyQ==0 *�H�=H0E P�qk{�P�����i�gGa*)���Q~Il�Z%!�S�۱�7��2������Ŝ@l�#;�*,v -------------------------------------------------------------------------------- /x/registration/testdata/attestation_cert_sw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/testdata/attestation_cert_sw -------------------------------------------------------------------------------- /x/registration/testdata/attestation_cert_sw.combined: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/testdata/attestation_cert_sw.combined -------------------------------------------------------------------------------- /x/registration/testdata/escrow.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scrtlabs/SecretNetwork/9b1d986841ccc684d452228d2c134068e512daf5/x/registration/testdata/escrow.wasm --------------------------------------------------------------------------------