├── .circleci └── config.yml ├── .editorconfig ├── .github └── workflows │ ├── autofix.yml │ ├── contract.yml │ ├── toml.yml │ ├── typo-check.yml │ └── workspace.yml ├── .gitignore ├── .mergify.yml ├── .prettierignore ├── .prettierrc.json ├── .taplo.toml ├── .vscode └── settings.json ├── CHANGELOG-pre1.0.0.md ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── IBC.md ├── LICENSE ├── MIGRATING.md ├── NOTICE ├── README.md ├── SECURITY.md ├── SEMANTICS.md ├── _typos.toml ├── codecov.yml ├── contracts ├── README.md ├── burner │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── burner.json │ │ └── raw │ │ │ ├── instantiate.json │ │ │ └── migrate.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── lib.rs │ │ └── msg.rs │ └── tests │ │ └── integration.rs ├── crypto-verify │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── crypto-verify.json │ │ └── raw │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_list_verification_schemes.json │ │ │ ├── response_to_verify_bls12_pairing_equality_g1.json │ │ │ ├── response_to_verify_bls12_pairing_equality_g2.json │ │ │ ├── response_to_verify_cosmos_signature.json │ │ │ ├── response_to_verify_ethereum_text.json │ │ │ ├── response_to_verify_ethereum_transaction.json │ │ │ ├── response_to_verify_secp256_r1_signature.json │ │ │ ├── response_to_verify_tendermint_batch.json │ │ │ ├── response_to_verify_tendermint_signature.json │ │ │ └── response_to_verify_webauthn.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── bls12_381.rs │ │ ├── contract.rs │ │ ├── ethereum.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── webauthn.rs │ └── tests │ │ └── integration.rs ├── cyberpunk │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── schema │ │ ├── cyberpunk.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_denom.json │ │ │ ├── response_to_denoms.json │ │ │ └── response_to_mirror_env.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ └── msg.rs │ └── tests │ │ └── integration.rs ├── empty │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ └── empty.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ └── lib.rs │ └── tests │ │ └── integration.rs ├── floaty │ ├── .cargo │ │ └── config.toml │ ├── .vscode │ │ └── settings.json │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── floaty.json │ │ └── raw │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_instructions.json │ │ │ ├── response_to_random_args_for.json │ │ │ └── response_to_run.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── floats.rs │ │ ├── instructions.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── hackatom │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── schema │ │ ├── hackatom.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── migrate.json │ │ │ ├── query.json │ │ │ ├── response_to_get_int.json │ │ │ ├── response_to_other_balance.json │ │ │ ├── response_to_recurse.json │ │ │ ├── response_to_verifier.json │ │ │ └── sudo.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── ibc-callbacks │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── ibc-callbacks.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ └── response_to_callback_stats.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── ibc-reflect-send │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── ibc-reflect-send.json │ │ ├── ibc │ │ │ ├── acknowledgement_msg_balances.json │ │ │ ├── acknowledgement_msg_dispatch.json │ │ │ ├── acknowledgement_msg_who_am_i.json │ │ │ └── packet_msg.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_account.json │ │ │ ├── response_to_admin.json │ │ │ └── response_to_list_accounts.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── ibc.rs │ │ ├── ibc_msg.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── ibc-reflect │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ │ ├── ibc-reflect.json │ │ ├── ibc │ │ │ ├── acknowledgement_msg_balance.json │ │ │ ├── acknowledgement_msg_dispatch.json │ │ │ ├── acknowledgement_msg_who_am_i.json │ │ │ └── packet_msg.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── migrate.json │ │ │ ├── query.json │ │ │ ├── response_to_account.json │ │ │ └── response_to_list_accounts.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── ibc2 │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── schema │ │ ├── ibc2.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ └── response_to_query_state.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── nested-contracts │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── inner-contract │ │ ├── .cargo │ │ │ └── config.toml │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── schema │ │ │ ├── inner-contract.json │ │ │ └── raw │ │ │ │ ├── execute.json │ │ │ │ ├── instantiate.json │ │ │ │ └── query.json │ │ └── src │ │ │ ├── bin │ │ │ └── schema.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ ├── schema │ │ ├── nested-contracts.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ └── query.json │ └── src │ │ ├── bin │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs ├── queue │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── schema │ │ ├── queue.json │ │ └── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── migrate.json │ │ │ ├── query.json │ │ │ ├── response_to_count.json │ │ │ ├── response_to_list.json │ │ │ ├── response_to_open_iterators.json │ │ │ ├── response_to_reducer.json │ │ │ └── response_to_sum.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs ├── reflect │ ├── .cargo │ │ └── config.toml │ ├── .editorconfig │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── schema │ │ ├── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_capitalized.json │ │ │ ├── response_to_chain.json │ │ │ ├── response_to_owner.json │ │ │ ├── response_to_raw.json │ │ │ └── response_to_sub_msg_result.json │ │ └── reflect.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ ├── state.rs │ │ └── testing.rs │ └── tests │ │ └── integration.rs ├── replier │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── schema │ │ ├── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ └── query.json │ │ └── replier.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ └── lib.rs │ └── tests │ │ └── integration.rs ├── staking │ ├── .cargo │ │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── schema │ │ ├── raw │ │ │ ├── execute.json │ │ │ ├── instantiate.json │ │ │ ├── query.json │ │ │ ├── response_to_balance.json │ │ │ ├── response_to_claims.json │ │ │ ├── response_to_investment.json │ │ │ └── response_to_token_info.json │ │ └── staking.json │ ├── src │ │ ├── bin │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ └── tests │ │ └── integration.rs └── virus │ ├── .cargo │ └── config.toml │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── schema │ ├── raw │ │ ├── execute.json │ │ └── instantiate.json │ └── virus.json │ ├── src │ ├── bin │ │ └── schema.rs │ ├── contract.rs │ ├── errors.rs │ ├── lib.rs │ └── msg.rs │ └── tests │ └── integration.rs ├── deny.toml ├── devtools ├── build_min.sh ├── check_contracts_fast.sh ├── check_contracts_full.sh ├── check_contracts_medium.sh ├── check_workspace.sh ├── clean.sh ├── clean_contracts.sh ├── deadlinks.py ├── format_md.sh ├── format_sh.sh ├── format_yml.sh ├── release_checks.sh ├── test_workspace.sh ├── update_crate.sh └── update_schemas.sh ├── docs ├── CAPABILITIES-BUILT-IN.md ├── CAPABILITIES.md ├── ERROR_HANDLING.md ├── FEATURES.md ├── GAS.md ├── MESSAGE_TYPES.md ├── MSRV.md ├── PINNING.md ├── STORAGE_KEYS.md ├── USING_COSMWASM_STD.md ├── idl.md └── simulate_riffle_shuffle.py └── packages ├── check ├── Cargo.toml ├── README.md ├── src │ └── main.rs └── tests │ └── cosmwasm_check_tests.rs ├── core ├── .cargo │ └── config.toml ├── Cargo.toml ├── README.md └── src │ ├── crypto.rs │ └── lib.rs ├── crypto ├── Cargo.toml ├── README.md ├── benches │ └── main.rs ├── src │ ├── backtrace.rs │ ├── bls12_381 │ │ ├── aggregate.rs │ │ ├── constants.rs │ │ ├── hash.rs │ │ ├── mod.rs │ │ ├── pairing.rs │ │ └── points.rs │ ├── ecdsa.rs │ ├── ed25519.rs │ ├── errors.rs │ ├── identity_digest.rs │ ├── lib.rs │ ├── secp256k1.rs │ └── secp256r1.rs ├── testdata │ ├── 186-4ecdsatestvectors │ │ ├── Readme.txt │ │ └── SigGen.txt │ ├── bls-tests │ │ ├── aggregate │ │ │ ├── aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json │ │ │ ├── aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json │ │ │ ├── aggregate_0xabababababababababababababababababababababababababababababababab.json │ │ │ ├── aggregate_infinity_signature.json │ │ │ ├── aggregate_na_signatures.json │ │ │ └── aggregate_single_signature.json │ │ ├── aggregate_verify │ │ │ ├── aggregate_verify_infinity_pubkey.json │ │ │ ├── aggregate_verify_na_pubkeys_and_infinity_signature.json │ │ │ ├── aggregate_verify_na_pubkeys_and_na_signature.json │ │ │ ├── aggregate_verify_tampered_signature.json │ │ │ └── aggregate_verify_valid.json │ │ ├── batch_verify │ │ │ ├── batch_verify_invalid_forged_signature_set.json │ │ │ ├── batch_verify_invalid_infinity_signature_set.json │ │ │ ├── batch_verify_valid_multiple_signature_set.json │ │ │ └── batch_verify_valid_simple_signature_set.json │ │ ├── deserialization_G1 │ │ │ ├── deserialization_fails_infinity_with_false_b_flag.json │ │ │ ├── deserialization_fails_infinity_with_true_b_flag.json │ │ │ ├── deserialization_fails_not_in_G1.json │ │ │ ├── deserialization_fails_not_in_curve.json │ │ │ ├── deserialization_fails_too_few_bytes.json │ │ │ ├── deserialization_fails_too_many_bytes.json │ │ │ ├── deserialization_fails_with_b_flag_and_a_flag_true.json │ │ │ ├── deserialization_fails_with_b_flag_and_x_nonzero.json │ │ │ ├── deserialization_fails_with_wrong_c_flag.json │ │ │ ├── deserialization_fails_x_equal_to_modulus.json │ │ │ ├── deserialization_fails_x_greater_than_modulus.json │ │ │ ├── deserialization_succeeds_correct_point.json │ │ │ └── deserialization_succeeds_infinity_with_true_b_flag.json │ │ ├── deserialization_G2 │ │ │ ├── deserialization_fails_infinity_with_false_b_flag.json │ │ │ ├── deserialization_fails_infinity_with_true_b_flag.json │ │ │ ├── deserialization_fails_not_in_G2.json │ │ │ ├── deserialization_fails_not_in_curve.json │ │ │ ├── deserialization_fails_too_few_bytes.json │ │ │ ├── deserialization_fails_too_many_bytes.json │ │ │ ├── deserialization_fails_with_b_flag_and_a_flag_true.json │ │ │ ├── deserialization_fails_with_b_flag_and_x_nonzero.json │ │ │ ├── deserialization_fails_with_wrong_c_flag.json │ │ │ ├── deserialization_fails_xim_equal_to_modulus.json │ │ │ ├── deserialization_fails_xim_greater_than_modulus.json │ │ │ ├── deserialization_fails_xre_equal_to_modulus.json │ │ │ ├── deserialization_fails_xre_greater_than_modulus.json │ │ │ ├── deserialization_succeeds_correct_point.json │ │ │ └── deserialization_succeeds_infinity_with_true_b_flag.json │ │ ├── fast_aggregate_verify │ │ │ ├── fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json │ │ │ ├── fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json │ │ │ ├── fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json │ │ │ ├── fast_aggregate_verify_infinity_pubkey.json │ │ │ ├── fast_aggregate_verify_na_pubkeys_and_infinity_signature.json │ │ │ ├── fast_aggregate_verify_na_pubkeys_and_na_signature.json │ │ │ ├── fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a.json │ │ │ ├── fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c.json │ │ │ ├── fast_aggregate_verify_tampered_signature_652ce62f09290811.json │ │ │ ├── fast_aggregate_verify_valid_3d7576f3c0e3570a.json │ │ │ ├── fast_aggregate_verify_valid_5e745ad0c6199a6c.json │ │ │ └── fast_aggregate_verify_valid_652ce62f09290811.json │ │ ├── hash_to_G2 │ │ │ ├── hash_to_G2__2782afaa8406d038.json │ │ │ ├── hash_to_G2__7590bd067999bbfb.json │ │ │ ├── hash_to_G2__a54942c8e365f378.json │ │ │ └── hash_to_G2__c938b486cf69e8f7.json │ │ └── verify │ │ │ ├── verify_infinity_pubkey_and_infinity_signature.json │ │ │ ├── verify_tampered_signature_case_195246ee3bd3b6ec.json │ │ │ ├── verify_tampered_signature_case_2ea479adf8c40300.json │ │ │ ├── verify_tampered_signature_case_2f09d443ab8a3ac2.json │ │ │ ├── verify_tampered_signature_case_3208262581c8fc09.json │ │ │ ├── verify_tampered_signature_case_6b3b17f6962a490c.json │ │ │ ├── verify_tampered_signature_case_6eeb7c52dfd9baf0.json │ │ │ ├── verify_tampered_signature_case_8761a0b7e920c323.json │ │ │ ├── verify_tampered_signature_case_d34885d766d5f705.json │ │ │ ├── verify_tampered_signature_case_e8a50c445c855360.json │ │ │ ├── verify_valid_case_195246ee3bd3b6ec.json │ │ │ ├── verify_valid_case_2ea479adf8c40300.json │ │ │ ├── verify_valid_case_2f09d443ab8a3ac2.json │ │ │ ├── verify_valid_case_3208262581c8fc09.json │ │ │ ├── verify_valid_case_6b3b17f6962a490c.json │ │ │ ├── verify_valid_case_6eeb7c52dfd9baf0.json │ │ │ ├── verify_valid_case_8761a0b7e920c323.json │ │ │ ├── verify_valid_case_d34885d766d5f705.json │ │ │ ├── verify_valid_case_e8a50c445c855360.json │ │ │ ├── verify_wrong_pubkey_case_195246ee3bd3b6ec.json │ │ │ ├── verify_wrong_pubkey_case_2ea479adf8c40300.json │ │ │ ├── verify_wrong_pubkey_case_2f09d443ab8a3ac2.json │ │ │ ├── verify_wrong_pubkey_case_3208262581c8fc09.json │ │ │ ├── verify_wrong_pubkey_case_6b3b17f6962a490c.json │ │ │ ├── verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json │ │ │ ├── verify_wrong_pubkey_case_8761a0b7e920c323.json │ │ │ ├── verify_wrong_pubkey_case_d34885d766d5f705.json │ │ │ ├── verify_wrong_pubkey_case_e8a50c445c855360.json │ │ │ └── verifycase_one_privkey_47117849458281be.json │ ├── ed25519_tests.json │ ├── eth-headers │ │ └── 1699693797.394876721s.json │ ├── extract_sig_gen.sh │ ├── rootberg │ │ ├── README.md │ │ ├── ecdsa_secp256k1_keccak256_raw.json │ │ ├── ecdsa_secp256k1_sha_256_raw.json │ │ ├── ecdsa_secp256r1_keccak256_raw.json │ │ └── ecdsa_secp256r1_sha_256_raw.json │ ├── secp256k1_tests.json │ ├── secp256r1_tests.json │ └── wycheproof │ │ ├── README.md │ │ ├── ecdsa_secp256k1_sha256_test.json │ │ ├── ecdsa_secp256k1_sha3_256_test.json │ │ ├── ecdsa_secp256k1_sha3_512_test.json │ │ ├── ecdsa_secp256k1_sha512_test.json │ │ ├── ecdsa_secp256r1_sha256_test.json │ │ ├── ecdsa_secp256r1_sha3_256_test.json │ │ ├── ecdsa_secp256r1_sha3_512_test.json │ │ └── ecdsa_secp256r1_sha512_test.json └── tests │ ├── bls12_381.rs │ ├── hashers.rs │ ├── rootberg.rs │ ├── rootberg_secp256k1.rs │ ├── rootberg_secp256r1.rs │ ├── wycheproof.rs │ ├── wycheproof_secp256k1.rs │ └── wycheproof_secp256r1.rs ├── derive ├── Cargo.toml ├── README.md └── src │ └── lib.rs ├── go-gen ├── Cargo.toml ├── README.md ├── src │ ├── go.rs │ ├── main.rs │ ├── schema.rs │ └── utils.rs └── tests │ ├── cosmwasm_std__AllBalanceResponse.go │ ├── cosmwasm_std__AllDelegationsResponse.go │ ├── cosmwasm_std__AllDenomMetadataResponse.go │ ├── cosmwasm_std__AllValidatorsResponse.go │ ├── cosmwasm_std__BalanceResponse.go │ ├── cosmwasm_std__BankMsg.go │ ├── cosmwasm_std__BankQuery.go │ ├── cosmwasm_std__BondedDenomResponse.go │ ├── cosmwasm_std__CodeInfoResponse.go │ ├── cosmwasm_std__ContractInfoResponse.go │ ├── cosmwasm_std__DelegationResponse.go │ ├── cosmwasm_std__DelegationRewardsResponse.go │ ├── cosmwasm_std__DelegationTotalRewardsResponse.go │ ├── cosmwasm_std__DelegatorValidatorsResponse.go │ ├── cosmwasm_std__DelegatorWithdrawAddressResponse.go │ ├── cosmwasm_std__DenomMetadataResponse.go │ ├── cosmwasm_std__DistributionMsg.go │ ├── cosmwasm_std__DistributionQuery.go │ ├── cosmwasm_std__GovMsg.go │ ├── cosmwasm_std__IbcMsg.go │ ├── cosmwasm_std__IbcQuery.go │ ├── cosmwasm_std__RawRangeResponse.go │ ├── cosmwasm_std__StakingMsg.go │ ├── cosmwasm_std__StakingQuery.go │ ├── cosmwasm_std__SupplyResponse.go │ ├── cosmwasm_std__ValidatorResponse.go │ ├── cosmwasm_std__WasmMsg.go │ └── cosmwasm_std__WasmQuery.go ├── schema-derive ├── Cargo.toml ├── README.md └── src │ ├── cw_serde.rs │ ├── error.rs │ ├── generate_api.rs │ ├── lib.rs │ ├── query_responses.rs │ └── query_responses │ └── context.rs ├── schema ├── .gitignore ├── Cargo.toml ├── README.md ├── src │ ├── casing.rs │ ├── export.rs │ ├── idl.rs │ ├── lib.rs │ ├── query_response.rs │ ├── remove.rs │ └── schema_for.rs └── tests │ ├── idl.rs │ └── snapshots │ └── idl__assert_maps_generate_correctly.snap ├── std ├── .cargo │ └── config.toml ├── Cargo.toml ├── README.md ├── src │ ├── __internal.rs │ ├── addresses.rs │ ├── assertions.rs │ ├── binary.rs │ ├── checksum.rs │ ├── coin.rs │ ├── coins.rs │ ├── conversion.rs │ ├── deps.rs │ ├── encoding.rs │ ├── errors │ │ ├── backtrace.rs │ │ ├── mod.rs │ │ ├── recover_pubkey_error.rs │ │ ├── std_error.rs │ │ ├── system_error.rs │ │ └── verification_error.rs │ ├── exports │ │ ├── exports.rs │ │ ├── imports.rs │ │ ├── memory.rs │ │ ├── mod.rs │ │ └── panic.rs │ ├── forward_ref.rs │ ├── hex_binary.rs │ ├── ibc.rs │ ├── ibc │ │ ├── callbacks.rs │ │ └── transfer_msg_builder.rs │ ├── ibc2.rs │ ├── import_helpers.rs │ ├── iterator.rs │ ├── lib.rs │ ├── math │ │ ├── conversion.rs │ │ ├── decimal.rs │ │ ├── decimal256.rs │ │ ├── fraction.rs │ │ ├── int128.rs │ │ ├── int256.rs │ │ ├── int512.rs │ │ ├── int64.rs │ │ ├── isqrt.rs │ │ ├── mod.rs │ │ ├── num_consts.rs │ │ ├── signed_decimal.rs │ │ ├── signed_decimal_256.rs │ │ ├── uint128.rs │ │ ├── uint256.rs │ │ ├── uint512.rs │ │ └── uint64.rs │ ├── metadata.rs │ ├── msgpack.rs │ ├── never.rs │ ├── pagination.rs │ ├── prelude.rs │ ├── query │ │ ├── bank.rs │ │ ├── distribution.rs │ │ ├── ibc.rs │ │ ├── mod.rs │ │ ├── query_response.rs │ │ ├── staking.rs │ │ └── wasm.rs │ ├── results │ │ ├── contract_result.rs │ │ ├── cosmos_msg.rs │ │ ├── empty.rs │ │ ├── events.rs │ │ ├── mod.rs │ │ ├── query.rs │ │ ├── response.rs │ │ ├── submessages.rs │ │ └── system_result.rs │ ├── sections.rs │ ├── serde.rs │ ├── stdack.rs │ ├── storage_keys │ │ ├── length_prefixed.rs │ │ ├── mod.rs │ │ └── range.rs │ ├── testing │ │ ├── assertions.rs │ │ ├── message_info.rs │ │ ├── mock.rs │ │ ├── mod.rs │ │ └── storage.rs │ ├── timestamp.rs │ ├── traits.rs │ ├── types.rs │ └── utils.rs └── testdata │ └── instantiate2_addresses.json ├── vm-derive ├── Cargo.toml └── src │ ├── hash_function.rs │ └── lib.rs └── vm ├── Cargo.toml ├── README.md ├── benches └── main.rs ├── examples ├── heap_profiling.rs ├── module_size.rs ├── module_size.sh └── multi_threaded_cache.rs ├── src ├── backend.rs ├── cache.rs ├── calls.rs ├── capabilities.rs ├── compatibility.rs ├── config.rs ├── conversion.rs ├── environment.rs ├── errors │ ├── backtrace.rs │ ├── communication_error.rs │ ├── mod.rs │ ├── region_validation_error.rs │ └── vm_error.rs ├── filesystem.rs ├── imports.rs ├── instance.rs ├── lib.rs ├── limited.rs ├── memory.rs ├── modules │ ├── cached_module.rs │ ├── file_system_cache.rs │ ├── in_memory_cache.rs │ ├── mod.rs │ ├── pinned_memory_cache.rs │ └── versioning.rs ├── parsed_wasm.rs ├── sections.rs ├── serde.rs ├── size.rs ├── static_analysis.rs ├── testing │ ├── calls.rs │ ├── instance.rs │ ├── mock.rs │ ├── mod.rs │ ├── querier.rs │ └── storage.rs └── wasm_backend │ ├── compile.rs │ ├── engine.rs │ ├── gatekeeper.rs │ ├── limiting_tunables.rs │ └── mod.rs └── testdata ├── README.md ├── corrupted.wasm ├── cyberpunk.wasm ├── cyberpunk_rust170.wasm ├── empty.wasm ├── floaty.wasm ├── floaty_0.16.wasm ├── floaty_1.0.wasm ├── floaty_1.2.wasm ├── floaty_2.0.wasm ├── hackatom.wasm ├── hackatom_0.10.wasm ├── hackatom_0.11.wasm ├── hackatom_0.12.wasm ├── hackatom_0.14.wasm ├── hackatom_0.15.wasm ├── hackatom_0.16.wasm ├── hackatom_0.7.wasm ├── hackatom_0.8.wasm ├── hackatom_0.9.wasm ├── hackatom_1.0.wasm ├── hackatom_1.2.wasm ├── hackatom_1.3.wasm ├── ibc2.wasm ├── ibc_callbacks.wasm ├── ibc_reflect.wasm ├── ibc_reflect_0.14.wasm ├── ibc_reflect_0.15.wasm ├── ibc_reflect_0.16.wasm ├── ibc_reflect_1.0.wasm └── ibc_reflect_1.2.wasm /.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 | [*.toml] 14 | indent_size = 4 # For compliance with our taplo config 15 | 16 | [*.py] 17 | indent_size = 4 18 | 19 | [*.go] 20 | indent_style = tab 21 | indent_size = 4 22 | -------------------------------------------------------------------------------- /.github/workflows/contract.yml: -------------------------------------------------------------------------------- 1 | name: Contract 2 | 3 | # Pushes to long living branches and all PRs 4 | on: 5 | push: 6 | branches: 7 | - main 8 | - 0.[0-9]+ 9 | pull_request: 10 | 11 | env: 12 | RUST_BACKTRACE: 1 13 | 14 | jobs: 15 | test-hackatom: 16 | name: ${{ matrix.build }} 17 | runs-on: ${{ matrix.os }} 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | include: 22 | - build: macOS 23 | os: macOS-latest 24 | - build: Windows 25 | os: windows-latest 26 | defaults: 27 | run: 28 | shell: bash 29 | working-directory: ./contracts/hackatom 30 | steps: 31 | - name: Checkout sources 32 | uses: actions/checkout@v4 33 | - name: Install Rust 34 | uses: dtolnay/rust-toolchain@master 35 | with: 36 | toolchain: 1.81.0 37 | targets: wasm32-unknown-unknown 38 | - name: Build hackatom wasm 39 | run: cargo wasm --locked 40 | - name: Unit Test hackatom 41 | run: cargo unit-test --locked 42 | - name: Integration Test hackatom 43 | run: cargo integration-test --locked 44 | -------------------------------------------------------------------------------- /.github/workflows/toml.yml: -------------------------------------------------------------------------------- 1 | name: "TOML checks" 2 | 3 | on: 4 | merge_group: 5 | pull_request: 6 | push: 7 | branches: 8 | - main 9 | workflow_dispatch: 10 | 11 | jobs: 12 | fmt-check: 13 | name: "Formatting" 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Install taplo 18 | run: | 19 | curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \ 20 | | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo 21 | - run: | 22 | taplo fmt 23 | CHANGES_IN_REPO=$(git status --porcelain) 24 | if [[ -n "$CHANGES_IN_REPO" ]]; then 25 | exit 1 26 | fi 27 | -------------------------------------------------------------------------------- /.github/workflows/typo-check.yml: -------------------------------------------------------------------------------- 1 | name: Check for typos 2 | 3 | on: 4 | merge_group: 5 | pull_request: 6 | push: 7 | branches: 8 | - main 9 | workflow_dispatch: 10 | 11 | jobs: 12 | check-typos: 13 | name: "Spell-check repository source" 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | - id: files 19 | uses: tj-actions/changed-files@v46 20 | with: 21 | files_ignore: | 22 | contracts/**/schema/** 23 | packages/crypto/**/*.json 24 | packages/vm/**/*.wasm 25 | - name: Run spell-check 26 | uses: crate-ci/typos@master 27 | with: 28 | files: ${{ steps.files.outputs.all_changed_files }} 29 | -------------------------------------------------------------------------------- /.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 | .idea/ 13 | *.iml 14 | 15 | # Auto-gen 16 | .cargo-ok 17 | 18 | # Log files (e.g. memory profiling) 19 | *.log 20 | dhat-heap.json 21 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Used for *.md formatting in devtools/format_md.sh 2 | target/ 3 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": "*.md", 5 | "options": { 6 | "proseWrap": "always" 7 | } 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.taplo.toml: -------------------------------------------------------------------------------- 1 | [formatting] 2 | indent_string = " " 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.cargo.features": [ 3 | "ibc2", 4 | "stargate", 5 | "staking", 6 | "cosmwasm_2_1" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["packages/*"] 3 | exclude = ["contracts"] 4 | 5 | # Resolver has to be set explicitly in workspaces 6 | # due to https://github.com/rust-lang/cargo/issues/9956 7 | resolver = "2" 8 | 9 | [workspace.package] 10 | version = "3.0.0-rc.0" 11 | 12 | [workspace.dependencies] 13 | schemars = "0.8.4" 14 | serde = { version = "1.0.192", default-features = false, features = [ 15 | "alloc", 16 | "derive", 17 | ] } 18 | 19 | [workspace.metadata.release] 20 | shared-version = true 21 | tag-message = "chore: Release cosmwasm v{{version}}" 22 | tag-name = "v{{version}}" 23 | -------------------------------------------------------------------------------- /IBC.md: -------------------------------------------------------------------------------- 1 | Information on IBC can be found in 2 | [the CosmWasm documentation](https://docs.cosmwasm.com/ibc) 3 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Jehan Tremback 2 | Copyright 2019-2021 Confio OÜ 3 | Copyright 2019-2020 Simon Warta 4 | Copyright 2021,2022,2023,2024 Confio GmbH 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | This repository is maintained by Confio as part of the CosmWasm stack. Please 4 | see https://github.com/CosmWasm/advisories/blob/main/SECURITY.md for our 5 | security policy. 6 | -------------------------------------------------------------------------------- /SEMANTICS.md: -------------------------------------------------------------------------------- 1 | This file was updated and moved to: 2 | 3 | - [Semantics](https://docs.cosmwasm.com/core/architecture/semantics) 4 | - [Transactions](https://docs.cosmwasm.com/core/architecture/transactions) 5 | - [Reply](https://docs.cosmwasm.com/core/entrypoints/reply) 6 | -------------------------------------------------------------------------------- /_typos.toml: -------------------------------------------------------------------------------- 1 | [default] 2 | extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"] 3 | 4 | [files] 5 | extend-exclude = ["contracts/**/schema/**", "packages/crypto/**/*.json"] 6 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | threshold: 0.05% 8 | patch: 9 | default: 10 | threshold: 0.05% 11 | 12 | fixes: 13 | - "/root/project/::" # reduce root, e.g. "/root/project/path/" => "path/" 14 | 15 | flags: 16 | cosmwasm-check: 17 | paths: 18 | - packages/check/ 19 | #cosmwasm-core: 20 | # paths: 21 | # - packages/core/ 22 | cosmwasm-crypto: 23 | paths: 24 | - packages/crypto/ 25 | cosmwasm-derive: 26 | paths: 27 | - packages/derive/ 28 | cosmwasm-schema: 29 | paths: 30 | - packages/schema/ 31 | cosmwasm-schema-derive: 32 | paths: 33 | - packages/schema-derive/ 34 | cosmwasm-std: 35 | paths: 36 | - packages/std/ 37 | cosmwasm-vm: 38 | paths: 39 | - packages/vm/ 40 | cosmwasm-vm-derive: 41 | paths: 42 | - packages/vm-derive/ 43 | -------------------------------------------------------------------------------- /contracts/burner/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/burner/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "burner" 3 | version = "0.0.0" 4 | authors = [ 5 | "Ethan Frey ", 6 | "Simon Warta ", 7 | ] 8 | edition = "2021" 9 | publish = false 10 | license = "Apache-2.0" 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [lib] 15 | crate-type = ["cdylib", "rlib"] 16 | 17 | [profile.release] 18 | opt-level = 3 19 | debug = false 20 | rpath = false 21 | lto = true 22 | debug-assertions = false 23 | codegen-units = 1 24 | panic = 'abort' 25 | incremental = false 26 | overflow-checks = true 27 | 28 | [dependencies] 29 | cosmwasm-schema = { path = "../../packages/schema" } 30 | cosmwasm-std = { path = "../../packages/std", features = [ 31 | "cosmwasm_1_4", 32 | "iterator", 33 | ] } 34 | schemars = "0.8.12" 35 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 36 | 37 | [dev-dependencies] 38 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 39 | "iterator", 40 | ] } 41 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/burner/schema/raw/instantiate.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 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/burner/schema/raw/migrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "denoms", 7 | "payout" 8 | ], 9 | "properties": { 10 | "delete": { 11 | "description": "Optional amount of items to delete in this call. If it is not provided, nothing will be deleted. You can delete further items in a subsequent execute call.", 12 | "default": 0, 13 | "type": "integer", 14 | "format": "uint32", 15 | "minimum": 0.0 16 | }, 17 | "denoms": { 18 | "description": "The denoms of the final payout. Balances of tokens not listed here will remain in the account untouched.", 19 | "type": "array", 20 | "items": { 21 | "type": "string" 22 | } 23 | }, 24 | "payout": { 25 | "description": "The address we send all remaining balance to. See denoms below for the denoms to consider.", 26 | "type": "string" 27 | } 28 | }, 29 | "additionalProperties": false 30 | } 31 | -------------------------------------------------------------------------------- /contracts/burner/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use burner::msg::{InstantiateMsg, MigrateMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | migrate: MigrateMsg, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /contracts/burner/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | -------------------------------------------------------------------------------- /contracts/crypto-verify/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/crypto-verify/README.md: -------------------------------------------------------------------------------- 1 | # Crypto Verify Contract 2 | 3 | This is a simple contract to demonstrate cryptographic signature verification 4 | from contracts. 5 | 6 | ECDSA Secp256k1 parameters are currently supported. Ed25519 support is upcoming. 7 | 8 | ## Formats 9 | 10 | Input formats are serialized byte slices for Message, Signature, and Public Key. 11 | 12 | ### secp256k1: 13 | 14 | - Message: A serialized message. It will be hashed by the contract using 15 | SHA-256, and the hashed value will be fed to the verification function. 16 | - Signature: Serialized signature, in "compact" Cosmos format (64 bytes). 17 | Ethereum DER needs to be converted. 18 | - Public Key: Compressed (33 bytes) or uncompressed (65 bytes) serialized public 19 | key, in SEC format. 20 | 21 | Output is a boolean value indicating if verification succeeded or not. 22 | 23 | ## Remarks 24 | 25 | In case of an error (wrong or unsupported inputs), the current implementation 26 | returns an error, which can be easily handled by the contract, or returned to 27 | the client. 28 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_list_verification_schemes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ListVerificationsResponse", 4 | "type": "object", 5 | "required": [ 6 | "verification_schemes" 7 | ], 8 | "properties": { 9 | "verification_schemes": { 10 | "type": "array", 11 | "items": { 12 | "type": "string" 13 | } 14 | } 15 | }, 16 | "additionalProperties": false 17 | } 18 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g1.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g2.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_cosmos_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_ethereum_text.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_ethereum_transaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_secp256_r1_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_tendermint_batch.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_tendermint_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/schema/raw/response_to_verify_webauthn.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "VerifyResponse", 4 | "type": "object", 5 | "required": [ 6 | "verifies" 7 | ], 8 | "properties": { 9 | "verifies": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/crypto-verify/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use crypto_verify::msg::{InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /contracts/crypto-verify/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod bls12_381; 2 | pub mod contract; 3 | mod ethereum; 4 | pub mod msg; 5 | mod webauthn; 6 | -------------------------------------------------------------------------------- /contracts/cyberpunk/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/cyberpunk/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cyberpunk" 3 | version = "0.0.0" 4 | authors = ["Tomasz Kurcz "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | [lib] 10 | crate-type = ["cdylib", "rlib"] 11 | 12 | [profile.release] 13 | opt-level = 3 14 | debug = false 15 | rpath = false 16 | lto = true 17 | debug-assertions = false 18 | codegen-units = 1 19 | panic = 'abort' 20 | incremental = false 21 | overflow-checks = true 22 | 23 | [dependencies] 24 | cosmwasm-schema = { path = "../../packages/schema" } 25 | cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ 26 | "cosmwasm_1_3", 27 | "exports", 28 | "std", 29 | ] } 30 | rust-argon2 = "2.1" 31 | thiserror = "1.0.26" 32 | 33 | [dev-dependencies] 34 | cosmwasm-vm = { path = "../../packages/vm", default-features = false } 35 | tempfile = "3.1.0" 36 | -------------------------------------------------------------------------------- /contracts/cyberpunk/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/cyberpunk/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | use cosmwasm_std::Empty; 3 | 4 | use cyberpunk::msg::{ExecuteMsg, QueryMsg}; 5 | 6 | fn main() { 7 | write_api! { 8 | instantiate: Empty, 9 | query: QueryMsg, 10 | execute: ExecuteMsg, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /contracts/cyberpunk/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum ContractError { 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 | } 10 | -------------------------------------------------------------------------------- /contracts/cyberpunk/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod errors; 3 | pub mod msg; 4 | -------------------------------------------------------------------------------- /contracts/empty/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/empty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "empty" 3 | version = "0.0.0" 4 | authors = ["Christoph Otter "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } 28 | schemars = "0.8.12" 29 | 30 | [dev-dependencies] 31 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 32 | "iterator", 33 | ] } 34 | -------------------------------------------------------------------------------- /contracts/empty/README.md: -------------------------------------------------------------------------------- 1 | # Empty Contract 2 | 3 | This is a minimal contract to test against. It has no functionality and only has 4 | the minimum required to be a valid contract. 5 | -------------------------------------------------------------------------------- /contracts/empty/schema/empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "empty", 3 | "contract_version": "0.0.0", 4 | "idl_version": "1.0.0", 5 | "instantiate": null, 6 | "execute": null, 7 | "query": null, 8 | "migrate": null, 9 | "sudo": null, 10 | "responses": null 11 | } 12 | -------------------------------------------------------------------------------- /contracts/empty/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | fn main() { 4 | write_api! {} 5 | } 6 | -------------------------------------------------------------------------------- /contracts/empty/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Make sure to reexport cosmwasm_std, so the standard entry points are kept in the final wasm 2 | pub use cosmwasm_std; 3 | -------------------------------------------------------------------------------- /contracts/empty/tests/integration.rs: -------------------------------------------------------------------------------- 1 | //! This integration test tries to run and call the generated wasm. 2 | //! It depends on a Wasm build being available, which you can create with `cargo wasm`. 3 | //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. 4 | 5 | use cosmwasm_vm::testing::mock_instance; 6 | 7 | // This line will test the output of cargo wasm 8 | static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/empty.wasm"); 9 | // You can uncomment this line instead to test productionified build from rust-optimizer 10 | // static WASM: &[u8] = include_bytes!("../contract.wasm"); 11 | 12 | #[test] 13 | fn validation_succeeds() { 14 | mock_instance(WASM, &[]); 15 | } 16 | -------------------------------------------------------------------------------- /contracts/floaty/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/floaty/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.cargo.target": "wasm32-unknown-unknown", 3 | "rust-analyzer.cargo.extraEnv": { 4 | "RUSTFLAGS": "-C target-feature=+nontrapping-fptoint" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /contracts/floaty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "floaty" 3 | version = "0.0.0" 4 | authors = ["Ethan Frey "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std" } 28 | schemars = "0.8.12" 29 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 30 | rand_chacha = { version = "0.3.1", default-features = false } 31 | 32 | [dev-dependencies] 33 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 34 | "iterator", 35 | ] } 36 | -------------------------------------------------------------------------------- /contracts/floaty/README.md: -------------------------------------------------------------------------------- 1 | # Floaty Contract 2 | 3 | This contract contains all WebAssembly floating point instructions. It is used 4 | for testing the floating point support. 5 | 6 | In order to compile it, you need a nightly version of Rust and enable the 7 | `nontrapping-fptoint` target-feature. This allows the usage of 8 | [some more conversion instructions](https://github.com/WebAssembly/spec/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md). 9 | To do this, run: 10 | 11 | ```sh 12 | RUSTFLAGS="-C link-arg=-s -C target-feature=+nontrapping-fptoint" cargo wasm 13 | ``` 14 | -------------------------------------------------------------------------------- /contracts/floaty/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/floaty/schema/raw/response_to_instructions.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Array_of_String", 4 | "type": "array", 5 | "items": { 6 | "type": "string" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /contracts/floaty/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use cosmwasm_std::Empty; 4 | use floaty::msg::QueryMsg; 5 | 6 | fn main() { 7 | write_api! { 8 | instantiate: Empty, 9 | query: QueryMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/floaty/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(target_arch = "wasm32", feature(asm_experimental_arch))] 2 | 3 | pub mod contract; 4 | pub(crate) mod floats; 5 | mod instructions; 6 | pub mod msg; 7 | pub mod state; 8 | -------------------------------------------------------------------------------- /contracts/floaty/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{cw_serde, QueryResponses}; 2 | 3 | use crate::instructions::Value; 4 | 5 | #[cw_serde] 6 | pub enum ValueType { 7 | Float, 8 | Int, 9 | } 10 | 11 | #[cw_serde] 12 | #[derive(QueryResponses)] 13 | pub enum QueryMsg { 14 | /// Returns valid random arguments for the given instruction 15 | #[returns(Vec)] 16 | RandomArgsFor { instruction: String, seed: u64 }, 17 | /// Returns a list of all instructions 18 | #[returns(Vec)] 19 | Instructions {}, 20 | /// Runs the given instruction with the given arguments and returns the result 21 | #[returns(Value)] 22 | Run { 23 | instruction: String, 24 | args: Vec, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /contracts/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, Eq, JsonSchema)] 9 | pub struct State { 10 | pub verifier: Addr, 11 | pub beneficiary: Addr, 12 | pub funder: Addr, 13 | } 14 | -------------------------------------------------------------------------------- /contracts/floaty/tests/integration.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_vm::testing::mock_instance; 2 | 3 | // This line will test the output of cargo wasm 4 | static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/floaty.wasm"); 5 | // You can uncomment this line instead to test productionified build from rust-optimizer 6 | // static WASM: &[u8] = include_bytes!("../contract.wasm"); 7 | 8 | #[test] 9 | fn validation_succeeds() { 10 | mock_instance(WASM, &[]); 11 | } 12 | -------------------------------------------------------------------------------- /contracts/hackatom/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/hackatom/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hackatom" 3 | version = "0.0.0" 4 | authors = ["Ethan Frey "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ 28 | "cosmwasm_2_2", 29 | "exports", 30 | "std", 31 | ] } 32 | schemars = "0.8.12" 33 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 34 | sha2 = "0.10" 35 | thiserror = "1.0.26" 36 | 37 | [dev-dependencies] 38 | cosmwasm-vm = { path = "../../packages/vm", default-features = false } 39 | -------------------------------------------------------------------------------- /contracts/hackatom/schema/raw/instantiate.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 | "additionalProperties": false 18 | } 19 | -------------------------------------------------------------------------------- /contracts/hackatom/schema/raw/migrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "description": "MigrateMsg allows a privileged contract administrator to run a migration on the contract. In this (demo) case it is just migrating from one hackatom code to the same code, but taking advantage of the migration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done by blockchain logic (in the future by blockchain governance)", 5 | "type": "object", 6 | "required": [ 7 | "verifier" 8 | ], 9 | "properties": { 10 | "verifier": { 11 | "type": "string" 12 | } 13 | }, 14 | "additionalProperties": false 15 | } 16 | -------------------------------------------------------------------------------- /contracts/hackatom/schema/raw/response_to_get_int.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "IntResponse", 4 | "type": "object", 5 | "required": [ 6 | "int" 7 | ], 8 | "properties": { 9 | "int": { 10 | "type": "integer", 11 | "format": "uint32", 12 | "minimum": 0.0 13 | } 14 | }, 15 | "additionalProperties": false 16 | } 17 | -------------------------------------------------------------------------------- /contracts/hackatom/schema/raw/response_to_recurse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "RecurseResponse", 4 | "type": "object", 5 | "required": [ 6 | "hashed" 7 | ], 8 | "properties": { 9 | "hashed": { 10 | "description": "hashed is the result of running sha256 \"work+1\" times on the contract's human address", 11 | "allOf": [ 12 | { 13 | "$ref": "#/definitions/Binary" 14 | } 15 | ] 16 | } 17 | }, 18 | "additionalProperties": false, 19 | "definitions": { 20 | "Binary": { 21 | "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. See also .", 22 | "type": "string" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/hackatom/schema/raw/response_to_verifier.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 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/hackatom/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use hackatom::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg, SudoMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | execute: ExecuteMsg, 10 | sudo: SudoMsg, 11 | migrate: MigrateMsg, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /contracts/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 | // this is whatever we want 13 | #[error("Downgrade is not supported")] 14 | Downgrade, 15 | } 16 | -------------------------------------------------------------------------------- /contracts/hackatom/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /contracts/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, Eq, JsonSchema)] 9 | pub struct State { 10 | pub verifier: Addr, 11 | pub beneficiary: Addr, 12 | pub funder: Addr, 13 | } 14 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ibc-callbacks" 3 | version = "0.0.0" 4 | authors = ["Christoph Otter "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", features = [ 28 | "iterator", 29 | "stargate", 30 | ] } 31 | schemars = "0.8.3" 32 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 33 | 34 | [dev-dependencies] 35 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 36 | "iterator", 37 | "stargate", 38 | ] } 39 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/README.md: -------------------------------------------------------------------------------- 1 | # IBC Callbacks Contract 2 | 3 | This is a simple contract to demonstrate [IBC Callbacks]. It sends an ICS-20 transfer 4 | message to a remote chain and writes to storage which callbacks were called. This 5 | can then be queried using the `CallbackStats` query. 6 | 7 | [ibc callbacks]: 8 | https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-008-app-caller-cbs.md 9 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/schema/raw/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "oneOf": [ 5 | { 6 | "description": "Returns stats about what callbacks have been received", 7 | "type": "object", 8 | "required": [ 9 | "callback_stats" 10 | ], 11 | "properties": { 12 | "callback_stats": { 13 | "type": "object", 14 | "additionalProperties": false 15 | } 16 | }, 17 | "additionalProperties": false 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | use cosmwasm_std::Empty; 3 | use ibc_callbacks::msg::{ExecuteMsg, QueryMsg}; 4 | 5 | fn main() { 6 | // Clear & write standard API 7 | write_api! { 8 | instantiate: Empty, 9 | query: QueryMsg, 10 | execute: ExecuteMsg, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{cw_serde, QueryResponses}; 2 | 3 | #[cw_serde] 4 | #[derive(QueryResponses)] 5 | pub enum QueryMsg { 6 | /// Returns stats about what callbacks have been received 7 | #[returns(crate::state::CallbackStats)] 8 | CallbackStats {}, 9 | } 10 | 11 | #[cw_serde] 12 | pub enum ExecuteMsg { 13 | Transfer { 14 | /// Address on the destination chain 15 | to_address: String, 16 | /// The channel to send the packet through 17 | channel_id: String, 18 | /// The amount of seconds from now the transfer should timeout at 19 | timeout_seconds: u32, 20 | /// Who should receive callbacks for the message 21 | #[serde(default)] 22 | callback_type: CallbackType, 23 | }, 24 | } 25 | 26 | #[cw_serde] 27 | #[derive(Default)] 28 | pub enum CallbackType { 29 | /// Only this contract on the source chain should receive callbacks 30 | Src, 31 | /// Only the destination address should receive callbacks 32 | Dst, 33 | /// Both the source contract and the destination address should receive callbacks 34 | #[default] 35 | Both, 36 | } 37 | -------------------------------------------------------------------------------- /contracts/ibc-callbacks/tests/integration.rs: -------------------------------------------------------------------------------- 1 | //! This integration test tries to run and call the generated wasm. 2 | //! It depends on a Wasm build being available, which you can create with `cargo wasm`. 3 | //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. 4 | 5 | use cosmwasm_vm::testing::mock_instance; 6 | 7 | // This line will test the output of cargo wasm 8 | static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/ibc_callbacks.wasm"); 9 | // You can uncomment this line instead to test productionified build from rust-optimizer 10 | // static WASM: &[u8] = include_bytes!("../../artifacts/ibc_callbacks.wasm"); 11 | 12 | #[test] 13 | fn validation_succeeds() { 14 | mock_instance(WASM, &[]); 15 | } 16 | -------------------------------------------------------------------------------- /contracts/ibc-reflect-send/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/ibc-reflect-send/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ibc-reflect-send" 3 | version = "0.0.0" 4 | authors = ["Ethan Frey "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", features = [ 28 | "iterator", 29 | "staking", 30 | "stargate", 31 | ] } 32 | schemars = "0.8.12" 33 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 34 | 35 | [dev-dependencies] 36 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 37 | "iterator", 38 | "stargate", 39 | ] } 40 | -------------------------------------------------------------------------------- /contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_dispatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AcknowledgementMsgDispatch", 4 | "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", 5 | "oneOf": [ 6 | { 7 | "type": "object", 8 | "required": [ 9 | "ok" 10 | ], 11 | "properties": { 12 | "ok": { 13 | "type": "null" 14 | } 15 | }, 16 | "additionalProperties": false 17 | }, 18 | { 19 | "type": "object", 20 | "required": [ 21 | "error" 22 | ], 23 | "properties": { 24 | "error": { 25 | "type": "string" 26 | } 27 | }, 28 | "additionalProperties": false 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /contracts/ibc-reflect-send/schema/raw/instantiate.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 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/ibc-reflect-send/schema/raw/response_to_admin.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 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ibc-reflect" 3 | version = "0.0.0" 4 | authors = ["Ethan Frey "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", features = [ 28 | "cosmwasm_2_2", 29 | "iterator", 30 | "stargate", 31 | ] } 32 | schemars = "0.8.12" 33 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 34 | 35 | [dev-dependencies] 36 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 37 | "iterator", 38 | "stargate", 39 | ] } 40 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/schema/ibc/acknowledgement_msg_dispatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AcknowledgementMsgDispatch", 4 | "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", 5 | "oneOf": [ 6 | { 7 | "type": "object", 8 | "required": [ 9 | "ok" 10 | ], 11 | "properties": { 12 | "ok": { 13 | "type": "null" 14 | } 15 | }, 16 | "additionalProperties": false 17 | }, 18 | { 19 | "type": "object", 20 | "required": [ 21 | "error" 22 | ], 23 | "properties": { 24 | "error": { 25 | "type": "string" 26 | } 27 | }, 28 | "additionalProperties": false 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/schema/raw/instantiate.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 | "additionalProperties": false 17 | } 18 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/schema/raw/migrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/schema/raw/response_to_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "AccountResponse", 4 | "type": "object", 5 | "properties": { 6 | "account": { 7 | "type": [ 8 | "string", 9 | "null" 10 | ] 11 | } 12 | }, 13 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/schema/raw/response_to_list_accounts.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ListAccountsResponse", 4 | "type": "object", 5 | "required": [ 6 | "accounts" 7 | ], 8 | "properties": { 9 | "accounts": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "#/definitions/AccountInfo" 13 | } 14 | } 15 | }, 16 | "additionalProperties": false, 17 | "definitions": { 18 | "AccountInfo": { 19 | "type": "object", 20 | "required": [ 21 | "account", 22 | "channel_id" 23 | ], 24 | "properties": { 25 | "account": { 26 | "type": "string" 27 | }, 28 | "channel_id": { 29 | "type": "string" 30 | } 31 | }, 32 | "additionalProperties": false 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /contracts/ibc-reflect/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | -------------------------------------------------------------------------------- /contracts/ibc2/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/ibc2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ibc2" 3 | version = "0.0.0" 4 | authors = ["Tomasz Kulik "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | [lib] 10 | crate-type = ["cdylib", "rlib"] 11 | 12 | [profile.release] 13 | opt-level = 3 14 | debug = false 15 | rpath = false 16 | lto = true 17 | debug-assertions = false 18 | codegen-units = 1 19 | panic = 'abort' 20 | incremental = false 21 | overflow-checks = true 22 | 23 | [dependencies] 24 | cosmwasm-schema = { path = "../../packages/schema" } 25 | cosmwasm-std = { path = "../../packages/std", features = ["ibc2"] } 26 | schemars = "0.8.3" 27 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 28 | thiserror = "1.0.26" 29 | -------------------------------------------------------------------------------- /contracts/ibc2/schema/raw/execute.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "oneOf": [ 5 | { 6 | "type": "object", 7 | "required": [ 8 | "increment" 9 | ], 10 | "properties": { 11 | "increment": { 12 | "type": "object", 13 | "required": [ 14 | "channel_id", 15 | "destination_port" 16 | ], 17 | "properties": { 18 | "channel_id": { 19 | "type": "string" 20 | }, 21 | "destination_port": { 22 | "type": "string" 23 | } 24 | }, 25 | "additionalProperties": false 26 | } 27 | }, 28 | "additionalProperties": false 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /contracts/ibc2/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/ibc2/schema/raw/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "oneOf": [ 5 | { 6 | "type": "object", 7 | "required": [ 8 | "query_state" 9 | ], 10 | "properties": { 11 | "query_state": { 12 | "type": "object", 13 | "additionalProperties": false 14 | } 15 | }, 16 | "additionalProperties": false 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /contracts/ibc2/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | use cosmwasm_std::Empty; 3 | use ibc2::msg::QueryMsg; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: Empty, 8 | query: QueryMsg, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /contracts/ibc2/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | -------------------------------------------------------------------------------- /contracts/ibc2/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{cw_serde, QueryResponses}; 2 | 3 | #[cw_serde] 4 | #[derive(QueryResponses)] 5 | pub enum QueryMsg { 6 | #[returns(crate::state::State)] 7 | QueryState {}, 8 | } 9 | 10 | #[cw_serde] 11 | pub struct IbcPayload { 12 | pub response_without_ack: bool, 13 | pub send_async_ack_for_prev_msg: bool, 14 | } 15 | -------------------------------------------------------------------------------- /contracts/ibc2/src/state.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::Ibc2PacketSendMsg; 2 | use schemars::JsonSchema; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | #[derive(Default, Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] 6 | pub struct State { 7 | pub ibc2_packet_ack_counter: u32, 8 | pub ibc2_packet_receive_counter: u32, 9 | pub ibc2_packet_timeout_counter: u32, 10 | pub last_source_client: String, 11 | pub last_packet_seq: u64, 12 | pub last_packet_sent: Option, 13 | } 14 | 15 | pub const STATE_KEY: &[u8] = b"state"; 16 | -------------------------------------------------------------------------------- /contracts/ibc2/tests/integration.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contracts/nested-contracts/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | schema = "run --bin schema" 6 | integration-test = "test --lib integration_tests" 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/README.md: -------------------------------------------------------------------------------- 1 | # Nested contracts test 2 | 3 | This contract doesn't do anything. Actually will panic at runtime. It simply 4 | asserts at compile-time that it is possible to use another contract as a 5 | dependency without using hacks such as the `library` feature, and conditional 6 | `#[entry_point]` compilation. 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | unit-test = "test --lib" 4 | schema = "run --bin schema" 5 | integration-test = "test --lib integration_tests" 6 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/schema/inner-contract.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "inner-contract", 3 | "contract_version": "0.1.0", 4 | "idl_version": "1.0.0", 5 | "instantiate": { 6 | "$schema": "http://json-schema.org/draft-07/schema#", 7 | "title": "InstantiateMsg", 8 | "type": "object", 9 | "additionalProperties": false 10 | }, 11 | "execute": { 12 | "$schema": "http://json-schema.org/draft-07/schema#", 13 | "title": "ExecuteMsg", 14 | "type": "string", 15 | "enum": [] 16 | }, 17 | "query": { 18 | "$schema": "http://json-schema.org/draft-07/schema#", 19 | "title": "QueryMsg", 20 | "type": "string", 21 | "enum": [] 22 | }, 23 | "migrate": null, 24 | "sudo": null, 25 | "responses": {} 26 | } 27 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/schema/raw/execute.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "type": "string", 5 | "enum": [] 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/schema/raw/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "type": "string", 5 | "enum": [] 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use inner_contract::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | execute: ExecuteMsg, 9 | query: QueryMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/contract.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::entry_point; 2 | use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult}; 3 | // use cw2::set_contract_version; 4 | 5 | use crate::error::ContractError; 6 | use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 7 | 8 | /* 9 | // version info for migration info 10 | const CONTRACT_NAME: &str = "crates.io:inner-contract"; 11 | const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 12 | */ 13 | 14 | #[entry_point] 15 | pub fn instantiate( 16 | _deps: DepsMut, 17 | _env: Env, 18 | _info: MessageInfo, 19 | _msg: InstantiateMsg, 20 | ) -> Result { 21 | unimplemented!() 22 | } 23 | 24 | #[entry_point] 25 | pub fn execute( 26 | _deps: DepsMut, 27 | _env: Env, 28 | _info: MessageInfo, 29 | _msg: ExecuteMsg, 30 | ) -> Result { 31 | unimplemented!() 32 | } 33 | 34 | #[entry_point] 35 | pub fn query(_deps: Deps, _env: Env, _msg: QueryMsg) -> StdResult { 36 | unimplemented!() 37 | } 38 | 39 | #[cfg(test)] 40 | mod tests {} 41 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/error.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug)] 5 | pub enum ContractError { 6 | #[error("{0}")] 7 | Std(#[from] StdError), 8 | } 9 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod error; 3 | pub mod msg; 4 | pub mod state; 5 | 6 | pub use crate::error::ContractError; 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{cw_serde, QueryResponses}; 2 | 3 | #[cw_serde] 4 | pub struct InstantiateMsg {} 5 | 6 | #[cw_serde] 7 | pub enum ExecuteMsg {} 8 | 9 | #[cw_serde] 10 | #[derive(QueryResponses)] 11 | pub enum QueryMsg {} 12 | -------------------------------------------------------------------------------- /contracts/nested-contracts/inner-contract/src/state.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contracts/nested-contracts/schema/nested-contracts.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "nested-contracts", 3 | "contract_version": "0.1.0", 4 | "idl_version": "1.0.0", 5 | "instantiate": { 6 | "$schema": "http://json-schema.org/draft-07/schema#", 7 | "title": "InstantiateMsg", 8 | "type": "object", 9 | "additionalProperties": false 10 | }, 11 | "execute": { 12 | "$schema": "http://json-schema.org/draft-07/schema#", 13 | "title": "ExecuteMsg", 14 | "type": "string", 15 | "enum": [] 16 | }, 17 | "query": { 18 | "$schema": "http://json-schema.org/draft-07/schema#", 19 | "title": "QueryMsg", 20 | "type": "string", 21 | "enum": [] 22 | }, 23 | "migrate": null, 24 | "sudo": null, 25 | "responses": {} 26 | } 27 | -------------------------------------------------------------------------------- /contracts/nested-contracts/schema/raw/execute.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "type": "string", 5 | "enum": [] 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/schema/raw/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "type": "string", 5 | "enum": [] 6 | } 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use nested_contracts::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | execute: ExecuteMsg, 9 | query: QueryMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/nested-contracts/src/error.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug)] 5 | pub enum ContractError { 6 | #[error("{0}")] 7 | Std(#[from] StdError), 8 | } 9 | -------------------------------------------------------------------------------- /contracts/nested-contracts/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod error; 3 | pub mod msg; 4 | pub mod state; 5 | 6 | pub use crate::error::ContractError; 7 | -------------------------------------------------------------------------------- /contracts/nested-contracts/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{cw_serde, QueryResponses}; 2 | 3 | #[cw_serde] 4 | pub struct InstantiateMsg {} 5 | 6 | #[cw_serde] 7 | pub enum ExecuteMsg {} 8 | 9 | #[cw_serde] 10 | #[derive(QueryResponses)] 11 | pub enum QueryMsg {} 12 | -------------------------------------------------------------------------------- /contracts/nested-contracts/src/state.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contracts/queue/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/execute.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "oneOf": [ 5 | { 6 | "type": "object", 7 | "required": [ 8 | "enqueue" 9 | ], 10 | "properties": { 11 | "enqueue": { 12 | "type": "object", 13 | "required": [ 14 | "value" 15 | ], 16 | "properties": { 17 | "value": { 18 | "type": "integer", 19 | "format": "int32" 20 | } 21 | }, 22 | "additionalProperties": false 23 | } 24 | }, 25 | "additionalProperties": false 26 | }, 27 | { 28 | "type": "object", 29 | "required": [ 30 | "dequeue" 31 | ], 32 | "properties": { 33 | "dequeue": { 34 | "type": "object", 35 | "additionalProperties": false 36 | } 37 | }, 38 | "additionalProperties": false 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/migrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/response_to_count.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 | "additionalProperties": false 16 | } 17 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/response_to_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ListResponse", 4 | "type": "object", 5 | "required": [ 6 | "early", 7 | "empty", 8 | "late" 9 | ], 10 | "properties": { 11 | "early": { 12 | "description": "List all IDs lower than 0x20", 13 | "type": "array", 14 | "items": { 15 | "type": "integer", 16 | "format": "uint32", 17 | "minimum": 0.0 18 | } 19 | }, 20 | "empty": { 21 | "description": "List an empty range, both bounded", 22 | "type": "array", 23 | "items": { 24 | "type": "integer", 25 | "format": "uint32", 26 | "minimum": 0.0 27 | } 28 | }, 29 | "late": { 30 | "description": "List all IDs starting from 0x20", 31 | "type": "array", 32 | "items": { 33 | "type": "integer", 34 | "format": "uint32", 35 | "minimum": 0.0 36 | } 37 | } 38 | }, 39 | "additionalProperties": false 40 | } 41 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/response_to_open_iterators.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Empty", 4 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 5 | "type": "object", 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/response_to_reducer.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ReducerResponse", 4 | "type": "object", 5 | "required": [ 6 | "counters" 7 | ], 8 | "properties": { 9 | "counters": { 10 | "type": "array", 11 | "items": { 12 | "type": "array", 13 | "items": [ 14 | { 15 | "type": "integer", 16 | "format": "int32" 17 | }, 18 | { 19 | "type": "integer", 20 | "format": "int32" 21 | } 22 | ], 23 | "maxItems": 2, 24 | "minItems": 2 25 | } 26 | } 27 | }, 28 | "additionalProperties": false 29 | } 30 | -------------------------------------------------------------------------------- /contracts/queue/schema/raw/response_to_sum.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 | "additionalProperties": false 15 | } 16 | -------------------------------------------------------------------------------- /contracts/queue/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use queue::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | execute: ExecuteMsg, 10 | migrate: MigrateMsg, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /contracts/queue/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod msg; 3 | pub mod state; 4 | -------------------------------------------------------------------------------- /contracts/queue/src/state.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | // we store one entry for each item in the queue 5 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] 6 | pub struct Item { 7 | pub value: i32, 8 | } 9 | -------------------------------------------------------------------------------- /contracts/reflect/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/reflect/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2020 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 | -------------------------------------------------------------------------------- /contracts/reflect/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/reflect/schema/raw/response_to_capitalized.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 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/reflect/schema/raw/response_to_chain.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 | "additionalProperties": false, 14 | "definitions": { 15 | "Binary": { 16 | "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. See also .", 17 | "type": "string" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /contracts/reflect/schema/raw/response_to_owner.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 | "additionalProperties": false 14 | } 15 | -------------------------------------------------------------------------------- /contracts/reflect/schema/raw/response_to_raw.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "RawResponse", 4 | "type": "object", 5 | "required": [ 6 | "data" 7 | ], 8 | "properties": { 9 | "data": { 10 | "description": "The returned value of the raw query. Empty data can be the result of a non-existent key or an empty value. We cannot differentiate those two cases in cross contract queries.", 11 | "allOf": [ 12 | { 13 | "$ref": "#/definitions/Binary" 14 | } 15 | ] 16 | } 17 | }, 18 | "additionalProperties": false, 19 | "definitions": { 20 | "Binary": { 21 | "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. See also .", 22 | "type": "string" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/reflect/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use reflect::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | execute: ExecuteMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/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 | -------------------------------------------------------------------------------- /contracts/replier/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/replier/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "replier" 3 | version = "0.0.0" 4 | authors = ["Tomasz Kulik "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ 28 | "cosmwasm_1_4", 29 | "exports", 30 | "iterator", 31 | "std", 32 | ] } 33 | schemars = "0.8.12" 34 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 35 | -------------------------------------------------------------------------------- /contracts/replier/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/replier/schema/raw/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "QueryMsg", 4 | "type": "string", 5 | "enum": [] 6 | } 7 | -------------------------------------------------------------------------------- /contracts/replier/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use replier::{ExecuteMsg, InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | execute: ExecuteMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/replier/tests/integration.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contracts/staking/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/staking/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "staking" 3 | version = "0.0.0" 4 | authors = ["Ethan Frey "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ 28 | "exports", 29 | "staking", 30 | "std", 31 | ] } 32 | schemars = "0.8.12" 33 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 34 | snafu = "0.8.2" 35 | 36 | [dev-dependencies] 37 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 38 | "staking", 39 | ] } 40 | -------------------------------------------------------------------------------- /contracts/staking/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2020 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 | -------------------------------------------------------------------------------- /contracts/staking/schema/raw/response_to_balance.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 | "additionalProperties": false, 14 | "definitions": { 15 | "Uint128": { 16 | "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", 17 | "type": "string" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /contracts/staking/schema/raw/response_to_claims.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 | "additionalProperties": false, 14 | "definitions": { 15 | "Uint128": { 16 | "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", 17 | "type": "string" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /contracts/staking/schema/raw/response_to_token_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "TokenInfoResponse", 4 | "description": "TokenInfoResponse is info to display the derivative token in a UI", 5 | "type": "object", 6 | "required": [ 7 | "decimals", 8 | "name", 9 | "symbol" 10 | ], 11 | "properties": { 12 | "decimals": { 13 | "description": "decimal places of the derivative token (for UI)", 14 | "type": "integer", 15 | "format": "uint8", 16 | "minimum": 0.0 17 | }, 18 | "name": { 19 | "description": "name of the derivative token", 20 | "type": "string" 21 | }, 22 | "symbol": { 23 | "description": "symbol / ticker of the derivative token", 24 | "type": "string" 25 | } 26 | }, 27 | "additionalProperties": false 28 | } 29 | -------------------------------------------------------------------------------- /contracts/staking/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use staking::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | query: QueryMsg, 9 | execute: ExecuteMsg, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/staking/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::StdError; 2 | use snafu::Snafu; 3 | 4 | #[derive(Snafu, Debug)] 5 | #[snafu(context(suffix(false)), 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 | -------------------------------------------------------------------------------- /contracts/staking/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /contracts/virus/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | integration-test = "test --test integration" 6 | schema = "run --bin schema" 7 | -------------------------------------------------------------------------------- /contracts/virus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "virus" 3 | version = "0.0.0" 4 | authors = ["Simon Warta "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [dependencies] 26 | cosmwasm-schema = { path = "../../packages/schema" } 27 | cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_2"] } 28 | schemars = "0.8.12" 29 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 30 | thiserror = "1.0.26" 31 | 32 | [dev-dependencies] 33 | cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ 34 | "iterator", 35 | ] } 36 | -------------------------------------------------------------------------------- /contracts/virus/README.md: -------------------------------------------------------------------------------- 1 | # Virus contract 2 | 3 | A contract that clones itself over various levels. 4 | -------------------------------------------------------------------------------- /contracts/virus/schema/raw/execute.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "ExecuteMsg", 4 | "oneOf": [ 5 | { 6 | "type": "object", 7 | "required": [ 8 | "spread" 9 | ], 10 | "properties": { 11 | "spread": { 12 | "type": "object", 13 | "required": [ 14 | "levels", 15 | "parent_path" 16 | ], 17 | "properties": { 18 | "levels": { 19 | "description": "The number of levels of spreading. When set to 0, the contract performs a no-op.", 20 | "type": "integer", 21 | "format": "uint32", 22 | "minimum": 0.0 23 | }, 24 | "parent_path": { 25 | "description": "A slash separated path to the instance creating this one. The root is the empty string.", 26 | "type": "string" 27 | } 28 | }, 29 | "additionalProperties": false 30 | } 31 | }, 32 | "additionalProperties": false 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /contracts/virus/schema/raw/instantiate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "InstantiateMsg", 4 | "type": "object", 5 | "additionalProperties": false 6 | } 7 | -------------------------------------------------------------------------------- /contracts/virus/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::write_api; 2 | 3 | use virus::msg::{ExecuteMsg, InstantiateMsg}; 4 | 5 | fn main() { 6 | write_api! { 7 | instantiate: InstantiateMsg, 8 | execute: ExecuteMsg, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /contracts/virus/src/errors.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Instantiate2AddressError, StdError}; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum ContractError { 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 | #[error("{0}")] 10 | Instantiate2Address(#[from] Instantiate2AddressError), 11 | } 12 | -------------------------------------------------------------------------------- /contracts/virus/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | mod errors; 3 | pub mod msg; 4 | -------------------------------------------------------------------------------- /contracts/virus/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::cw_serde; 2 | 3 | #[cw_serde] 4 | pub struct InstantiateMsg {} 5 | 6 | #[cw_serde] 7 | pub enum ExecuteMsg { 8 | Spread { 9 | /// A slash separated path to the instance creating this one. 10 | /// The root is the empty string. 11 | parent_path: String, 12 | /// The number of levels of spreading. When set to 0, the contract performs a no-op. 13 | levels: u32, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /contracts/virus/tests/integration.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /devtools/build_min.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | rm Cargo.lock 6 | cargo +nightly build -Zminimal-versions 7 | 8 | for contract_dir in contracts/*/; do 9 | ( 10 | cd "$contract_dir" 11 | rm Cargo.lock 12 | cargo +nightly build -Zminimal-versions 13 | ) 14 | done 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /devtools/check_contracts_full.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | GLOBIGNORE="contracts/floaty/" 6 | for contract_dir in contracts/*/; do 7 | ( 8 | cd "$contract_dir" 9 | cargo fmt 10 | mkdir -p target/wasm32-unknown-unknown/release/ 11 | touch target/wasm32-unknown-unknown/release/"$(basename "$contract_dir" | tr - _)".wasm 12 | cargo check --tests 13 | cargo unit-test 14 | touch src/*.rs # Needed because check and clippy share the same build cache such that clippy warnings are hidden when check wrote to the build cache 15 | cargo clippy --all-targets -- -D warnings 16 | cargo schema 17 | cargo wasm 18 | cargo integration-test 19 | ) 20 | done 21 | -------------------------------------------------------------------------------- /devtools/check_contracts_medium.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | GLOBIGNORE="contracts/floaty/" 6 | for contract_dir in contracts/*/; do 7 | ( 8 | cd "$contract_dir" 9 | cargo fmt 10 | mkdir -p target/wasm32-unknown-unknown/release/ 11 | touch target/wasm32-unknown-unknown/release/"$(basename "$contract_dir" | tr - _)".wasm 12 | cargo check --tests 13 | cargo unit-test 14 | touch src/*.rs # Needed because check and clippy share the same build cache such that clippy warnings are hidden when check wrote to the build cache 15 | cargo clippy --all-targets -- -D warnings 16 | cargo schema 17 | cargo wasm-debug 18 | ) 19 | done 20 | -------------------------------------------------------------------------------- /devtools/check_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 check && cargo clippy --all-targets -- -D warnings) 7 | (cd packages/derive && cargo check && cargo clippy --all-targets -- -D warnings) 8 | ( 9 | cd packages/std 10 | # default, min, all 11 | cargo check 12 | cargo check --no-default-features --features std 13 | cargo check --features std,iterator,staking,stargate,cosmwasm_1_2 14 | cargo wasm-debug 15 | cargo wasm-debug --features std,iterator,staking,stargate 16 | cargo clippy --all-targets --features std,iterator,staking,stargate -- -D warnings 17 | ) 18 | (cd packages/schema && cargo build && cargo clippy --all-targets -- -D warnings) 19 | (cd packages/schema-derive && cargo build && cargo clippy --all-targets -- -D warnings) 20 | (cd packages/vm && cargo build --features iterator,stargate && cargo clippy --all-targets --features iterator,stargate -- -D warnings) 21 | (cd packages/check && cargo build && cargo clippy --all-targets -- -D warnings) 22 | -------------------------------------------------------------------------------- /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/schema && cargo clean) 8 | (cd packages/vm && cargo clean) 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | c) op="check" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | npx prettier@3.3.3 --$op "./**/*.md" 15 | -------------------------------------------------------------------------------- /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 | c) op="d" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | shfmt -$op devtools packages 15 | -------------------------------------------------------------------------------- /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 | c) op="check" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | npx prettier@3.3.3 --$op "./**/*.yml" 15 | -------------------------------------------------------------------------------- /devtools/release_checks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Move to the workspace root 4 | WORKSPACE_PATH=$(dirname $(cargo locate-project --workspace --message-format=plain)) 5 | cd $WORKSPACE_PATH 6 | 7 | cargo build 8 | 9 | for contract_dir in contracts/*/; do 10 | (cd "$contract_dir" && cargo build) 11 | done 12 | -------------------------------------------------------------------------------- /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 | # A test inside the std package expects backtraces to be disabled 8 | (cd packages/std && RUST_BACKTRACE=0 cargo test --features iterator,cosmwasm_1_2) 9 | (cd packages/schema && cargo test) 10 | (cd packages/schema-derive && cargo test) 11 | (cd packages/vm && cargo test --features iterator,stargate) 12 | -------------------------------------------------------------------------------- /devtools/update_crate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | CRATE_NAME="$1" 6 | 7 | # Update root Cargo.lock 8 | cargo update -p "$CRATE_NAME" 9 | 10 | for contract_dir in contracts/*/; do 11 | ( 12 | cd "$contract_dir" 13 | cargo update -p "$CRATE_NAME" 14 | ) || continue 15 | done 16 | -------------------------------------------------------------------------------- /devtools/update_schemas.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 schema 9 | ) 10 | done 11 | -------------------------------------------------------------------------------- /docs/FEATURES.md: -------------------------------------------------------------------------------- 1 | Features have been renamed to capabilities. See 2 | [CAPABILITIES.md](./CAPABILITIES.md) in the same folder. 3 | -------------------------------------------------------------------------------- /docs/GAS.md: -------------------------------------------------------------------------------- 1 | # Gas 2 | 3 | This page is now maintained in the main CosmWasm docs: 4 | 5 | -------------------------------------------------------------------------------- /docs/MSRV.md: -------------------------------------------------------------------------------- 1 | # Minimum Supported Rust Version (MSRV) 2 | 3 | We try to keep the range of supported Rust compiler versions as wide as possible 4 | to avoid unnecessary inconvenience for contract developers. However, we give up 5 | all strong MSRV guarantees as the Rust ecosystem currently makes it impossible 6 | to do so. See e.g. 7 | 8 | - https://github.com/rust-lang/api-guidelines/issues/252 9 | - https://github.com/CosmWasm/cosmwasm/issues/1244 10 | - https://github.com/wasmerio/wasmer/issues/2819 11 | - https://github.com/CosmWasm/cosmwasm/issues/1204 12 | -------------------------------------------------------------------------------- /docs/PINNING.md: -------------------------------------------------------------------------------- 1 | # Contract pinning 2 | 3 | This page is now maintained in the main CosmWasm docs: 4 | 5 | -------------------------------------------------------------------------------- /packages/check/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-check" 3 | version.workspace = true 4 | authors = ["Mauro Lacy "] 5 | edition = "2021" 6 | description = "A CLI tool for verifying CosmWasm smart contracts" 7 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/check" 8 | license = "Apache-2.0" 9 | 10 | [dependencies] 11 | anyhow = "1.0.57" 12 | clap = "4" 13 | colored = "2.1.0" 14 | cosmwasm-vm = { path = "../vm", version = "=3.0.0-rc.0" } 15 | cosmwasm-std = { path = "../std", version = "=3.0.0-rc.0" } 16 | 17 | [dev-dependencies] 18 | assert_cmd = "2.0.12" 19 | predicates = "3" 20 | tempfile = "3.1.0" 21 | -------------------------------------------------------------------------------- /packages/check/README.md: -------------------------------------------------------------------------------- 1 | # cosmwasm-check 2 | 3 | It allows checking if the Wasm binary is a proper smart contract that's ready to 4 | be uploaded to the blockchain. 5 | 6 | ## Installation 7 | 8 | ```sh 9 | cargo install cosmwasm-check 10 | ``` 11 | 12 | ## Usage 13 | 14 | Get help and info: 15 | 16 | ```sh 17 | cosmwasm-check -h 18 | ``` 19 | 20 | Check some contracts: 21 | 22 | ```sh 23 | cosmwasm-check artifacts/hackatom.wasm artifacts/burner.wasm 24 | ``` 25 | 26 | Check an entire directory of contracts (shell dependent): 27 | 28 | ```sh 29 | cosmwasm-check artifacts/*.wasm 30 | ``` 31 | 32 | Check if a contract would ran on a blockchain with a specific set of 33 | capabilities: 34 | 35 | ```sh 36 | cosmwasm-check --available-capabilities iterator,osmosis,friendship artifacts/hackatom.wasm 37 | ``` 38 | 39 | ## License 40 | 41 | This package is part of the cosmwasm repository, licensed under the Apache 42 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 43 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 44 | -------------------------------------------------------------------------------- /packages/core/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | no-std = "build --release --lib --target thumbv7em-none-eabi" 3 | wasm = "build --release --lib --target wasm32-unknown-unknown" 4 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 5 | unit-test = "test --lib" 6 | -------------------------------------------------------------------------------- /packages/core/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-core" 3 | version.workspace = true 4 | edition = "2021" 5 | description = "Components of cosmwasm-std that can be used in no_std environments" 6 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/core" 7 | license = "Apache-2.0" 8 | readme = "README.md" 9 | 10 | [dependencies] 11 | -------------------------------------------------------------------------------- /packages/core/README.md: -------------------------------------------------------------------------------- 1 | # cosmwasm-core 2 | 3 | [![cosmwasm-core on crates.io](https://img.shields.io/crates/v/cosmwasm-core.svg)](https://crates.io/crates/cosmwasm-core) 4 | 5 | This crate contains components of cosmwasm-std that can be used in a 6 | [no_std environment](https://docs.rust-embedded.org/book/intro/no-std.html). All 7 | symbols are re-exported by cosmwasm-std, such that contract developers don't 8 | need to add this dependency directly. It is recommended to only use cosmwasm-std 9 | whenever possible. 10 | 11 | ## License 12 | 13 | This package is part of the cosmwasm repository, licensed under the Apache 14 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 15 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 16 | -------------------------------------------------------------------------------- /packages/core/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | mod crypto; 4 | 5 | #[doc(hidden)] 6 | pub use self::crypto::{ 7 | BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_GENERATOR, BLS12_381_G2_POINT_LEN, 8 | }; 9 | -------------------------------------------------------------------------------- /packages/crypto/src/bls12_381/mod.rs: -------------------------------------------------------------------------------- 1 | mod aggregate; 2 | mod constants; 3 | mod hash; 4 | mod pairing; 5 | mod points; 6 | 7 | pub use self::aggregate::{bls12_381_aggregate_g1, bls12_381_aggregate_g2}; 8 | pub use self::hash::{bls12_381_hash_to_g1, bls12_381_hash_to_g2, HashFunction}; 9 | pub use self::pairing::bls12_381_pairing_equality; 10 | pub use self::points::{bls12_381_g1_is_identity, bls12_381_g2_is_identity}; 11 | -------------------------------------------------------------------------------- /packages/crypto/src/ecdsa.rs: -------------------------------------------------------------------------------- 1 | /// Max length of a message hash for secp256k1 verification in bytes. 2 | /// This is typically a 32 byte output of e.g. SHA-256 or Keccak256. In theory shorter values 3 | /// are possible but currently not supported by the implementation. Let us know when you need them. 4 | pub const MESSAGE_HASH_MAX_LEN: usize = 32; 5 | 6 | /// ECDSA (secp256k1) parameters 7 | /// Length of a serialized signature 8 | pub const ECDSA_SIGNATURE_LEN: usize = 64; 9 | 10 | /// Length of a serialized compressed public key 11 | pub(crate) const ECDSA_COMPRESSED_PUBKEY_LEN: usize = 33; 12 | /// Length of a serialized uncompressed public key 13 | pub(crate) const ECDSA_UNCOMPRESSED_PUBKEY_LEN: usize = 65; 14 | /// Max length of a serialized public key 15 | pub const ECDSA_PUBKEY_MAX_LEN: usize = ECDSA_UNCOMPRESSED_PUBKEY_LEN; 16 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": [ 3 | "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", 4 | "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9", 5 | "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" 6 | ], 7 | "output": "0x9683b3e6701f9a4b706709577963110043af78a5b41991b998475a3d3fd62abf35ce03b33908418efc95a058494a8ae504354b9f626231f6b3f3c849dfdeaf5017c4780e2aee1850ceaf4b4d9ce70971a3d2cfcd97b7e5ecf6759f8da5f76d31" 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": [ 3 | "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb", 4 | "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe", 5 | "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" 6 | ], 7 | "output": "0xad38fc73846583b08d110d16ab1d026c6ea77ac2071e8ae832f56ac0cbcdeb9f5678ba5ce42bd8dce334cc47b5abcba40a58f7f1f80ab304193eb98836cc14d8183ec14cc77de0f80c4ffd49e168927a968b5cdaa4cf46b9805be84ad7efa77b" 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": [ 3 | "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121", 4 | "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df", 5 | "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" 6 | ], 7 | "output": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_infinity_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": [ 3 | "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | ], 5 | "output": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_na_signatures.json: -------------------------------------------------------------------------------- 1 | { "input": [], "output": null } 2 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate/aggregate_single_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": [ 3 | "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 4 | ], 5 | "output": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_infinity_pubkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 7 | "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 8 | ], 9 | "messages": [ 10 | "0x0000000000000000000000000000000000000000000000000000000000000000", 11 | "0x5656565656565656565656565656565656565656565656565656565656565656", 12 | "0xabababababababababababababababababababababababababababababababab", 13 | "0x1212121212121212121212121212121212121212121212121212121212121212" 14 | ], 15 | "signature": "0x9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244" 16 | }, 17 | "output": false 18 | } 19 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_infinity_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [], 4 | "messages": [], 5 | "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_na_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [], 4 | "messages": [], 5 | "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_tampered_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 7 | ], 8 | "messages": [ 9 | "0x0000000000000000000000000000000000000000000000000000000000000000", 10 | "0x5656565656565656565656565656565656565656565656565656565656565656", 11 | "0xabababababababababababababababababababababababababababababababab" 12 | ], 13 | "signature": "0x9104e74bffffffff" 14 | }, 15 | "output": false 16 | } 17 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_valid.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 7 | ], 8 | "messages": [ 9 | "0x0000000000000000000000000000000000000000000000000000000000000000", 10 | "0x5656565656565656565656565656565656565656565656565656565656565656", 11 | "0xabababababababababababababababababababababababababababababababab" 12 | ], 13 | "signature": "0x9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244" 14 | }, 15 | "output": true 16 | } 17 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_forged_signature_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" 6 | ], 7 | "messages": [ 8 | "0x0000000000000000000000000000000000000000000000000000000000000000", 9 | "0x5656565656565656565656565656565656565656565656565656565656565656" 10 | ], 11 | "signatures": [ 12 | "0xa70f1f1b4bd97d182ebb55d08be3f90b1dc232bb50b44e259381a642ef0bad3629ad3542f3e8ff6a84e451fc0b595e090fc4f0e860cfc5584715ef1b6cd717b9994378f7a51b815bbf5a0d95bc3402583ad2e95a229731e539906249a5e4355c", 13 | "0xb758eb7e15c101f53be2214d2a6b65e8fe7053146dbe3c73c9fe9b5efecdf63ca06a4d5d938dbf18fe6600529c0011a7013f45ae012b02904d5c7c33316e935a0e084abead4f43f84383c52cd3b3f14024437e251a2a7c0d5147954022873a58" 14 | ] 15 | }, 16 | "output": false 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_infinity_signature_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | ], 7 | "messages": [ 8 | "0x0000000000000000000000000000000000000000000000000000000000000000", 9 | "0x5656565656565656565656565656565656565656565656565656565656565656" 10 | ], 11 | "signatures": [ 12 | "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", 13 | "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 14 | ] 15 | }, 16 | "output": false 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_multiple_signature_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" 6 | ], 7 | "messages": [ 8 | "0x0000000000000000000000000000000000000000000000000000000000000000", 9 | "0x5656565656565656565656565656565656565656565656565656565656565656" 10 | ], 11 | "signatures": [ 12 | "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", 13 | "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" 14 | ] 15 | }, 16 | "output": true 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_false_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_true_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_G1.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_curve.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde0" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_few_bytes.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_many_bytes.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaa900" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_a_flag_true.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_x_nonzero.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_wrong_c_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_equal_to_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_greater_than_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_correct_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "a491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" 4 | }, 5 | "output": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_infinity_with_true_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_false_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_true_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_G2.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_curve.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde0" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_few_bytes.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_many_bytes.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefff" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_a_flag_true.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_x_nonzero.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_wrong_c_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_equal_to_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_greater_than_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_equal_to_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_greater_than_modulus.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac" 4 | }, 5 | "output": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_correct_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "b2cc74bc9f089ed9764bbceac5edba416bef5e73701288977b9cac1ccb6964269d4ebf78b4e8aa7792ba09d3e49c8e6a1351bdf582971f796bbaf6320e81251c9d28f674d720cca07ed14596b96697cf18238e0e03ebd7fc1353d885a39407e0" 4 | }, 5 | "output": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_infinity_with_true_b_flag.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "signature": "c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 4 | }, 5 | "output": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 7 | ], 8 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 9 | "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1" 10 | }, 11 | "output": false 12 | } 13 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 7 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 8 | ], 9 | "message": "0xabababababababababababababababababababababababababababababababab", 10 | "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" 11 | }, 12 | "output": false 13 | } 14 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 6 | ], 7 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 8 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 9 | }, 10 | "output": false 11 | } 12 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_infinity_pubkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 7 | "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 8 | ], 9 | "message": "0x1212121212121212121212121212121212121212121212121212121212121212", 10 | "signature": "0xafcb4d980f079265caa61aee3e26bf48bebc5dc3e7f2d7346834d76cbc812f636c937b6b44a9323d8bc4b1cdf71d6811035ddc2634017faab2845308f568f2b9a0356140727356eae9eded8b87fd8cb8024b440c57aee06076128bb32921f584" 11 | }, 12 | "output": false 13 | } 14 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_infinity_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [], 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_na_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [], 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 7 | ], 8 | "message": "0xabababababababababababababababababababababababababababababababab", 9 | "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfcffffffff" 10 | }, 11 | "output": false 12 | } 13 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" 5 | ], 6 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 7 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380bffffffff" 8 | }, 9 | "output": false 10 | } 11 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_652ce62f09290811.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" 6 | ], 7 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 8 | "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f7797ffffffff" 9 | }, 10 | "output": false 11 | } 12 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 6 | "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" 7 | ], 8 | "message": "0xabababababababababababababababababababababababababababababababab", 9 | "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" 10 | }, 11 | "output": true 12 | } 13 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" 5 | ], 6 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 7 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 8 | }, 9 | "output": true 10 | } 11 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkeys": [ 4 | "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 5 | "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" 6 | ], 7 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 8 | "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1" 9 | }, 10 | "output": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__2782afaa8406d038.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 4 | }, 5 | "output": { 6 | "x": "0x01a6ba2f9a11fa5598b2d8ace0fbe0a0eacb65deceb476fbbcb64fd24557c2f4b18ecfc5663e54ae16a84f5ab7f62534,0x11fca2ff525572795a801eed17eb12785887c7b63fb77a42be46ce4a34131d71f7a73e95fee3f812aea3de78b4d01569", 7 | "y": "0x0b6798718c8aed24bc19cb27f866f1c9effcdbf92397ad6448b5c9db90d2b9da6cbabf48adc1adf59a1a28344e79d57e,0x03a47f8e6d1763ba0cad63d6114c0accbef65707825a511b251a660a9b3994249ae4e63fac38b23da0c398689ee2ab52" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__7590bd067999bbfb.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { "msg": "abc" }, 3 | "output": { 4 | "x": "0x02c2d18e033b960562aae3cab37a27ce00d80ccd5ba4b7fe0e7a210245129dbec7780ccc7954725f4168aff2787776e6,0x139cddbccdc5e91b9623efd38c49f81a6f83f175e80b06fc374de9eb4b41dfe4ca3a230ed250fbe3a2acf73a41177fd8", 5 | "y": "0x1787327b68159716a37440985269cf584bcb1e621d3a7202be6ea05c4cfe244aeb197642555a0645fb87bf7466b2ba48,0x00aa65dae3c8d732d10ecd2c50f8a1baf3001578f71c694e03866e9f3d49ac1e1ce70dd94a733534f106d4cec0eddd16" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__a54942c8e365f378.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { "msg": "" }, 3 | "output": { 4 | "x": "0x0141ebfbdca40eb85b87142e130ab689c673cf60f1a3e98d69335266f30d9b8d4ac44c1038e9dcdd5393faf5c41fb78a,0x05cb8437535e20ecffaef7752baddf98034139c38452458baeefab379ba13dff5bf5dd71b72418717047f5b0f37da03d", 5 | "y": "0x0503921d7f6a12805e72940b963c0cf3471c7b2a524950ca195d11062ee75ec076daf2d4bc358c4b190c0c98064fdd92,0x12424ac32561493f3fe3c260708a12b7c620e7be00099a974e259ddc7d1f6395c3c811cdd19f1e8dbf3e9ecfdcbab8d6" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__c938b486cf69e8f7.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { "msg": "abcdef0123456789" }, 3 | "output": { 4 | "x": "0x121982811d2491fde9ba7ed31ef9ca474f0e1501297f68c298e9f4c0028add35aea8bb83d53c08cfc007c1e005723cd0,0x190d119345b94fbd15497bcba94ecf7db2cbfd1e1fe7da034d26cbba169fb3968288b3fafb265f9ebd380512a71c3f2c", 5 | "y": "0x05571a0f8d3c08d094576981f4a3b8eda0a8e771fcdcc8ecceaf1356a6acf17574518acb506e435b639353c2e14827c8,0x0bb5e7572275c567462d91807de765611490205a941a5a6af3b1691bfe596c31225d3aabdf15faff860cb4ef17c7c3be" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_infinity_pubkey_and_infinity_signature.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 4 | "message": "0x1212121212121212121212121212121212121212121212121212121212121212", 5 | "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_195246ee3bd3b6ec.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2ea479adf8c40300.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2f09d443ab8a3ac2.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_3208262581c8fc09.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6b3b17f6962a490c.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6eeb7c52dfd9baf0.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_8761a0b7e920c323.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b71ffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_d34885d766d5f705.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075effffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_e8a50c445c855360.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380bffffffff" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_195246ee3bd3b6ec.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_2ea479adf8c40300.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_2f09d443ab8a3ac2.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_3208262581c8fc09.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_6b3b17f6962a490c.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_6eeb7c52dfd9baf0.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_8761a0b7e920c323.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_d34885d766d5f705.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_valid_case_e8a50c445c855360.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_3208262581c8fc09.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x5656565656565656565656565656565656565656565656565656565656565656", 5 | "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0xabababababababababababababababababababababababababababababababab", 5 | "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_d34885d766d5f705.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_e8a50c445c855360.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", 4 | "message": "0x0000000000000000000000000000000000000000000000000000000000000000", 5 | "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" 6 | }, 7 | "output": false 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/bls-tests/verify/verifycase_one_privkey_47117849458281be.json: -------------------------------------------------------------------------------- 1 | { 2 | "input": { 3 | "pubkey": "0x97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb", 4 | "message": "0x1212121212121212121212121212121212121212121212121212121212121212", 5 | "signature": "0xa42ae16f1c2a5fa69c04cb5998d2add790764ce8dd45bf25b29b4700829232052b52352dcff1cf255b3a7810ad7269601810f03b2bc8b68cf289cf295b206770605a190b6842583e47c3d1c0f73c54907bfb2a602157d46a4353a20283018763" 6 | }, 7 | "output": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/crypto/testdata/rootberg/README.md: -------------------------------------------------------------------------------- 1 | # Rootberg test data 2 | 3 | This folder contains test vectors from 4 | [Project Rootberg](https://github.com/bleichenbacher-daniel/Rooterberg) to 5 | increase the test coverage of public key recovery implementations. 6 | 7 | This test data is used by integration tests in `test/rootberg_*.rs`. 8 | 9 | ## Update 10 | 11 | To ensure integrity of the files and update them to the latest version, run this 12 | from the repo root: 13 | 14 | ```sh 15 | (cd packages/crypto/testdata/rootberg \ 16 | && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256k1_keccak256_raw.json > ecdsa_secp256k1_keccak256_raw.json \ 17 | && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256k1_sha_256_raw.json > ecdsa_secp256k1_sha_256_raw.json \ 18 | && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256r1_keccak256_raw.json > ecdsa_secp256r1_keccak256_raw.json \ 19 | && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256r1_sha_256_raw.json > ecdsa_secp256r1_sha_256_raw.json \ 20 | ) 21 | ``` 22 | -------------------------------------------------------------------------------- /packages/crypto/tests/hashers.rs: -------------------------------------------------------------------------------- 1 | // only some of the hashers are used in each test file, so some will be unused 2 | #![allow(unused)] 3 | 4 | use digest::Digest; 5 | use sha2::{Sha256, Sha512}; 6 | use sha3::{Keccak256, Sha3_256, Sha3_512}; 7 | 8 | pub fn sha256(data: &[u8]) -> [u8; 32] { 9 | Sha256::digest(data).into() 10 | } 11 | 12 | pub fn keccak_256(data: &[u8]) -> [u8; 32] { 13 | Keccak256::digest(data).into() 14 | } 15 | 16 | // ecdsa_secp256k1_sha512 requires truncating to 32 bytes 17 | pub fn sha512(data: &[u8]) -> [u8; 32] { 18 | let hash = Sha512::digest(data).to_vec(); 19 | hash[..32].try_into().unwrap() 20 | } 21 | 22 | pub fn sha3_256(data: &[u8]) -> [u8; 32] { 23 | Sha3_256::digest(data).into() 24 | } 25 | 26 | // ecdsa_secp256k1_sha3_512 requires truncating to 32 bytes 27 | pub fn sha3_512(data: &[u8]) -> [u8; 32] { 28 | let hash = Sha3_512::digest(data).to_vec(); 29 | hash[..32].try_into().unwrap() 30 | } 31 | -------------------------------------------------------------------------------- /packages/crypto/tests/wycheproof.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Deserialize, Debug)] 4 | #[serde(rename_all = "camelCase")] 5 | pub struct File { 6 | pub number_of_tests: usize, 7 | pub test_groups: Vec, 8 | } 9 | 10 | #[derive(Deserialize, Debug)] 11 | #[serde(rename_all = "camelCase")] 12 | pub struct TestGroup { 13 | pub public_key: Key, 14 | pub tests: Vec, 15 | } 16 | 17 | #[derive(Deserialize, Debug)] 18 | #[serde(rename_all = "camelCase")] 19 | pub struct Key { 20 | pub uncompressed: String, 21 | } 22 | 23 | #[derive(Deserialize, Debug)] 24 | #[serde(rename_all = "camelCase")] 25 | pub struct TestCase { 26 | pub tc_id: u32, 27 | pub comment: String, 28 | pub msg: String, 29 | pub sig: String, 30 | // "acceptable", "valid" or "invalid" 31 | pub result: String, 32 | } 33 | 34 | pub fn read_file(path: &str) -> File { 35 | use std::fs::File; 36 | use std::io::BufReader; 37 | 38 | // Open the file in read-only mode with buffer. 39 | let file = File::open(path).unwrap(); 40 | let reader = BufReader::new(file); 41 | 42 | serde_json::from_reader(reader).unwrap() 43 | } 44 | -------------------------------------------------------------------------------- /packages/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-derive" 3 | version.workspace = true 4 | authors = ["Simon Warta "] 5 | edition = "2021" 6 | description = "A package for auto-generated code used for CosmWasm contract development. This is shipped as part of cosmwasm-std. Do not use directly." 7 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/derive" 8 | license = "Apache-2.0" 9 | readme = "README.md" 10 | 11 | [lib] 12 | proc-macro = true 13 | 14 | [features] 15 | default = [] 16 | 17 | [dependencies] 18 | proc-macro2 = "1.0.79" 19 | quote = "1.0.35" 20 | syn = { version = "2", features = ["full"] } 21 | -------------------------------------------------------------------------------- /packages/derive/README.md: -------------------------------------------------------------------------------- 1 | # cosmwasm-derive 2 | 3 | [![cosmwasm-derive on crates.io](https://img.shields.io/crates/v/cosmwasm-derive.svg)](https://crates.io/crates/cosmwasm-derive) 4 | 5 | A package for auto-generated code used for CosmWasm contract development. This 6 | is shipped as part of cosmwasm-std. Do not use directly. 7 | 8 | ## License 9 | 10 | This package is part of the cosmwasm repository, licensed under the Apache 11 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 12 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 13 | -------------------------------------------------------------------------------- /packages/go-gen/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "go-gen" 3 | authors = ["Christoph Otter "] 4 | version = "0.1.0" 5 | edition = "2021" 6 | publish = false 7 | 8 | [package.metadata.release] 9 | release = false 10 | 11 | [dependencies] 12 | cosmwasm-std = { version = "3.0.0-rc.0", path = "../std", features = [ 13 | "cosmwasm_3_0", 14 | "staking", 15 | "stargate", 16 | ] } 17 | cosmwasm-schema = { version = "3.0.0-rc.0", path = "../schema" } 18 | anyhow = "1" 19 | Inflector = "0.11.4" 20 | indenter = "0.3.3" 21 | schemars = { workspace = true } 22 | -------------------------------------------------------------------------------- /packages/go-gen/README.md: -------------------------------------------------------------------------------- 1 | # JsonSchema Go Type Generator 2 | 3 | This is an internal utility to generate Go types from `cosmwasm-std`'s query 4 | response types. These types can then be used in 5 | [wasmvm](https://github.com/CosmWasm/wasmvm). 6 | 7 | ## Usage 8 | 9 | Adjust the query / response type you want to generate in `src/main.rs` and run: 10 | `cargo run -p go-gen` 11 | 12 | ## Limitations 13 | 14 | Only basic structs and enums are supported. Tuples and enum variants with 0 or 15 | more than 1 parameters don't work, for example. 16 | 17 | ## License 18 | 19 | This package is part of the cosmwasm repository, licensed under the Apache 20 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 21 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 22 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__AllBalanceResponse.go: -------------------------------------------------------------------------------- 1 | // AllBalancesResponse is the expected response to AllBalancesQuery 2 | type AllBalancesResponse struct { 3 | Amount Array[Coin] `json:"amount"` 4 | } 5 | 6 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 7 | type Coin struct { 8 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 9 | Denom string `json:"denom"` // type, eg. "ATOM" 10 | } 11 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__AllDelegationsResponse.go: -------------------------------------------------------------------------------- 1 | // AllDelegationsResponse is the expected response to AllDelegationsQuery 2 | type AllDelegationsResponse struct { 3 | Delegations Array[Delegation] `json:"delegations"` 4 | } 5 | 6 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 7 | type Coin struct { 8 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 9 | Denom string `json:"denom"` // type, eg. "ATOM" 10 | } 11 | 12 | type Delegation struct { 13 | Amount Coin `json:"amount"` 14 | Delegator string `json:"delegator"` 15 | Validator string `json:"validator"` 16 | } 17 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__AllValidatorsResponse.go: -------------------------------------------------------------------------------- 1 | // AllValidatorsResponse is the expected response to AllValidatorsQuery 2 | type AllValidatorsResponse struct { 3 | Validators Array[Validator] `json:"validators"` 4 | } 5 | 6 | type Validator struct { 7 | Address string `json:"address"` 8 | // decimal string, eg "0.02" 9 | Commission string `json:"commission"` 10 | // decimal string, eg "0.02" 11 | MaxChangeRate string `json:"max_change_rate"` 12 | // decimal string, eg "0.02" 13 | MaxCommission string `json:"max_commission"` 14 | } 15 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__BalanceResponse.go: -------------------------------------------------------------------------------- 1 | // BalanceResponse is the expected response to BalanceQuery 2 | type BalanceResponse struct { 3 | Amount Coin `json:"amount"` 4 | } 5 | 6 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 7 | type Coin struct { 8 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 9 | Denom string `json:"denom"` // type, eg. "ATOM" 10 | } 11 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__BankMsg.go: -------------------------------------------------------------------------------- 1 | // SendMsg contains instructions for a Cosmos-SDK/SendMsg 2 | // It has a fixed interface here and should be converted into the proper SDK format before dispatching 3 | type SendMsg struct { 4 | Amount Array[Coin] `json:"amount"` 5 | ToAddress string `json:"to_address"` 6 | } 7 | 8 | // BurnMsg will burn the given coins from the contract's account. 9 | // There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. 10 | // Important if a contract controls significant token supply that must be retired. 11 | type BurnMsg struct { 12 | Amount Array[Coin] `json:"amount"` 13 | } 14 | 15 | type BankMsg struct { 16 | Send *SendMsg `json:"send,omitempty"` 17 | Burn *BurnMsg `json:"burn,omitempty"` 18 | } 19 | 20 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 21 | type Coin struct { 22 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 23 | Denom string `json:"denom"` // type, eg. "ATOM" 24 | } 25 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__BondedDenomResponse.go: -------------------------------------------------------------------------------- 1 | type BondedDenomResponse struct { 2 | Denom string `json:"denom"` 3 | } 4 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__CodeInfoResponse.go: -------------------------------------------------------------------------------- 1 | type CodeInfoResponse struct { 2 | Checksum Checksum `json:"checksum"` // before wasmvm 2.0.0, this was `omitempty` (https://github.com/CosmWasm/wasmvm/issues/471) 3 | CodeID uint64 `json:"code_id"` 4 | Creator string `json:"creator"` 5 | } 6 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__ContractInfoResponse.go: -------------------------------------------------------------------------------- 1 | type ContractInfoResponse struct { 2 | // admin who can run migrations (if any) 3 | Admin string `json:"admin,omitempty"` 4 | CodeID uint64 `json:"code_id"` 5 | // address that instantiated this contract 6 | Creator string `json:"creator"` 7 | // set if this contract has bound an Ibc2 port 8 | IBC2Port string `json:"ibc2_port,omitempty"` 9 | // set if this contract has bound an IBC port 10 | IBCPort string `json:"ibc_port,omitempty"` 11 | // if set, the contract is pinned to the cache, and thus uses less gas when called 12 | Pinned bool `json:"pinned"` 13 | } 14 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__DelegationResponse.go: -------------------------------------------------------------------------------- 1 | // DelegationResponse is the expected response to DelegationsQuery 2 | type DelegationResponse struct { 3 | Delegation *FullDelegation `json:"delegation,omitempty"` 4 | } 5 | 6 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 7 | type Coin struct { 8 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 9 | Denom string `json:"denom"` // type, eg. "ATOM" 10 | } 11 | 12 | type FullDelegation struct { 13 | AccumulatedRewards Array[Coin] `json:"accumulated_rewards"` 14 | Amount Coin `json:"amount"` 15 | CanRedelegate Coin `json:"can_redelegate"` 16 | Delegator string `json:"delegator"` 17 | Validator string `json:"validator"` 18 | } 19 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__DelegationRewardsResponse.go: -------------------------------------------------------------------------------- 1 | // See 2 | type DelegationRewardsResponse struct { 3 | Rewards Array[DecCoin] `json:"rewards"` // in wasmvm, this has type `[]DecCoin` 4 | } 5 | 6 | // A coin type with decimal amount. Modeled after the Cosmos SDK's [DecCoin](https://github.com/cosmos/cosmos-sdk/blob/c74e2887b0b73e81d48c2f33e6b1020090089ee0/proto/cosmos/base/v1beta1/coin.proto#L32-L41) type 7 | type DecCoin struct { 8 | Amount string `json:"amount"` 9 | Denom string `json:"denom"` 10 | } 11 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__DelegationTotalRewardsResponse.go: -------------------------------------------------------------------------------- 1 | // See 2 | type DelegationTotalRewardsResponse struct { 3 | Rewards Array[DelegatorReward] `json:"rewards"` // in wasmvm, this has type `[]DelegatorReward` 4 | Total Array[DecCoin] `json:"total"` // in wasmvm, this has type `[]DecCoin` 5 | } 6 | 7 | // A coin type with decimal amount. Modeled after the Cosmos SDK's [DecCoin](https://github.com/cosmos/cosmos-sdk/blob/c74e2887b0b73e81d48c2f33e6b1020090089ee0/proto/cosmos/base/v1beta1/coin.proto#L32-L41) type 8 | type DecCoin struct { 9 | Amount string `json:"amount"` 10 | Denom string `json:"denom"` 11 | } 12 | 13 | type DelegatorReward struct { 14 | Reward Array[DecCoin] `json:"reward"` // in wasmvm, this has type `[]DecCoin` 15 | ValidatorAddress string `json:"validator_address"` 16 | } 17 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__DelegatorValidatorsResponse.go: -------------------------------------------------------------------------------- 1 | // See 2 | type DelegatorValidatorsResponse struct { 3 | Validators Array[string] `json:"validators"` // in wasmvm, this has type `[]string` 4 | } 5 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__DelegatorWithdrawAddressResponse.go: -------------------------------------------------------------------------------- 1 | type DelegatorWithdrawAddressResponse struct { 2 | WithdrawAddress string `json:"withdraw_address"` 3 | } 4 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__IbcQuery.go: -------------------------------------------------------------------------------- 1 | type PortIDQuery struct { 2 | } 3 | 4 | type ChannelQuery struct { 5 | ChannelID string `json:"channel_id"` 6 | // optional argument 7 | PortID string `json:"port_id,omitempty"` 8 | } 9 | 10 | // IBCQuery defines a query request from the contract into the chain. 11 | // This is the counterpart of [IbcQuery](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta1/packages/std/src/ibc.rs#L61-L83). 12 | type IBCQuery struct { 13 | PortID *PortIDQuery `json:"port_id,omitempty"` 14 | Channel *ChannelQuery `json:"channel,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__RawRangeResponse.go: -------------------------------------------------------------------------------- 1 | type RawRangeResponse struct { 2 | // The key-value pairs 3 | Data Array[Array[[]byte]] `json:"data"` 4 | // `None` if there are no more key-value pairs within the given key range. 5 | NextKey []byte `json:"next_key"` 6 | } 7 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__StakingMsg.go: -------------------------------------------------------------------------------- 1 | type DelegateMsg struct { 2 | Amount Coin `json:"amount"` 3 | Validator string `json:"validator"` 4 | } 5 | type UndelegateMsg struct { 6 | Amount Coin `json:"amount"` 7 | Validator string `json:"validator"` 8 | } 9 | type RedelegateMsg struct { 10 | Amount Coin `json:"amount"` 11 | DstValidator string `json:"dst_validator"` 12 | SrcValidator string `json:"src_validator"` 13 | } 14 | 15 | type StakingMsg struct { 16 | Delegate *DelegateMsg `json:"delegate,omitempty"` 17 | Undelegate *UndelegateMsg `json:"undelegate,omitempty"` 18 | Redelegate *RedelegateMsg `json:"redelegate,omitempty"` 19 | } 20 | 21 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 22 | type Coin struct { 23 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 24 | Denom string `json:"denom"` // type, eg. "ATOM" 25 | } 26 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__StakingQuery.go: -------------------------------------------------------------------------------- 1 | type BondedDenomQuery struct { // does not exist in wasmvm, but is an anonymous struct instead 2 | } 3 | 4 | type AllDelegationsQuery struct { 5 | Delegator string `json:"delegator"` 6 | } 7 | 8 | type DelegationQuery struct { 9 | Delegator string `json:"delegator"` 10 | Validator string `json:"validator"` 11 | } 12 | 13 | type AllValidatorsQuery struct { 14 | } 15 | 16 | type ValidatorQuery struct { 17 | /// Address is the validator's address (e.g. cosmosvaloper1...) 18 | Address string `json:"address"` 19 | } 20 | 21 | type StakingQuery struct { 22 | BondedDenom *BondedDenomQuery `json:"bonded_denom,omitempty"` 23 | AllDelegations *AllDelegationsQuery `json:"all_delegations,omitempty"` 24 | Delegation *DelegationQuery `json:"delegation,omitempty"` 25 | AllValidators *AllValidatorsQuery `json:"all_validators,omitempty"` 26 | Validator *ValidatorQuery `json:"validator,omitempty"` 27 | } 28 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__SupplyResponse.go: -------------------------------------------------------------------------------- 1 | // SupplyResponse is the expected response to SupplyQuery 2 | type SupplyResponse struct { 3 | Amount Coin `json:"amount"` 4 | } 5 | 6 | // Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) 7 | type Coin struct { 8 | Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" 9 | Denom string `json:"denom"` // type, eg. "ATOM" 10 | } 11 | -------------------------------------------------------------------------------- /packages/go-gen/tests/cosmwasm_std__ValidatorResponse.go: -------------------------------------------------------------------------------- 1 | // ValidatorResponse is the expected response to ValidatorQuery 2 | type ValidatorResponse struct { 3 | Validator *Validator `json:"validator"` // serializes to `null` when unset which matches Rust's Option::None serialization 4 | } 5 | 6 | type Validator struct { 7 | Address string `json:"address"` 8 | // decimal string, eg "0.02" 9 | Commission string `json:"commission"` 10 | // decimal string, eg "0.02" 11 | MaxChangeRate string `json:"max_change_rate"` 12 | // decimal string, eg "0.02" 13 | MaxCommission string `json:"max_commission"` 14 | } 15 | -------------------------------------------------------------------------------- /packages/schema-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-schema-derive" 3 | version.workspace = true 4 | authors = ["Tomasz Kurcz "] 5 | edition = "2021" 6 | description = "Derive macros for cosmwasm-schema" 7 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" 8 | license = "Apache-2.0" 9 | 10 | [dependencies] 11 | proc-macro2 = "1" 12 | quote = "1" 13 | syn = { version = "2", features = ["extra-traits", "full", "printing"] } 14 | 15 | [lib] 16 | proc-macro = true 17 | -------------------------------------------------------------------------------- /packages/schema-derive/README.md: -------------------------------------------------------------------------------- 1 | # CosmWasm Schema Derive Macros 2 | 3 | [![cosmwasm-schema-derive on crates.io](https://img.shields.io/crates/v/cosmwasm-schema-derive.svg)](https://crates.io/crates/cosmwasm-schema-derive) 4 | 5 | This is where all macros related to the 6 | [`cosmwasm-schema`](https://crates.io/crates/cosmwasm-schema) crate live. You 7 | almost certainly don't want to add this crate as an explicit dependency in your 8 | project, but rather import the macros through `cosmwasm-schema`. 9 | 10 | ## License 11 | 12 | This package is part of the cosmwasm repository, licensed under the Apache 13 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 14 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 15 | -------------------------------------------------------------------------------- /packages/schema/.gitignore: -------------------------------------------------------------------------------- 1 | # This folder is generated and updated by doc tests 2 | # (cargo test --doc write_api) 3 | # but not something we need to have versioned. 4 | schema/ 5 | -------------------------------------------------------------------------------- /packages/schema/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-schema" 3 | version.workspace = true 4 | authors = [ 5 | "Ethan Frey ", 6 | "Simon Warta ", 7 | ] 8 | edition = "2021" 9 | description = "A dev-dependency for CosmWasm contracts to generate JSON Schema files." 10 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" 11 | license = "Apache-2.0" 12 | 13 | [dependencies] 14 | cosmwasm-schema-derive = { version = "=3.0.0-rc.0", path = "../schema-derive" } 15 | schemars = { workspace = true } 16 | serde = { workspace = true } 17 | serde_json = "1.0.140" 18 | thiserror = "1.0.26" 19 | 20 | [dev-dependencies] 21 | anyhow = "1.0.57" 22 | insta = { version = "1.41.1", features = ["json"] } 23 | semver = "1" 24 | tempfile = "3" 25 | -------------------------------------------------------------------------------- /packages/schema/README.md: -------------------------------------------------------------------------------- 1 | # CosmWasm Schema 2 | 3 | [![cosmwasm-schema on crates.io](https://img.shields.io/crates/v/cosmwasm-schema.svg)](https://crates.io/crates/cosmwasm-schema) 4 | 5 | A dev-dependency for CosmWasm contracts to generate JSON Schema files. 6 | 7 | ## License 8 | 9 | This package is part of the cosmwasm repository, licensed under the Apache 10 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 11 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 12 | -------------------------------------------------------------------------------- /packages/schema/src/casing.rs: -------------------------------------------------------------------------------- 1 | pub fn to_snake_case(name: &str) -> String { 2 | let mut out = String::new(); 3 | for (index, ch) in name.char_indices() { 4 | if index != 0 && ch.is_uppercase() { 5 | out.push('_'); 6 | } 7 | out.push(ch.to_ascii_lowercase()); 8 | } 9 | out 10 | } 11 | 12 | #[cfg(test)] 13 | mod tests { 14 | use super::*; 15 | 16 | #[test] 17 | fn to_snake_case_leaves_snake_case_untouched() { 18 | assert_eq!(to_snake_case(""), ""); 19 | assert_eq!(to_snake_case("a"), "a"); 20 | assert_eq!(to_snake_case("abc"), "abc"); 21 | assert_eq!(to_snake_case("a_bc"), "a_bc"); 22 | } 23 | 24 | #[test] 25 | fn to_snake_case_works_for_camel_case() { 26 | assert_eq!(to_snake_case("Foobar"), "foobar"); 27 | assert_eq!(to_snake_case("FooBar"), "foo_bar"); 28 | assert_eq!(to_snake_case("ABC"), "a_b_c"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/schema/tests/snapshots/idl__assert_maps_generate_correctly.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: packages/schema/tests/idl.rs 3 | expression: schema 4 | --- 5 | { 6 | "$schema": "http://json-schema.org/draft-07/schema#", 7 | "title": "MapMsg", 8 | "type": "object", 9 | "required": [ 10 | "btree", 11 | "hash" 12 | ], 13 | "properties": { 14 | "btree": { 15 | "type": "object", 16 | "additionalProperties": { 17 | "type": "integer", 18 | "format": "uint32", 19 | "minimum": 0.0 20 | } 21 | }, 22 | "hash": { 23 | "type": "object", 24 | "additionalProperties": { 25 | "type": "integer", 26 | "format": "uint32", 27 | "minimum": 0.0 28 | } 29 | } 30 | }, 31 | "additionalProperties": false 32 | } 33 | -------------------------------------------------------------------------------- /packages/std/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --lib --target wasm32-unknown-unknown" 3 | wasm-debug = "build --lib --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | -------------------------------------------------------------------------------- /packages/std/README.md: -------------------------------------------------------------------------------- 1 | # cosmwasm 2 | 3 | [![cosmwasm-std on crates.io](https://img.shields.io/crates/v/cosmwasm-std.svg)](https://crates.io/crates/cosmwasm-std) 4 | 5 | The standard library for building CosmWasm smart contracts. Code in this package 6 | is compiled into the smart contract. 7 | 8 | ## License 9 | 10 | This package is part of the cosmwasm repository, licensed under the Apache 11 | License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) 12 | and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). 13 | -------------------------------------------------------------------------------- /packages/std/src/__internal.rs: -------------------------------------------------------------------------------- 1 | //! 2 | //! # ⚠ DO NOT DEPEND ON THIS AS AN OUTSIDE CONSUMER 3 | //! 4 | //! **THIS MODULE IS SEMVER EXEMPT AND ONLY MEANT TO SHARE TYPES BETWEEN CORE AND STD** 5 | //! 6 | //! Module for re-exporting implementation details from `core` to `std` 7 | //! 8 | 9 | pub use crate::__internal__forward_ref_partial_eq as forward_ref_partial_eq; 10 | -------------------------------------------------------------------------------- /packages/std/src/conversion.rs: -------------------------------------------------------------------------------- 1 | /// Converts an input of type usize to u32. 2 | /// 3 | /// On 32 bit platforms such as wasm32 this is just a safe cast. 4 | /// On other platforms the conversion panics for values larger than 5 | /// `u32::MAX`. 6 | #[inline] 7 | pub fn force_to_u32(input: usize) -> u32 { 8 | #[cfg(target_pointer_width = "32")] 9 | { 10 | // usize = u32 on this architecture 11 | input as u32 12 | } 13 | #[cfg(not(target_pointer_width = "32"))] 14 | { 15 | input.try_into().expect("Input exceeds u32 range") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/std/src/errors/mod.rs: -------------------------------------------------------------------------------- 1 | mod backtrace; 2 | mod recover_pubkey_error; 3 | mod std_error; 4 | mod system_error; 5 | mod verification_error; 6 | 7 | pub(crate) use backtrace::{impl_from_err, BT}; 8 | pub use recover_pubkey_error::RecoverPubkeyError; 9 | pub use std_error::{ 10 | CheckedFromRatioError, CheckedMultiplyFractionError, CheckedMultiplyRatioError, 11 | CoinFromStrError, CoinsError, ConversionOverflowError, DivideByZeroError, DivisionError, 12 | OverflowError, OverflowOperation, RoundDownOverflowError, RoundUpOverflowError, StdError, 13 | StdResult, 14 | }; 15 | pub use system_error::SystemError; 16 | pub use verification_error::{AggregationError, PairingEqualityError, VerificationError}; 17 | -------------------------------------------------------------------------------- /packages/std/src/exports/mod.rs: -------------------------------------------------------------------------------- 1 | mod exports; 2 | mod imports; 3 | mod memory; // Used by exports and imports only. This assumes pointers are 32 bit long, which makes it untestable on dev machines. 4 | mod panic; 5 | 6 | #[cfg(feature = "cosmwasm_2_2")] 7 | pub use exports::do_migrate_with_info; 8 | pub use exports::{ 9 | do_execute, do_ibc_destination_callback, do_ibc_source_callback, do_instantiate, do_migrate, 10 | do_query, do_reply, do_sudo, 11 | }; 12 | #[cfg(feature = "ibc2")] 13 | pub use exports::{ 14 | do_ibc2_packet_ack, do_ibc2_packet_receive, do_ibc2_packet_send, do_ibc2_packet_timeout, 15 | }; 16 | #[cfg(feature = "stargate")] 17 | pub use exports::{ 18 | do_ibc_channel_close, do_ibc_channel_connect, do_ibc_channel_open, do_ibc_packet_ack, 19 | do_ibc_packet_receive, do_ibc_packet_timeout, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/std/src/exports/panic.rs: -------------------------------------------------------------------------------- 1 | /// Installs a panic handler that aborts the contract execution 2 | /// and sends the panic message and location to the host. 3 | /// 4 | /// This overrides any previous panic handler. See 5 | /// for details. 6 | pub fn install_panic_handler() { 7 | use super::imports::handle_panic; 8 | std::panic::set_hook(Box::new(|info| { 9 | // E.g. "panicked at 'oh no (a = 3)', src/contract.rs:51:5" 10 | let full_message = info.to_string(); 11 | handle_panic(&full_message); 12 | })); 13 | } 14 | -------------------------------------------------------------------------------- /packages/std/src/import_helpers.rs: -------------------------------------------------------------------------------- 1 | /// Returns the four most significant bytes 2 | #[allow(dead_code)] // only used in Wasm builds 3 | #[inline] 4 | pub fn from_high_half(data: u64) -> u32 { 5 | (data >> 32).try_into().unwrap() 6 | } 7 | 8 | /// Returns the four least significant bytes 9 | #[allow(dead_code)] // only used in Wasm builds 10 | #[inline] 11 | pub fn from_low_half(data: u64) -> u32 { 12 | (data & 0xFFFFFFFF).try_into().unwrap() 13 | } 14 | 15 | #[cfg(test)] 16 | mod tests { 17 | use super::*; 18 | 19 | #[test] 20 | fn from_high_half_works() { 21 | assert_eq!(from_high_half(0), 0); 22 | assert_eq!(from_high_half(0x1122334455667788), 0x11223344); 23 | } 24 | 25 | #[test] 26 | fn from_low_haf_works() { 27 | assert_eq!(from_low_half(0), 0); 28 | assert_eq!(from_low_half(0x1122334455667788), 0x55667788); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/std/src/math/num_consts.rs: -------------------------------------------------------------------------------- 1 | /// Crate internal trait for all our signed and unsigned number types 2 | #[allow(dead_code)] // only used in tests for now 3 | pub(crate) trait NumConsts { 4 | const MAX: Self; 5 | const MIN: Self; 6 | const ZERO: Self; 7 | const ONE: Self; 8 | } 9 | -------------------------------------------------------------------------------- /packages/std/src/pagination.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use crate::Binary; 5 | 6 | /// Simplified version of the PageRequest type for pagination from the cosmos-sdk 7 | #[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema)] 8 | pub struct PageRequest { 9 | pub key: Option, 10 | pub limit: u32, 11 | pub reverse: bool, 12 | } 13 | -------------------------------------------------------------------------------- /packages/std/src/prelude.rs: -------------------------------------------------------------------------------- 1 | pub use alloc::boxed::Box; 2 | pub use alloc::string::{String, ToString}; 3 | pub use alloc::vec::Vec; 4 | -------------------------------------------------------------------------------- /packages/std/src/query/query_response.rs: -------------------------------------------------------------------------------- 1 | use core::fmt::Debug; 2 | 3 | use serde::de::DeserializeOwned; 4 | 5 | /// A marker trait for query response types. 6 | /// 7 | /// Those types have in common that they should be `#[non_exhaustive]` in order 8 | /// to allow adding fields in a backwards compatible way. In contracts they are 9 | /// only constructed through deserialization. We want to make it hard for 10 | /// contract developers to construct those types themselves as this is most likely 11 | /// not what they should do. 12 | /// 13 | /// In hosts they are constructed as follows: 14 | /// - wasmvm: Go types with the same JSON layout 15 | /// - multi-test/cw-sdk: create a default instance and mutate the fields 16 | /// 17 | /// This trait is crate-internal and can change any time. 18 | #[allow(dead_code)] // This is used to statically ensure all the types have a shared set of traits 19 | pub(crate) trait QueryResponseType: DeserializeOwned + Debug + PartialEq + Clone {} 20 | -------------------------------------------------------------------------------- /packages/std/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 query; 8 | mod response; 9 | mod submessages; 10 | mod system_result; 11 | 12 | pub use contract_result::ContractResult; 13 | #[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))] 14 | pub use cosmos_msg::WeightedVoteOption; 15 | pub use cosmos_msg::{ 16 | wasm_execute, wasm_instantiate, AnyMsg, BankMsg, CosmosMsg, CustomMsg, WasmMsg, 17 | }; 18 | #[cfg(feature = "staking")] 19 | pub use cosmos_msg::{DistributionMsg, StakingMsg}; 20 | #[cfg(feature = "stargate")] 21 | pub use cosmos_msg::{GovMsg, VoteOption}; 22 | pub use empty::Empty; 23 | pub use events::{attr, Attribute, Event}; 24 | pub use query::QueryResponse; 25 | pub use response::Response; 26 | pub use submessages::{MsgResponse, Reply, ReplyOn, SubMsg, SubMsgResponse, SubMsgResult}; 27 | pub use system_result::SystemResult; 28 | -------------------------------------------------------------------------------- /packages/std/src/results/query.rs: -------------------------------------------------------------------------------- 1 | pub type QueryResponse = crate::Binary; 2 | -------------------------------------------------------------------------------- /packages/std/src/storage_keys/mod.rs: -------------------------------------------------------------------------------- 1 | mod length_prefixed; 2 | #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] 3 | mod range; 4 | 5 | // Please note that the entire storage_keys module is public. So be careful 6 | // when adding elements here. 7 | pub use length_prefixed::{namespace_with_key, to_length_prefixed, to_length_prefixed_nested}; 8 | #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] 9 | pub(crate) use range::{range_to_bounds, ToByteVec}; 10 | -------------------------------------------------------------------------------- /packages/std/src/utils.rs: -------------------------------------------------------------------------------- 1 | /// Implements a hidden constructor for non-exhaustive structures that need 2 | /// to be built in libraries like cw-multi-test. 3 | macro_rules! impl_hidden_constructor { 4 | ( $type:ty, $( $field: ident : $t: ty),* ) => { 5 | impl $type { 6 | /// Constructor for testing frameworks such as cw-multi-test. 7 | /// This is required because the type is #[non_exhaustive]. 8 | /// As a contract developer you should not need this constructor since 9 | /// the given structure is constructed for you via deserialization. 10 | /// 11 | /// Warning: This can change in breaking ways in minor versions. 12 | #[doc(hidden)] 13 | #[allow(dead_code)] 14 | pub fn new($( $field: $t),*) -> Self { 15 | Self { $( $field ),* } 16 | } 17 | } 18 | }; 19 | } 20 | 21 | pub(crate) use impl_hidden_constructor; 22 | -------------------------------------------------------------------------------- /packages/vm-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cosmwasm-vm-derive" 3 | edition = "2021" 4 | version.workspace = true 5 | description = "Derive macros for cosmwasm-vm. For internal use only. No stability guarantees." 6 | repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/std" 7 | license = "Apache-2.0" 8 | 9 | [lib] 10 | proc-macro = true 11 | 12 | [dependencies] 13 | blake2 = "0.10.6" 14 | proc-macro2 = "1.0.86" 15 | quote = "1.0.37" 16 | syn = { version = "2.0.77", features = ["extra-traits", "full"] } 17 | -------------------------------------------------------------------------------- /packages/vm-derive/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod hash_function; 2 | 3 | macro_rules! maybe { 4 | ($result:expr) => {{ 5 | match { $result } { 6 | Ok(val) => val, 7 | Err(err) => return err.into_compile_error(), 8 | } 9 | }}; 10 | } 11 | use maybe; 12 | 13 | /// Hash the function 14 | /// 15 | /// # Example 16 | /// 17 | /// ```rust 18 | /// # use cosmwasm_vm_derive::hash_function; 19 | /// #[hash_function(const_name = "HASH")] 20 | /// fn foo() { 21 | /// println!("Hello, world!"); 22 | /// } 23 | /// ``` 24 | #[proc_macro_attribute] 25 | pub fn hash_function( 26 | attr: proc_macro::TokenStream, 27 | item: proc_macro::TokenStream, 28 | ) -> proc_macro::TokenStream { 29 | hash_function::hash_function_impl(attr.into(), item.into()).into() 30 | } 31 | -------------------------------------------------------------------------------- /packages/vm/src/errors/mod.rs: -------------------------------------------------------------------------------- 1 | mod backtrace; 2 | mod communication_error; 3 | mod region_validation_error; 4 | mod vm_error; 5 | 6 | pub(crate) use backtrace::{impl_from_err, BT}; 7 | pub use communication_error::CommunicationError; 8 | pub use region_validation_error::RegionValidationError; 9 | pub use vm_error::VmError; 10 | 11 | pub type CommunicationResult = core::result::Result; 12 | pub type RegionValidationResult = core::result::Result; 13 | pub type VmResult = core::result::Result; 14 | -------------------------------------------------------------------------------- /packages/vm/src/modules/mod.rs: -------------------------------------------------------------------------------- 1 | mod cached_module; 2 | mod file_system_cache; 3 | mod in_memory_cache; 4 | mod pinned_memory_cache; 5 | mod versioning; 6 | 7 | pub use cached_module::CachedModule; 8 | pub use file_system_cache::FileSystemCache; 9 | pub use in_memory_cache::InMemoryCache; 10 | pub use pinned_memory_cache::PinnedMemoryCache; 11 | pub use versioning::current_wasmer_module_version; 12 | -------------------------------------------------------------------------------- /packages/vm/src/testing/mod.rs: -------------------------------------------------------------------------------- 1 | // The external interface is `use cosmwasm_vm::testing::X` for all integration testing symbols, no matter where they live internally. 2 | 3 | mod calls; 4 | mod instance; 5 | mod mock; 6 | mod querier; 7 | mod storage; 8 | 9 | pub use calls::{execute, instantiate, migrate, migrate_with_info, query, reply, sudo}; 10 | #[cfg(feature = "stargate")] 11 | pub use calls::{ 12 | ibc_channel_close, ibc_channel_connect, ibc_channel_open, ibc_packet_ack, ibc_packet_receive, 13 | ibc_packet_timeout, 14 | }; 15 | pub use instance::{ 16 | mock_instance, mock_instance_options, mock_instance_with_balances, 17 | mock_instance_with_failing_api, mock_instance_with_gas_limit, mock_instance_with_options, 18 | test_io, MockInstanceOptions, 19 | }; 20 | pub use mock::{ 21 | mock_backend, mock_backend_with_balances, mock_env, mock_info, MockApi, MOCK_CONTRACT_ADDR, 22 | }; 23 | pub use querier::MockQuerier; 24 | pub use storage::MockStorage; 25 | -------------------------------------------------------------------------------- /packages/vm/src/wasm_backend/mod.rs: -------------------------------------------------------------------------------- 1 | mod compile; 2 | mod engine; 3 | mod gatekeeper; 4 | mod limiting_tunables; 5 | 6 | #[cfg(test)] 7 | pub use engine::make_compiler_config; 8 | 9 | pub use compile::compile; 10 | pub use engine::{make_compiling_engine, make_runtime_engine, COST_FUNCTION_HASH}; 11 | -------------------------------------------------------------------------------- /packages/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 | -------------------------------------------------------------------------------- /packages/vm/testdata/corrupted.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/corrupted.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/cyberpunk.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/cyberpunk.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/cyberpunk_rust170.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/cyberpunk_rust170.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/empty.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/empty.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/floaty.wasm: -------------------------------------------------------------------------------- 1 | floaty_1.2.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/floaty_0.16.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/floaty_0.16.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/floaty_1.0.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/floaty_1.0.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/floaty_1.2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/floaty_1.2.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/floaty_2.0.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/floaty_2.0.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.10.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.10.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.11.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.11.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.12.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.12.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.14.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.14.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.15.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.15.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.16.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.16.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.7.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.7.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.8.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.8.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_0.9.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_0.9.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_1.0.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_1.0.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_1.2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_1.2.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/hackatom_1.3.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/hackatom_1.3.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc2.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_callbacks.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_callbacks.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect_0.14.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect_0.14.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect_0.15.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect_0.15.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect_0.16.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect_0.16.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect_1.0.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect_1.0.wasm -------------------------------------------------------------------------------- /packages/vm/testdata/ibc_reflect_1.2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CosmWasm/cosmwasm/e65152abb9f1a4bb402016a52e5ec763a222db1e/packages/vm/testdata/ibc_reflect_1.2.wasm --------------------------------------------------------------------------------