create-dubhe 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +55 -55
- package/package.json +1 -1
- package/template/101/aptos-template/contracts/counter/.history/aptos_local/latest.json +6 -0
- package/template/101/aptos-template/contracts/counter/build/counter/BuildInfo.yaml +60 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/counter_schema.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/counter_system.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/account.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator_factory.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator_v2.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_account.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_coin.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_governance.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/block.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/chain_id.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/chain_status.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/code.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/coin.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/config_buffer.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/consensus_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/create_signer.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/delegation_pool.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/dispatchable_fungible_asset.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/dkg.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/event.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/execution_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/function_info.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/fungible_asset.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/gas_schedule.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/genesis.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/governance_proposal.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/guid.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/jwk_consensus_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/jwks.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/keyless_account.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/managed_coin.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/multisig_account.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/object.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/object_code_deployment.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/optional_aggregator.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/primary_fungible_store.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_api_v0_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_config_seqnum.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration_state.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration_with_dkg.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/resource_account.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/stake.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_config.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_contract.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_proxy.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/state_storage.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/storage_gas.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/system_addresses.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/timestamp.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_context.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_fee.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_validation.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/util.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/validator_consensus_info.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/version.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/vesting.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/voting.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/any.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/aptos_hash.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/big_vector.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bls12381.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bls12381_algebra.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bn254_algebra.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/capability.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/comparator.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/copyable_any.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/crypto_algebra.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/debug.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ed25519.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/fixed_point64.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/from_bcs.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math128.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math64.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math_fixed.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math_fixed64.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/multi_ed25519.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/pool_u64.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/pool_u64_unbound.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_bulletproofs.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_elgamal.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_pedersen.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/secp256k1.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/simple_map.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/smart_table.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/smart_vector.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/string_utils.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/table.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/table_with_length.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/type_info.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/acl.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bcs.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bit_vector.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/error.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/features.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/fixed_point32.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/hash.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/mem.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/option.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/signer.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/string.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/vector.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/deploy_hook.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/entity_key.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/events.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/init.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/bytecode_modules/world.mv +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/counter_schema.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/counter_system.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/account.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator_factory.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator_v2.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_account.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_coin.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_governance.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/block.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/chain_id.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/chain_status.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/code.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/coin.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/config_buffer.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/consensus_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/create_signer.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/delegation_pool.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/dispatchable_fungible_asset.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/dkg.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/event.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/execution_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/function_info.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/fungible_asset.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/gas_schedule.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/genesis.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/governance_proposal.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/guid.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/jwk_consensus_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/jwks.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/keyless_account.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/managed_coin.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/multisig_account.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/object.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/object_code_deployment.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/optional_aggregator.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/primary_fungible_store.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_api_v0_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_config_seqnum.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration_state.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration_with_dkg.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/resource_account.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/stake.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_config.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_contract.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_proxy.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/state_storage.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/storage_gas.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/system_addresses.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/timestamp.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_context.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_fee.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_validation.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/util.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/validator_consensus_info.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/version.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/vesting.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/voting.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/any.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/aptos_hash.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/big_vector.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bls12381.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bls12381_algebra.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bn254_algebra.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/capability.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/comparator.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/copyable_any.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/crypto_algebra.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/debug.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ed25519.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/fixed_point64.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/from_bcs.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math128.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math64.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math_fixed.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math_fixed64.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/multi_ed25519.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/pool_u64.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/pool_u64_unbound.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_bulletproofs.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_elgamal.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_pedersen.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/secp256k1.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/simple_map.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/smart_table.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/smart_vector.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/string_utils.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/table.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/table_with_length.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/type_info.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/acl.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bcs.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bit_vector.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/error.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/features.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/fixed_point32.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/hash.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/mem.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/option.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/signer.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/string.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/vector.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/deploy_hook.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/entity_key.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/events.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/init.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/source_maps/world.mvsm +0 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/counter_schema.move +59 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/counter_system.move +11 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/account.move +1604 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator.move +48 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator_factory.move +83 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator_v2.move +473 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_account.move +480 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_coin.move +204 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_governance.move +1390 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/block.move +349 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/chain_id.move +41 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/chain_status.move +48 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/code.move +367 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/coin.move +2014 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/config_buffer.move +101 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/consensus_config.move +77 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/create_signer.move +21 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/delegation_pool.move +5568 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/dispatchable_fungible_asset.move +228 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/dkg.move +121 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/event.move +92 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/execution_config.move +66 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/function_info.move +100 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/fungible_asset.move +1673 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/gas_schedule.move +176 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/genesis.move +549 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/governance_proposal.move +23 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/guid.move +68 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/jwk_consensus_config.move +148 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/jwks.move +889 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/keyless_account.move +312 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/managed_coin.move +267 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/multisig_account.move +2594 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/object.move +1095 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/object_code_deployment.move +147 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/optional_aggregator.move +286 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/primary_fungible_store.move +405 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness.move +574 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_api_v0_config.move +57 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_config.move +153 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_config_seqnum.move +49 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration.move +222 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration_state.move +132 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration_with_dkg.move +69 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/resource_account.move +267 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/stake.move +3185 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_config.move +686 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_contract.move +1627 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_proxy.move +228 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/state_storage.move +90 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/storage_gas.move +622 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/system_addresses.move +82 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/timestamp.move +88 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_context.move +262 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_fee.move +170 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_validation.move +486 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/util.move +16 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/validator_consensus_info.move +42 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/version.move +115 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/vesting.move +2192 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/voting.move +1282 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/any.move +57 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/aptos_hash.move +253 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/big_vector.move +469 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bls12381.move +985 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bls12381_algebra.move +802 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bn254_algebra.move +855 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/capability.move +193 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/comparator.move +173 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/copyable_any.move +45 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/crypto_algebra.move +351 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/debug.move +278 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ed25519.move +262 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/fixed_point64.move +447 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/from_bcs.move +91 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math128.move +381 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math64.move +336 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math_fixed.move +139 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math_fixed64.move +142 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/multi_ed25519.move +482 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/pool_u64.move +571 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/pool_u64_unbound.move +270 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255.move +1310 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_bulletproofs.move +253 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_elgamal.move +234 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_pedersen.move +158 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/secp256k1.move +114 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/simple_map.move +319 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/smart_table.move +769 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/smart_vector.move +766 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/string_utils.move +148 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/table.move +152 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/table_with_length.move +141 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/type_info.move +351 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/acl.move +46 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bcs.move +46 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bit_vector.move +239 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/error.move +88 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/features.move +784 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/fixed_point32.move +295 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/hash.move +8 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/mem.move +34 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/option.move +356 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/signer.move +21 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/string.move +93 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/vector.move +691 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/deploy_hook.move +19 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/entity_key.move +31 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/events.move +34 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/init.move +17 -0
- package/template/101/aptos-template/contracts/counter/build/counter/sources/world.move +65 -0
- package/template/101/aptos-template/package.json +25 -34
- package/template/101/aptos-template/pnpm-lock.yaml +6737 -0
- package/template/101/aptos-template/scripts/checkBalance.ts +37 -0
- package/template/101/aptos-template/scripts/generateAccount.ts +37 -8
- package/template/101/aptos-template/src/chain/config.ts +3 -3
- package/template/101/aptos-template/src/pages/_app.tsx +7 -1
- package/template/101/aptos-template/src/pages/home/index.tsx +50 -35
- package/template/101/initia-template/.dockerignore +7 -0
- package/template/101/initia-template/.eslintrc.json +3 -0
- package/template/101/initia-template/.prettierrc +8 -0
- package/template/101/initia-template/Dockerfile +52 -0
- package/template/101/initia-template/LICENSE +674 -0
- package/template/101/initia-template/README.md +14 -0
- package/template/101/initia-template/contracts/counter/Move.toml +10 -0
- package/template/101/initia-template/contracts/counter/build/counter/BuildInfo.yaml +46 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/counter.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/account.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/address.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/any.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/aptos_hash.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/base64.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/bech32.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/bigdecimal.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/biguint.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/block.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/code.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/coin.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/collection.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/comparator.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/copyable_any.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/cosmos.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/debug.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/dex.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/dispatchable_fungible_asset.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/ed25519.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/event.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/fixed_point64.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/from_bcs.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/function_info.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/fungible_asset.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/hex.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/initia_nft.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/json.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/keccak.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/managed_coin.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/math128.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/math64.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/minitswap.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/multisig.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/multisig_v2.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/nft.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/object.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/object_code_deployment.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/oracle.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/primary_fungible_store.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/property_map.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/query.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/royalty.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/secp256k1.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/simple_map.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/simple_nft.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/soul_bound_token.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/stableswap.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/staking.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/string_utils.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/table.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/table_key.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/timestamp.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/transaction_context.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/InitiaStdlib/type_info.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveNursery/acl.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveNursery/capability.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveNursery/compare.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveNursery/guid.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/ascii.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bcs.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bit_vector.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/error.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/fixed_point32.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/hash.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/option.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/signer.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/string.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/vector.mv +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/counter.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/account.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/address.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/any.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/aptos_hash.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/base64.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/bech32.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/bigdecimal.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/biguint.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/block.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/code.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/coin.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/collection.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/comparator.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/copyable_any.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/cosmos.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/debug.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/dex.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/dispatchable_fungible_asset.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/ed25519.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/event.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/fixed_point64.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/from_bcs.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/function_info.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/fungible_asset.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/hex.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/initia_nft.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/json.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/keccak.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/managed_coin.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/math128.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/math64.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/minitswap.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/multisig.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/multisig_v2.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/nft.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/object.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/object_code_deployment.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/oracle.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/primary_fungible_store.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/property_map.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/query.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/royalty.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/secp256k1.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/simple_map.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/simple_nft.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/soul_bound_token.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/stableswap.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/staking.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/string_utils.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/table.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/table_key.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/timestamp.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/transaction_context.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/InitiaStdlib/type_info.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveNursery/acl.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveNursery/capability.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveNursery/compare.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveNursery/guid.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/ascii.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bcs.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bit_vector.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/error.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/fixed_point32.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/hash.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/option.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/signer.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/string.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/vector.mvsm +0 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/counter.move +25 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/account.move +386 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/address.move +97 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/any.move +63 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/aptos_hash.move +20 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/base64.move +14 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/bech32.move +37 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/bigdecimal.move +628 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/biguint.move +364 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/block.move +55 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/code.move +357 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/coin.move +430 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/collection.move +674 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/comparator.move +176 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/copyable_any.move +53 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/cosmos.move +572 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/debug.move +352 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/dex.move +2795 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/dispatchable_fungible_asset.move +206 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/ed25519.move +184 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/event.move +42 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/fixed_point64.move +691 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/from_bcs.move +114 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/function_info.move +106 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/fungible_asset.move +1391 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/hex.move +196 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/initia_nft.move +695 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/json.move +266 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/keccak.move +33 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/managed_coin.move +283 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/math128.move +343 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/math64.move +286 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/minitswap.move +3461 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/multisig.move +1011 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/multisig_v2.move +2465 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/nft.move +704 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/object.move +797 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/object_code_deployment.move +157 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/oracle.move +71 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/primary_fungible_store.move +529 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/property_map.move +907 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/query.move +112 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/royalty.move +153 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/secp256k1.move +265 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/simple_map.move +329 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/simple_nft.move +561 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/soul_bound_token.move +862 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/stableswap.move +1659 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/staking.move +2555 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/string_utils.move +234 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/table.move +362 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/table_key.move +47 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/timestamp.move +49 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/transaction_context.move +87 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/InitiaStdlib/type_info.move +80 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveNursery/acl.move +52 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveNursery/capability.move +231 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveNursery/compare.move +76 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveNursery/guid.move +116 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/ascii.move +153 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bcs.move +17 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bit_vector.move +179 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/error.move +116 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/fixed_point32.move +315 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/hash.move +31 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/option.move +390 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/signer.move +21 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/string.move +99 -0
- package/template/101/initia-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/vector.move +703 -0
- package/template/101/initia-template/contracts/counter/sources/counter.move +25 -0
- package/template/101/initia-template/dubhe.config.ts +14 -0
- package/template/101/initia-template/jest.config.ts +17 -0
- package/template/101/initia-template/next-env.d.ts +5 -0
- package/template/101/initia-template/next-i18next.config.js +6 -0
- package/template/101/initia-template/next.config.js +15 -0
- package/template/101/initia-template/package.json +74 -0
- package/template/101/initia-template/pnpm-lock.yaml +7204 -0
- package/template/101/initia-template/postcss.config.js +6 -0
- package/template/101/initia-template/public/discord.svg +9 -0
- package/template/101/initia-template/public/fail.svg +12 -0
- package/template/101/initia-template/public/favicon.ico +0 -0
- package/template/101/initia-template/public/locales/de/common.json +8 -0
- package/template/101/initia-template/public/locales/de/footer.json +3 -0
- package/template/101/initia-template/public/locales/de/second-page.json +5 -0
- package/template/101/initia-template/public/locales/en/common.json +8 -0
- package/template/101/initia-template/public/locales/en/footer.json +3 -0
- package/template/101/initia-template/public/locales/en/second-page.json +5 -0
- package/template/101/initia-template/public/locales/zn/common.json +8 -0
- package/template/101/initia-template/public/locales/zn/footer.json +3 -0
- package/template/101/initia-template/public/locales/zn/second-page.json +5 -0
- package/template/101/initia-template/public/logo.svg +1 -0
- package/template/101/initia-template/public/medium.svg +9 -0
- package/template/101/initia-template/public/successful.svg +11 -0
- package/template/101/initia-template/public/telegram.svg +9 -0
- package/template/101/initia-template/public/twitter.svg +9 -0
- package/template/101/initia-template/scripts/checkBalance.ts +37 -0
- package/template/101/initia-template/scripts/generateAccount.ts +57 -0
- package/template/101/initia-template/scripts/storeConfig.ts +52 -0
- package/template/101/initia-template/scripts/waitNode.ts +9 -0
- package/template/101/initia-template/src/chain/config.ts +5 -0
- package/template/101/initia-template/src/css/font-awesome.css +2337 -0
- package/template/101/initia-template/src/css/font-awesome.min.css +4 -0
- package/template/101/initia-template/src/fonts/FontAwesome.otf +0 -0
- package/template/101/initia-template/src/fonts/fontawesome-webfont.eot +0 -0
- package/template/101/initia-template/src/fonts/fontawesome-webfont.svg +2671 -0
- package/template/101/initia-template/src/fonts/fontawesome-webfont.ttf +0 -0
- package/template/101/initia-template/src/fonts/fontawesome-webfont.woff +0 -0
- package/template/101/initia-template/src/fonts/fontawesome-webfont.woff2 +0 -0
- package/template/101/initia-template/src/jotai/index.tsx +12 -0
- package/template/101/initia-template/src/pages/_app.tsx +15 -0
- package/template/101/initia-template/src/pages/home/index.tsx +90 -0
- package/template/101/initia-template/src/pages/index.tsx +14 -0
- package/template/101/initia-template/tailwind.config.js +56 -0
- package/template/101/initia-template/tsconfig.json +25 -0
- package/template/101/movement-template/.dockerignore +7 -0
- package/template/101/movement-template/.eslintrc.json +3 -0
- package/template/101/movement-template/.prettierrc +8 -0
- package/template/101/movement-template/Dockerfile +56 -0
- package/template/101/movement-template/LICENSE +674 -0
- package/template/101/movement-template/README.md +14 -0
- package/template/101/movement-template/contracts/counter/Move.toml +16 -0
- package/template/101/movement-template/contracts/counter/build/counter/BuildInfo.yaml +60 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/counter_schema.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/counter_system.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/account.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator_factory.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aggregator_v2.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_account.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_coin.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/aptos_governance.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/block.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/chain_id.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/chain_status.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/code.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/coin.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/config_buffer.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/consensus_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/create_signer.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/delegation_pool.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/dispatchable_fungible_asset.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/dkg.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/event.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/execution_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/function_info.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/fungible_asset.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/gas_schedule.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/genesis.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/governance_proposal.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/guid.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/jwk_consensus_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/jwks.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/keyless_account.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/managed_coin.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/multisig_account.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/object.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/object_code_deployment.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/optional_aggregator.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/primary_fungible_store.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_api_v0_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/randomness_config_seqnum.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration_state.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/reconfiguration_with_dkg.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/resource_account.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/stake.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_config.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_contract.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/staking_proxy.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/state_storage.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/storage_gas.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/system_addresses.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/timestamp.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_context.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_fee.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/transaction_validation.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/util.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/validator_consensus_info.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/version.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/vesting.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosFramework/voting.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/any.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/aptos_hash.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/big_vector.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bls12381.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bls12381_algebra.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/bn254_algebra.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/capability.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/comparator.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/copyable_any.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/crypto_algebra.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/debug.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ed25519.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/fixed_point64.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/from_bcs.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math128.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math64.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math_fixed.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/math_fixed64.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/multi_ed25519.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/pool_u64.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/pool_u64_unbound.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_bulletproofs.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_elgamal.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/ristretto255_pedersen.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/secp256k1.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/simple_map.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/smart_table.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/smart_vector.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/string_utils.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/table.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/table_with_length.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/AptosStdlib/type_info.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/acl.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bcs.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/bit_vector.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/error.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/features.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/fixed_point32.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/hash.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/mem.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/option.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/signer.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/string.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/dependencies/MoveStdlib/vector.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/deploy_hook.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/entity_key.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/events.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/init.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/bytecode_modules/world.mv +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/counter_schema.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/counter_system.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/account.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator_factory.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aggregator_v2.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_account.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_coin.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/aptos_governance.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/block.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/chain_id.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/chain_status.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/code.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/coin.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/config_buffer.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/consensus_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/create_signer.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/delegation_pool.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/dispatchable_fungible_asset.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/dkg.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/event.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/execution_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/function_info.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/fungible_asset.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/gas_schedule.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/genesis.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/governance_proposal.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/guid.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/jwk_consensus_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/jwks.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/keyless_account.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/managed_coin.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/multisig_account.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/object.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/object_code_deployment.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/optional_aggregator.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/primary_fungible_store.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_api_v0_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/randomness_config_seqnum.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration_state.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/reconfiguration_with_dkg.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/resource_account.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/stake.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_config.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_contract.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/staking_proxy.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/state_storage.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/storage_gas.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/system_addresses.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/timestamp.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_context.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_fee.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/transaction_validation.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/util.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/validator_consensus_info.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/version.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/vesting.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosFramework/voting.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/any.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/aptos_hash.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/big_vector.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bls12381.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bls12381_algebra.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/bn254_algebra.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/capability.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/comparator.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/copyable_any.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/crypto_algebra.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/debug.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ed25519.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/fixed_point64.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/from_bcs.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math128.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math64.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math_fixed.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/math_fixed64.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/multi_ed25519.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/pool_u64.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/pool_u64_unbound.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_bulletproofs.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_elgamal.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/ristretto255_pedersen.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/secp256k1.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/simple_map.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/smart_table.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/smart_vector.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/string_utils.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/table.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/table_with_length.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/AptosStdlib/type_info.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/acl.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bcs.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/bit_vector.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/error.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/features.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/fixed_point32.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/hash.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/mem.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/option.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/signer.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/string.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/dependencies/MoveStdlib/vector.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/deploy_hook.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/entity_key.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/events.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/init.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/source_maps/world.mvsm +0 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/counter_schema.move +59 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/counter_system.move +11 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/account.move +1604 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator.move +48 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator_factory.move +83 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aggregator_v2.move +473 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_account.move +480 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_coin.move +204 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/aptos_governance.move +1390 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/block.move +349 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/chain_id.move +41 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/chain_status.move +48 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/code.move +367 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/coin.move +2014 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/config_buffer.move +101 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/consensus_config.move +77 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/create_signer.move +21 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/delegation_pool.move +5568 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/dispatchable_fungible_asset.move +228 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/dkg.move +121 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/event.move +92 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/execution_config.move +66 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/function_info.move +100 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/fungible_asset.move +1673 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/gas_schedule.move +176 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/genesis.move +549 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/governance_proposal.move +23 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/guid.move +68 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/jwk_consensus_config.move +148 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/jwks.move +889 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/keyless_account.move +312 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/managed_coin.move +267 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/multisig_account.move +2594 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/object.move +1095 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/object_code_deployment.move +147 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/optional_aggregator.move +286 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/primary_fungible_store.move +405 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness.move +574 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_api_v0_config.move +57 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_config.move +153 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/randomness_config_seqnum.move +49 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration.move +222 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration_state.move +132 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/reconfiguration_with_dkg.move +69 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/resource_account.move +267 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/stake.move +3185 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_config.move +686 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_contract.move +1627 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/staking_proxy.move +228 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/state_storage.move +90 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/storage_gas.move +622 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/system_addresses.move +82 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/timestamp.move +88 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_context.move +262 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_fee.move +170 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/transaction_validation.move +486 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/util.move +16 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/validator_consensus_info.move +42 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/version.move +115 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/vesting.move +2192 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosFramework/voting.move +1282 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/any.move +57 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/aptos_hash.move +253 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/big_vector.move +469 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bls12381.move +985 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bls12381_algebra.move +802 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/bn254_algebra.move +855 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/capability.move +193 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/comparator.move +173 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/copyable_any.move +45 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/crypto_algebra.move +351 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/debug.move +278 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ed25519.move +262 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/fixed_point64.move +447 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/from_bcs.move +91 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math128.move +381 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math64.move +336 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math_fixed.move +139 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/math_fixed64.move +142 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/multi_ed25519.move +482 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/pool_u64.move +571 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/pool_u64_unbound.move +270 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255.move +1310 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_bulletproofs.move +253 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_elgamal.move +234 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/ristretto255_pedersen.move +158 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/secp256k1.move +114 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/simple_map.move +319 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/smart_table.move +769 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/smart_vector.move +766 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/string_utils.move +148 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/table.move +152 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/table_with_length.move +141 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/AptosStdlib/type_info.move +351 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/acl.move +46 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bcs.move +46 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/bit_vector.move +239 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/error.move +88 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/features.move +784 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/fixed_point32.move +295 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/hash.move +8 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/mem.move +34 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/option.move +356 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/signer.move +21 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/string.move +93 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/dependencies/MoveStdlib/vector.move +691 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/deploy_hook.move +19 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/entity_key.move +31 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/events.move +34 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/init.move +17 -0
- package/template/101/movement-template/contracts/counter/build/counter/sources/world.move +65 -0
- package/template/101/movement-template/contracts/counter/sources/codegen/eps/events.move +34 -0
- package/template/101/movement-template/contracts/counter/sources/codegen/eps/world.move +65 -0
- package/template/101/movement-template/contracts/counter/sources/codegen/init.move +17 -0
- package/template/101/movement-template/contracts/counter/sources/codegen/schemas/counter.move +59 -0
- package/template/101/movement-template/contracts/counter/sources/entity_key.move +31 -0
- package/template/101/movement-template/contracts/counter/sources/script/deploy_hook.move +19 -0
- package/template/101/movement-template/contracts/counter/sources/system/counter_system.move +11 -0
- package/template/101/movement-template/dubhe.config.ts +13 -0
- package/template/101/movement-template/jest.config.ts +17 -0
- package/template/101/movement-template/next-env.d.ts +5 -0
- package/template/101/movement-template/next-i18next.config.js +6 -0
- package/template/101/movement-template/next.config.js +15 -0
- package/template/101/movement-template/package.json +74 -0
- package/template/101/movement-template/pnpm-lock.yaml +6737 -0
- package/template/101/movement-template/postcss.config.js +6 -0
- package/template/101/movement-template/public/discord.svg +9 -0
- package/template/101/movement-template/public/fail.svg +12 -0
- package/template/101/movement-template/public/favicon.ico +0 -0
- package/template/101/movement-template/public/locales/de/common.json +8 -0
- package/template/101/movement-template/public/locales/de/footer.json +3 -0
- package/template/101/movement-template/public/locales/de/second-page.json +5 -0
- package/template/101/movement-template/public/locales/en/common.json +8 -0
- package/template/101/movement-template/public/locales/en/footer.json +3 -0
- package/template/101/movement-template/public/locales/en/second-page.json +5 -0
- package/template/101/movement-template/public/locales/zn/common.json +8 -0
- package/template/101/movement-template/public/locales/zn/footer.json +3 -0
- package/template/101/movement-template/public/locales/zn/second-page.json +5 -0
- package/template/101/movement-template/public/logo.svg +1 -0
- package/template/101/movement-template/public/medium.svg +9 -0
- package/template/101/movement-template/public/successful.svg +11 -0
- package/template/101/movement-template/public/telegram.svg +9 -0
- package/template/101/movement-template/public/twitter.svg +9 -0
- package/template/101/movement-template/scripts/checkBalance.ts +37 -0
- package/template/101/movement-template/scripts/generateAccount.ts +54 -0
- package/template/101/movement-template/scripts/storeConfig.ts +54 -0
- package/template/101/movement-template/src/chain/config.ts +7 -0
- package/template/101/movement-template/src/css/font-awesome.css +2337 -0
- package/template/101/movement-template/src/css/font-awesome.min.css +4 -0
- package/template/101/movement-template/src/fonts/FontAwesome.otf +0 -0
- package/template/101/movement-template/src/fonts/fontawesome-webfont.eot +0 -0
- package/template/101/movement-template/src/fonts/fontawesome-webfont.svg +2671 -0
- package/template/101/movement-template/src/fonts/fontawesome-webfont.ttf +0 -0
- package/template/101/movement-template/src/fonts/fontawesome-webfont.woff +0 -0
- package/template/101/movement-template/src/fonts/fontawesome-webfont.woff2 +0 -0
- package/template/101/movement-template/src/jotai/index.tsx +12 -0
- package/template/101/movement-template/src/pages/_app.tsx +15 -0
- package/template/101/movement-template/src/pages/home/index.tsx +93 -0
- package/template/101/movement-template/src/pages/index.tsx +12 -0
- package/template/101/movement-template/tailwind.config.js +56 -0
- package/template/101/movement-template/tsconfig.json +25 -0
- package/template/101/rooch-template/package.json +3 -3
- package/template/101/sui-template/contracts/counter/Move.toml +4 -5
- package/template/{nextjs/sui-template/contracts/counter/sources/script → 101/sui-template/contracts/counter/sources/scripts}/deploy_hook.move +13 -2
- package/template/{nextjs/sui-template/contracts/counter/sources/script → 101/sui-template/contracts/counter/sources/scripts}/migrate.move +1 -0
- package/template/101/sui-template/contracts/dubhe-framework/Move.toml +13 -0
- package/template/{nextjs/sui-template/localnet → 101/sui-template/contracts}/dubhe-framework/sources/core/dapps/schema.move +31 -1
- package/template/{nextjs/sui-template/localnet → 101/sui-template/contracts}/dubhe-framework/sources/core/dapps/system.move +28 -2
- package/template/{contract/sui-template/localnet → 101/sui-template/contracts}/dubhe-framework/sources/core/dapps/tests.move +16 -2
- package/template/101/sui-template/package.json +11 -10
- package/template/101/sui-template/src/chain/config.ts +2 -2
- package/template/cocos/sui-template/package.json +4 -4
- package/template/contract/sui-template/contracts/counter/Move.toml +4 -5
- package/template/{101/sui-template/contracts/counter/sources/script → contract/sui-template/contracts/counter/sources/scripts}/deploy_hook.move +20 -9
- package/template/contract/sui-template/contracts/dubhe-framework/Move.toml +13 -0
- package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/schema.move +31 -1
- package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/system.move +28 -2
- package/template/{101/sui-template/localnet → contract/sui-template/contracts}/dubhe-framework/sources/core/dapps/tests.move +16 -2
- package/template/contract/sui-template/package.json +9 -7
- package/template/nextjs/sui-template/contracts/counter/Move.toml +4 -5
- package/template/{contract/sui-template/contracts/counter/sources/script → nextjs/sui-template/contracts/counter/sources/scripts}/deploy_hook.move +20 -9
- package/template/nextjs/sui-template/contracts/dubhe-framework/Move.toml +13 -0
- package/template/{101/sui-template/localnet → nextjs/sui-template/contracts}/dubhe-framework/sources/core/dapps/schema.move +31 -1
- package/template/{101/sui-template/localnet → nextjs/sui-template/contracts}/dubhe-framework/sources/core/dapps/system.move +28 -2
- package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/tests.move +16 -2
- package/template/nextjs/sui-template/package.json +10 -9
- package/template/nextjs/sui-template/src/chain/config.ts +3 -3
- package/template/101/aptos-template/scripts/formatAccount.ts +0 -35
- package/template/101/sui-template/localnet/dubhe-framework/Move.toml +0 -29
- package/template/101/sui-template/scripts/deployment/common.ts +0 -60
- package/template/101/sui-template/scripts/deployment/localnet/deploy.ts +0 -42
- package/template/101/sui-template/scripts/deployment/testnet/deploy.ts +0 -48
- package/template/101/sui-template/scripts/deployment/types.ts +0 -13
- package/template/101/sui-template/scripts/framework/common.ts +0 -17
- package/template/101/sui-template/scripts/framework/deploy.ts +0 -199
- package/template/101/sui-template/scripts/framework/parse-history.ts +0 -76
- package/template/101/sui-template/scripts/framework/types.ts +0 -8
- package/template/contract/sui-template/localnet/dubhe-framework/Move.toml +0 -29
- package/template/contract/sui-template/scripts/deployment/common.ts +0 -45
- package/template/contract/sui-template/scripts/deployment/localnet/deploy.ts +0 -42
- package/template/contract/sui-template/scripts/deployment/testnet/deploy.ts +0 -48
- package/template/contract/sui-template/scripts/deployment/types.ts +0 -13
- package/template/contract/sui-template/scripts/framework/common.ts +0 -17
- package/template/contract/sui-template/scripts/framework/deploy.ts +0 -199
- package/template/contract/sui-template/scripts/framework/parse-history.ts +0 -76
- package/template/contract/sui-template/scripts/framework/types.ts +0 -8
- package/template/nextjs/sui-template/localnet/dubhe-framework/Move.toml +0 -29
- package/template/nextjs/sui-template/scripts/deployment/common.ts +0 -60
- package/template/nextjs/sui-template/scripts/deployment/localnet/deploy.ts +0 -42
- package/template/nextjs/sui-template/scripts/deployment/testnet/deploy.ts +0 -48
- package/template/nextjs/sui-template/scripts/deployment/types.ts +0 -13
- package/template/nextjs/sui-template/scripts/framework/common.ts +0 -17
- package/template/nextjs/sui-template/scripts/framework/deploy.ts +0 -199
- package/template/nextjs/sui-template/scripts/framework/parse-history.ts +0 -76
- package/template/nextjs/sui-template/scripts/framework/types.ts +0 -8
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/metadata.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/schema.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/system.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/tests.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/frames/utils/type_info.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/double_map.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/map.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/migrate.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/tests.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/value.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/tests/init.move +0 -0
- /package/template/101/sui-template/{localnet → contracts}/dubhe-framework/tests/obelisk_framework_tests.move +0 -0
- /package/template/{101/sui-template/contracts/counter/sources/script → contract/sui-template/contracts/counter/sources/scripts}/migrate.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/metadata.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/schema.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/system.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/tests.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/frames/utils/type_info.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/double_map.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/map.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/migrate.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/tests.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/value.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/tests/init.move +0 -0
- /package/template/contract/sui-template/{localnet → contracts}/dubhe-framework/tests/obelisk_framework_tests.move +0 -0
- /package/template/{contract/sui-template/contracts/counter/sources/script → nextjs/sui-template/contracts/counter/sources/scripts}/migrate.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/core/dapps/metadata.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/schema.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/system.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/core/root/tests.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/frames/utils/type_info.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/double_map.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/map.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/migrate.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/tests.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/sources/storages/value.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/tests/init.move +0 -0
- /package/template/nextjs/sui-template/{localnet → contracts}/dubhe-framework/tests/obelisk_framework_tests.move +0 -0
|
@@ -0,0 +1,2555 @@
|
|
|
1
|
+
module initia_std::staking {
|
|
2
|
+
use std::string::String;
|
|
3
|
+
use std::signer;
|
|
4
|
+
use std::error;
|
|
5
|
+
use std::vector;
|
|
6
|
+
use std::option::{Self, Option};
|
|
7
|
+
|
|
8
|
+
use initia_std::account::create_signer;
|
|
9
|
+
use initia_std::block;
|
|
10
|
+
use initia_std::cosmos;
|
|
11
|
+
use initia_std::event;
|
|
12
|
+
use initia_std::primary_fungible_store;
|
|
13
|
+
use initia_std::object::{Self, Object, ExtendRef};
|
|
14
|
+
use initia_std::fungible_asset::{Self, Metadata, FungibleStore, FungibleAsset};
|
|
15
|
+
use initia_std::table::{Self, Table};
|
|
16
|
+
use initia_std::bigdecimal::{Self, BigDecimal};
|
|
17
|
+
use initia_std::coin;
|
|
18
|
+
use initia_std::string;
|
|
19
|
+
|
|
20
|
+
struct ModuleStore has key {
|
|
21
|
+
staking_states: Table<Object<Metadata>, Table<String, StakingState>>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
struct StakingState has store {
|
|
25
|
+
metadata: Object<Metadata>,
|
|
26
|
+
validator: String,
|
|
27
|
+
total_share: BigDecimal,
|
|
28
|
+
unbonding_share: BigDecimal,
|
|
29
|
+
reward_index: BigDecimal,
|
|
30
|
+
reward_coin_store_ref: ExtendRef,
|
|
31
|
+
unbonding_coin_store_ref: ExtendRef,
|
|
32
|
+
reward_coin_store: Object<FungibleStore>,
|
|
33
|
+
unbonding_coin_store: Object<FungibleStore>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Define a delegation entry which can be transferred.
|
|
37
|
+
struct Delegation has store {
|
|
38
|
+
metadata: Object<Metadata>,
|
|
39
|
+
validator: String,
|
|
40
|
+
share: BigDecimal,
|
|
41
|
+
reward_index: BigDecimal
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// Define a unbonding entry which can be transferred.
|
|
45
|
+
struct Unbonding has store {
|
|
46
|
+
metadata: Object<Metadata>,
|
|
47
|
+
validator: String,
|
|
48
|
+
unbonding_share: BigDecimal,
|
|
49
|
+
release_time: u64
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// A holder of delegations and unbonding delegations.
|
|
53
|
+
/// These are kept in a single resource to ensure locality of data.
|
|
54
|
+
struct DelegationStore has key {
|
|
55
|
+
// key: metadata + validator
|
|
56
|
+
delegations: Table<Object<Metadata>, Table<String, Delegation>>,
|
|
57
|
+
// key: metadata + validator + release_times
|
|
58
|
+
unbondings: Table<Object<Metadata>, Table<UnbondingKey, Unbonding>>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Keys
|
|
62
|
+
|
|
63
|
+
/// Key for `Unbonding`
|
|
64
|
+
struct UnbondingKey has copy, drop {
|
|
65
|
+
validator: String,
|
|
66
|
+
release_time: u64
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Events
|
|
70
|
+
|
|
71
|
+
#[event]
|
|
72
|
+
/// Event emitted when some amount of reward is claimed by entry function.
|
|
73
|
+
struct RewardEvent has drop, store {
|
|
74
|
+
account: address,
|
|
75
|
+
metadata: Object<Metadata>,
|
|
76
|
+
amount: u64
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#[event]
|
|
80
|
+
/// Event emitted when a Delegation is deposited to an account.
|
|
81
|
+
struct DelegationDepositEvent has drop, store {
|
|
82
|
+
account: address,
|
|
83
|
+
metadata: Object<Metadata>,
|
|
84
|
+
validator: String,
|
|
85
|
+
share: BigDecimal
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#[event]
|
|
89
|
+
/// Event emitted when a Delegation is withdrawn from an account.
|
|
90
|
+
struct DelegationWithdrawEvent has drop, store {
|
|
91
|
+
account: address,
|
|
92
|
+
metadata: Object<Metadata>,
|
|
93
|
+
validator: String,
|
|
94
|
+
share: BigDecimal
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#[event]
|
|
98
|
+
/// Event emitted when a Unbonding is deposited from an account.
|
|
99
|
+
struct UnbondingDepositEvent has drop, store {
|
|
100
|
+
account: address,
|
|
101
|
+
metadata: Object<Metadata>,
|
|
102
|
+
validator: String,
|
|
103
|
+
share: BigDecimal,
|
|
104
|
+
release_time: u64
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#[event]
|
|
108
|
+
/// Event emitted when a Unbonding is withdrawn from an account.
|
|
109
|
+
struct UnbondingWithdrawEvent has drop, store {
|
|
110
|
+
account: address,
|
|
111
|
+
metadata: Object<Metadata>,
|
|
112
|
+
validator: String,
|
|
113
|
+
share: BigDecimal,
|
|
114
|
+
release_time: u64
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Query responses
|
|
118
|
+
|
|
119
|
+
struct DelegationResponse has drop {
|
|
120
|
+
metadata: Object<Metadata>,
|
|
121
|
+
validator: String,
|
|
122
|
+
share: BigDecimal,
|
|
123
|
+
unclaimed_reward: u64
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
struct UnbondingResponse has drop {
|
|
127
|
+
metadata: Object<Metadata>,
|
|
128
|
+
validator: String,
|
|
129
|
+
unbonding_amount: u64,
|
|
130
|
+
release_time: u64
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Errors
|
|
134
|
+
|
|
135
|
+
/// triggered when delegation store is already exists.
|
|
136
|
+
const EDELEGATION_STORE_ALREADY_EXISTS: u64 = 1;
|
|
137
|
+
|
|
138
|
+
/// triggered when delegation store is not exists.
|
|
139
|
+
const EDELEGATION_STORE_NOT_EXISTS: u64 = 2;
|
|
140
|
+
|
|
141
|
+
/// triggered when the chain operations are triggered by others.
|
|
142
|
+
const EUNAUTHORIZED_CHAIN_OPERATION: u64 = 3;
|
|
143
|
+
|
|
144
|
+
//// triggered when a staking state is not exists.
|
|
145
|
+
const ESTAKING_STATE_NOT_EXISTS: u64 = 4;
|
|
146
|
+
|
|
147
|
+
/// triggered when the given arguments have different metadata.
|
|
148
|
+
const EMETADATA_MISMATCH: u64 = 5;
|
|
149
|
+
|
|
150
|
+
/// triggered when a total share is smaller than a withdrawing share.
|
|
151
|
+
const EINSUFFICIENT_UNBONDING_DELEGATION_TOTAL_SHARE: u64 = 6;
|
|
152
|
+
|
|
153
|
+
/// triggered when a non-empty delegation or unbonding is passed to destroy.
|
|
154
|
+
const ENOT_EMPTY: u64 = 7;
|
|
155
|
+
|
|
156
|
+
/// Validator of delegation which is used as operand doesn't match the other operand one
|
|
157
|
+
const EVALIDATOR_MISMATCH: u64 = 8;
|
|
158
|
+
|
|
159
|
+
/// `release_time` of the `source_unbonding` must be sooner than or equal to the one of `dst_unbonding`
|
|
160
|
+
const ERELEASE_TIME: u64 = 9;
|
|
161
|
+
|
|
162
|
+
/// Can not claim before `release_time`
|
|
163
|
+
const ENOT_RELEASED: u64 = 10;
|
|
164
|
+
|
|
165
|
+
/// Insufficient amount or share
|
|
166
|
+
const EINSUFFICIENT_AMOUNT: u64 = 11;
|
|
167
|
+
|
|
168
|
+
/// Can not find unbonding
|
|
169
|
+
const EUNBONDING_NOT_FOUND: u64 = 12;
|
|
170
|
+
|
|
171
|
+
/// Can not find delegation
|
|
172
|
+
const EDELEGATION_NOT_FOUND: u64 = 13;
|
|
173
|
+
|
|
174
|
+
/// Both `start_after_validator` and `start_after_release_time` either given or not given.
|
|
175
|
+
const EINVALID_START_AFTER: u64 = 14;
|
|
176
|
+
|
|
177
|
+
/// Length of validators and amounts mismatch.
|
|
178
|
+
const ELENGTH_MISMATCH: u64 = 15;
|
|
179
|
+
|
|
180
|
+
/// Chain already has `StakingState` for the given metadata
|
|
181
|
+
const ESTAKING_STATE_ALREADY_EXISTS: u64 = 16;
|
|
182
|
+
|
|
183
|
+
/// Invalid slash fraction
|
|
184
|
+
const EINVALID_SLASH_FRACTION: u64 = 17;
|
|
185
|
+
|
|
186
|
+
// Constants
|
|
187
|
+
|
|
188
|
+
/// Max number of view function response items.
|
|
189
|
+
const MAX_LIMIT: u8 = 30;
|
|
190
|
+
|
|
191
|
+
/// `uinit` token symbol bytes
|
|
192
|
+
const REWARD_SYMBOL: vector<u8> = b"uinit";
|
|
193
|
+
|
|
194
|
+
public fun reward_metadata(): Object<Metadata> {
|
|
195
|
+
coin::metadata(@initia_std, string::utf8(REWARD_SYMBOL))
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Module initialization
|
|
199
|
+
|
|
200
|
+
fun init_module(chain: &signer) {
|
|
201
|
+
move_to(
|
|
202
|
+
chain,
|
|
203
|
+
ModuleStore { staking_states: table::new() }
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Helper functions
|
|
208
|
+
|
|
209
|
+
fun load_staking_state(
|
|
210
|
+
staking_states: &Table<Object<Metadata>, Table<String, StakingState>>,
|
|
211
|
+
metadata: Object<Metadata>,
|
|
212
|
+
validator: String
|
|
213
|
+
): &StakingState {
|
|
214
|
+
assert!(
|
|
215
|
+
table::contains(staking_states, metadata),
|
|
216
|
+
error::not_found(ESTAKING_STATE_NOT_EXISTS)
|
|
217
|
+
);
|
|
218
|
+
let states = table::borrow(staking_states, metadata);
|
|
219
|
+
|
|
220
|
+
assert!(
|
|
221
|
+
table::contains(states, validator),
|
|
222
|
+
error::not_found(ESTAKING_STATE_NOT_EXISTS)
|
|
223
|
+
);
|
|
224
|
+
table::borrow(states, validator)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
fun load_staking_state_mut(
|
|
228
|
+
staking_states: &mut Table<Object<Metadata>, Table<String, StakingState>>,
|
|
229
|
+
metadata: Object<Metadata>,
|
|
230
|
+
validator: String
|
|
231
|
+
): &mut StakingState {
|
|
232
|
+
assert!(
|
|
233
|
+
table::contains(staking_states, metadata),
|
|
234
|
+
error::not_found(ESTAKING_STATE_NOT_EXISTS)
|
|
235
|
+
);
|
|
236
|
+
let states = table::borrow_mut(staking_states, metadata);
|
|
237
|
+
|
|
238
|
+
assert!(
|
|
239
|
+
table::contains(states, validator),
|
|
240
|
+
error::not_found(ESTAKING_STATE_NOT_EXISTS)
|
|
241
|
+
);
|
|
242
|
+
table::borrow_mut(states, validator)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
fun load_delegation(
|
|
246
|
+
delegations: &Table<Object<Metadata>, Table<String, Delegation>>,
|
|
247
|
+
metadata: Object<Metadata>,
|
|
248
|
+
validator: String
|
|
249
|
+
): &Delegation {
|
|
250
|
+
assert!(
|
|
251
|
+
table::contains(delegations, metadata),
|
|
252
|
+
error::not_found(EDELEGATION_NOT_FOUND)
|
|
253
|
+
);
|
|
254
|
+
let delegations = table::borrow(delegations, metadata);
|
|
255
|
+
|
|
256
|
+
assert!(
|
|
257
|
+
table::contains(delegations, validator),
|
|
258
|
+
error::not_found(EDELEGATION_NOT_FOUND)
|
|
259
|
+
);
|
|
260
|
+
table::borrow(delegations, validator)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
fun load_delegation_mut(
|
|
264
|
+
delegations: &mut Table<Object<Metadata>, Table<String, Delegation>>,
|
|
265
|
+
metadata: Object<Metadata>,
|
|
266
|
+
validator: String
|
|
267
|
+
): &mut Delegation {
|
|
268
|
+
assert!(
|
|
269
|
+
table::contains(delegations, metadata),
|
|
270
|
+
error::not_found(EDELEGATION_NOT_FOUND)
|
|
271
|
+
);
|
|
272
|
+
let delegations = table::borrow_mut(delegations, metadata);
|
|
273
|
+
|
|
274
|
+
assert!(
|
|
275
|
+
table::contains(delegations, validator),
|
|
276
|
+
error::not_found(EDELEGATION_NOT_FOUND)
|
|
277
|
+
);
|
|
278
|
+
table::borrow_mut(delegations, validator)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
fun load_unbonding(
|
|
282
|
+
unbondings: &Table<Object<Metadata>, Table<UnbondingKey, Unbonding>>,
|
|
283
|
+
metadata: Object<Metadata>,
|
|
284
|
+
validator: String,
|
|
285
|
+
release_time: u64
|
|
286
|
+
): &Unbonding {
|
|
287
|
+
assert!(
|
|
288
|
+
table::contains(unbondings, metadata),
|
|
289
|
+
error::not_found(EUNBONDING_NOT_FOUND)
|
|
290
|
+
);
|
|
291
|
+
let unbondings = table::borrow(unbondings, metadata);
|
|
292
|
+
|
|
293
|
+
let key = UnbondingKey { validator, release_time };
|
|
294
|
+
assert!(
|
|
295
|
+
table::contains(unbondings, key),
|
|
296
|
+
error::not_found(EUNBONDING_NOT_FOUND)
|
|
297
|
+
);
|
|
298
|
+
table::borrow(unbondings, key)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
fun load_unbonding_mut(
|
|
302
|
+
unbondings: &mut Table<Object<Metadata>, Table<UnbondingKey, Unbonding>>,
|
|
303
|
+
metadata: Object<Metadata>,
|
|
304
|
+
validator: String,
|
|
305
|
+
release_time: u64
|
|
306
|
+
): &mut Unbonding {
|
|
307
|
+
assert!(
|
|
308
|
+
table::contains(unbondings, metadata),
|
|
309
|
+
error::not_found(EUNBONDING_NOT_FOUND)
|
|
310
|
+
);
|
|
311
|
+
let unbondings = table::borrow_mut(unbondings, metadata);
|
|
312
|
+
|
|
313
|
+
let key = UnbondingKey { validator, release_time };
|
|
314
|
+
assert!(
|
|
315
|
+
table::contains(unbondings, key),
|
|
316
|
+
error::not_found(EUNBONDING_NOT_FOUND)
|
|
317
|
+
);
|
|
318
|
+
table::borrow_mut(unbondings, key)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// View functions
|
|
322
|
+
|
|
323
|
+
/// util function to convert Delegation => DelegationResponse for third party queriers
|
|
324
|
+
public fun get_delegation_response_from_delegation(
|
|
325
|
+
delegation: &Delegation
|
|
326
|
+
): DelegationResponse acquires ModuleStore {
|
|
327
|
+
let metadata = delegation.metadata;
|
|
328
|
+
let validator = delegation.validator;
|
|
329
|
+
|
|
330
|
+
let module_store = borrow_global<ModuleStore>(@initia_std);
|
|
331
|
+
let state = load_staking_state(
|
|
332
|
+
&module_store.staking_states,
|
|
333
|
+
metadata,
|
|
334
|
+
validator
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
let reward = calculate_reward(delegation, state);
|
|
338
|
+
|
|
339
|
+
DelegationResponse {
|
|
340
|
+
metadata: delegation.metadata,
|
|
341
|
+
validator: delegation.validator,
|
|
342
|
+
share: delegation.share,
|
|
343
|
+
unclaimed_reward: reward
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/// util function to convert Unbonding => UnbondingResponse for third party queriers
|
|
348
|
+
public fun get_unbonding_response_from_unbonding(
|
|
349
|
+
unbonding: &Unbonding
|
|
350
|
+
): UnbondingResponse acquires ModuleStore {
|
|
351
|
+
let unbonding_amount = get_unbonding_amount_from_unbonding(unbonding);
|
|
352
|
+
|
|
353
|
+
UnbondingResponse {
|
|
354
|
+
metadata: unbonding.metadata,
|
|
355
|
+
validator: unbonding.validator,
|
|
356
|
+
unbonding_amount,
|
|
357
|
+
release_time: unbonding.release_time
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
#[view]
|
|
362
|
+
/// Get delegation info of specified addr and validator
|
|
363
|
+
public fun get_delegation(
|
|
364
|
+
addr: address, metadata: Object<Metadata>, validator: String
|
|
365
|
+
): DelegationResponse acquires DelegationStore, ModuleStore {
|
|
366
|
+
assert!(
|
|
367
|
+
is_account_registered(addr),
|
|
368
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
let delegation_store = borrow_global<DelegationStore>(addr);
|
|
372
|
+
let delegation =
|
|
373
|
+
load_delegation(
|
|
374
|
+
&delegation_store.delegations,
|
|
375
|
+
metadata,
|
|
376
|
+
validator
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
let module_store = borrow_global<ModuleStore>(@initia_std);
|
|
380
|
+
let state = load_staking_state(
|
|
381
|
+
&module_store.staking_states,
|
|
382
|
+
metadata,
|
|
383
|
+
validator
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
let reward = calculate_reward(delegation, state);
|
|
387
|
+
|
|
388
|
+
DelegationResponse {
|
|
389
|
+
metadata,
|
|
390
|
+
validator,
|
|
391
|
+
share: delegation.share,
|
|
392
|
+
unclaimed_reward: reward
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
#[view]
|
|
397
|
+
/// Get all delegation info of an addr
|
|
398
|
+
public fun get_delegations(
|
|
399
|
+
addr: address,
|
|
400
|
+
metadata: Object<Metadata>,
|
|
401
|
+
start_after: Option<String>,
|
|
402
|
+
limit: u8
|
|
403
|
+
): vector<DelegationResponse> acquires DelegationStore, ModuleStore {
|
|
404
|
+
if (limit > MAX_LIMIT) {
|
|
405
|
+
limit = MAX_LIMIT;
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
assert!(
|
|
409
|
+
is_account_registered(addr),
|
|
410
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
let module_store = borrow_global<ModuleStore>(@initia_std);
|
|
414
|
+
let staking_states = table::borrow(&module_store.staking_states, metadata);
|
|
415
|
+
|
|
416
|
+
let delegation_store = borrow_global<DelegationStore>(addr);
|
|
417
|
+
let delegations = table::borrow(&delegation_store.delegations, metadata);
|
|
418
|
+
let delegations_iter = table::iter(delegations, option::none(), start_after, 2);
|
|
419
|
+
|
|
420
|
+
let prepare = table::prepare(delegations_iter);
|
|
421
|
+
let res: vector<DelegationResponse> = vector[];
|
|
422
|
+
while (vector::length(&res) < (limit as u64) && prepare) {
|
|
423
|
+
let (validator, delegation) = table::next(delegations_iter);
|
|
424
|
+
let state = table::borrow(staking_states, validator);
|
|
425
|
+
let reward = calculate_reward(delegation, state);
|
|
426
|
+
vector::push_back(
|
|
427
|
+
&mut res,
|
|
428
|
+
DelegationResponse {
|
|
429
|
+
metadata: delegation.metadata,
|
|
430
|
+
validator: delegation.validator,
|
|
431
|
+
share: delegation.share,
|
|
432
|
+
unclaimed_reward: reward
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
prepare = table::prepare(delegations_iter);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
res
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
#[view]
|
|
442
|
+
/// Get unbonding info of (addr, metadata, validator, release time)
|
|
443
|
+
public fun get_unbonding(
|
|
444
|
+
addr: address,
|
|
445
|
+
metadata: Object<Metadata>,
|
|
446
|
+
validator: String,
|
|
447
|
+
release_time: u64
|
|
448
|
+
): UnbondingResponse acquires DelegationStore, ModuleStore {
|
|
449
|
+
assert!(
|
|
450
|
+
is_account_registered(addr),
|
|
451
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
452
|
+
);
|
|
453
|
+
|
|
454
|
+
let delegation_store = borrow_global<DelegationStore>(addr);
|
|
455
|
+
|
|
456
|
+
let unbonding =
|
|
457
|
+
load_unbonding(
|
|
458
|
+
&delegation_store.unbondings,
|
|
459
|
+
metadata,
|
|
460
|
+
validator,
|
|
461
|
+
release_time
|
|
462
|
+
);
|
|
463
|
+
let unbonding_amount = get_unbonding_amount_from_unbonding(unbonding);
|
|
464
|
+
|
|
465
|
+
UnbondingResponse {
|
|
466
|
+
metadata: unbonding.metadata,
|
|
467
|
+
validator: unbonding.validator,
|
|
468
|
+
unbonding_amount,
|
|
469
|
+
release_time
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
#[view]
|
|
474
|
+
/// Get all unbondings of (addr, validator)
|
|
475
|
+
public fun get_unbondings(
|
|
476
|
+
addr: address,
|
|
477
|
+
metadata: Object<Metadata>,
|
|
478
|
+
start_after_validator: Option<String>,
|
|
479
|
+
start_after_release_time: Option<u64>,
|
|
480
|
+
limit: u8
|
|
481
|
+
): vector<UnbondingResponse> acquires DelegationStore, ModuleStore {
|
|
482
|
+
if (limit > MAX_LIMIT) {
|
|
483
|
+
limit = MAX_LIMIT;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
assert!(
|
|
487
|
+
is_account_registered(addr),
|
|
488
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
489
|
+
);
|
|
490
|
+
|
|
491
|
+
assert!(
|
|
492
|
+
option::is_some(&start_after_validator)
|
|
493
|
+
== option::is_some(&start_after_release_time),
|
|
494
|
+
error::invalid_argument(EINVALID_START_AFTER)
|
|
495
|
+
);
|
|
496
|
+
|
|
497
|
+
let delegation_store = borrow_global<DelegationStore>(addr);
|
|
498
|
+
let unbondings = table::borrow(&delegation_store.unbondings, metadata);
|
|
499
|
+
|
|
500
|
+
let start_after =
|
|
501
|
+
if (option::is_some(&start_after_validator)) {
|
|
502
|
+
option::some(
|
|
503
|
+
UnbondingKey {
|
|
504
|
+
validator: *option::borrow(&start_after_validator),
|
|
505
|
+
release_time: *option::borrow(&start_after_release_time)
|
|
506
|
+
}
|
|
507
|
+
)
|
|
508
|
+
} else {
|
|
509
|
+
option::none()
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
let unbondings_iter = table::iter(unbondings, option::none(), start_after, 2);
|
|
513
|
+
|
|
514
|
+
let res: vector<UnbondingResponse> = vector[];
|
|
515
|
+
while (vector::length(&res) < (limit as u64)
|
|
516
|
+
&& table::prepare<UnbondingKey, Unbonding>(unbondings_iter)) {
|
|
517
|
+
let (_, unbonding) = table::next<UnbondingKey, Unbonding>(unbondings_iter);
|
|
518
|
+
let unbonding_amount = get_unbonding_amount_from_unbonding(unbonding);
|
|
519
|
+
vector::push_back(
|
|
520
|
+
&mut res,
|
|
521
|
+
UnbondingResponse {
|
|
522
|
+
metadata: unbonding.metadata,
|
|
523
|
+
validator: unbonding.validator,
|
|
524
|
+
unbonding_amount,
|
|
525
|
+
release_time: unbonding.release_time
|
|
526
|
+
}
|
|
527
|
+
);
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
res
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// Query helpers
|
|
534
|
+
|
|
535
|
+
/// get `metadata` from `DelegationResponse`
|
|
536
|
+
public fun get_metadata_from_delegation_response(
|
|
537
|
+
delegation_res: &DelegationResponse
|
|
538
|
+
): Object<Metadata> {
|
|
539
|
+
delegation_res.metadata
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/// get `validator` from `DelegationResponse`
|
|
543
|
+
public fun get_validator_from_delegation_response(
|
|
544
|
+
delegation_res: &DelegationResponse
|
|
545
|
+
): String {
|
|
546
|
+
delegation_res.validator
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/// get `share` from `DelegationResponse`
|
|
550
|
+
public fun get_share_from_delegation_response(
|
|
551
|
+
delegation_res: &DelegationResponse
|
|
552
|
+
): BigDecimal {
|
|
553
|
+
delegation_res.share
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/// get `unclaimed_reward` from `DelegationResponse`
|
|
557
|
+
public fun get_unclaimed_reward_from_delegation_response(
|
|
558
|
+
delegation_res: &DelegationResponse
|
|
559
|
+
): u64 {
|
|
560
|
+
delegation_res.unclaimed_reward
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/// get `metadata` from `UnbondingResponse`
|
|
564
|
+
public fun get_metadata_from_unbonding_response(
|
|
565
|
+
unbonding_res: &UnbondingResponse
|
|
566
|
+
): Object<Metadata> {
|
|
567
|
+
unbonding_res.metadata
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/// get `validator` from `UnbondingResponse`
|
|
571
|
+
public fun get_validator_from_unbonding_response(
|
|
572
|
+
unbonding_res: &UnbondingResponse
|
|
573
|
+
): String {
|
|
574
|
+
unbonding_res.validator
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/// get `release_time` from `UnbondingResponse`
|
|
578
|
+
public fun get_release_time_from_unbonding_response(
|
|
579
|
+
unbonding_res: &UnbondingResponse
|
|
580
|
+
): u64 {
|
|
581
|
+
unbonding_res.release_time
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/// get `unbonding_amount` from `UnbondingResponse`
|
|
585
|
+
public fun get_unbonding_amount_from_unbonding_response(
|
|
586
|
+
unbonding_res: &UnbondingResponse
|
|
587
|
+
): u64 {
|
|
588
|
+
unbonding_res.unbonding_amount
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// Chain operations
|
|
592
|
+
|
|
593
|
+
/// Check signer is chain
|
|
594
|
+
fun check_chain_permission(chain: &signer) {
|
|
595
|
+
assert!(
|
|
596
|
+
signer::address_of(chain) == @initia_std,
|
|
597
|
+
error::permission_denied(EUNAUTHORIZED_CHAIN_OPERATION)
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/// Initialize, Make staking store
|
|
602
|
+
public entry fun initialize_for_chain(
|
|
603
|
+
chain: &signer, metadata: Object<Metadata>
|
|
604
|
+
) acquires ModuleStore {
|
|
605
|
+
check_chain_permission(chain);
|
|
606
|
+
|
|
607
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
608
|
+
|
|
609
|
+
assert!(
|
|
610
|
+
!table::contains(&module_store.staking_states, metadata),
|
|
611
|
+
error::already_exists(ESTAKING_STATE_ALREADY_EXISTS)
|
|
612
|
+
);
|
|
613
|
+
table::add(
|
|
614
|
+
&mut module_store.staking_states,
|
|
615
|
+
metadata,
|
|
616
|
+
table::new()
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/// Slash unbonding coin
|
|
621
|
+
public entry fun slash_unbonding_for_chain(
|
|
622
|
+
chain: &signer,
|
|
623
|
+
metadata: Object<Metadata>,
|
|
624
|
+
validator: String,
|
|
625
|
+
fraction: BigDecimal
|
|
626
|
+
) acquires ModuleStore {
|
|
627
|
+
assert!(
|
|
628
|
+
bigdecimal::le(fraction, bigdecimal::one()),
|
|
629
|
+
error::invalid_argument(EINVALID_SLASH_FRACTION)
|
|
630
|
+
);
|
|
631
|
+
|
|
632
|
+
check_chain_permission(chain);
|
|
633
|
+
|
|
634
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
635
|
+
let state =
|
|
636
|
+
load_staking_state_mut(
|
|
637
|
+
&mut module_store.staking_states,
|
|
638
|
+
metadata,
|
|
639
|
+
validator
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
let unbonding_amount = fungible_asset::balance(state.unbonding_coin_store);
|
|
643
|
+
let slash_amount = bigdecimal::mul_by_u64_truncate(fraction, unbonding_amount);
|
|
644
|
+
|
|
645
|
+
if (slash_amount > 0) {
|
|
646
|
+
let unbonding_coin_store_signer =
|
|
647
|
+
&object::generate_signer_for_extending(&state.unbonding_coin_store_ref);
|
|
648
|
+
let slash_coin =
|
|
649
|
+
fungible_asset::withdraw(
|
|
650
|
+
unbonding_coin_store_signer,
|
|
651
|
+
state.unbonding_coin_store,
|
|
652
|
+
slash_amount
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
// deposit to relayer for fund community pool
|
|
656
|
+
// relayer is module address, so we need to use sudo_deposit
|
|
657
|
+
coin::sudo_deposit(@relayer, slash_coin);
|
|
658
|
+
let staking_module = create_signer(@relayer);
|
|
659
|
+
|
|
660
|
+
// fund to community pool
|
|
661
|
+
cosmos::fund_community_pool(&staking_module, metadata, slash_amount);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/// Deposit unbonding coin to global store
|
|
666
|
+
public entry fun deposit_unbonding_coin_for_chain(
|
|
667
|
+
chain: &signer,
|
|
668
|
+
metadata: Object<Metadata>,
|
|
669
|
+
validators: vector<String>,
|
|
670
|
+
amounts: vector<u64>
|
|
671
|
+
) acquires ModuleStore {
|
|
672
|
+
check_chain_permission(chain);
|
|
673
|
+
|
|
674
|
+
assert!(
|
|
675
|
+
vector::length(&validators) == vector::length(&amounts),
|
|
676
|
+
error::invalid_argument(ELENGTH_MISMATCH)
|
|
677
|
+
);
|
|
678
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
679
|
+
let staking_module = create_signer(@relayer);
|
|
680
|
+
|
|
681
|
+
let index = 0;
|
|
682
|
+
while (index < vector::length(&validators)) {
|
|
683
|
+
let validator = *vector::borrow(&validators, index);
|
|
684
|
+
let amount = *vector::borrow(&amounts, index);
|
|
685
|
+
let state =
|
|
686
|
+
load_staking_state_mut(
|
|
687
|
+
&mut module_store.staking_states,
|
|
688
|
+
metadata,
|
|
689
|
+
validator
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
// calculate share
|
|
693
|
+
let total_unbonding_amount =
|
|
694
|
+
fungible_asset::balance(state.unbonding_coin_store);
|
|
695
|
+
let share_amount_ratio =
|
|
696
|
+
if (total_unbonding_amount == 0) {
|
|
697
|
+
bigdecimal::one()
|
|
698
|
+
} else {
|
|
699
|
+
bigdecimal::div_by_u64(
|
|
700
|
+
state.unbonding_share, total_unbonding_amount
|
|
701
|
+
)
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
let share_diff =
|
|
705
|
+
bigdecimal::mul(
|
|
706
|
+
share_amount_ratio, bigdecimal::from_ratio_u64(amount, 1)
|
|
707
|
+
);
|
|
708
|
+
state.unbonding_share = bigdecimal::add(state.unbonding_share, share_diff);
|
|
709
|
+
|
|
710
|
+
let unbonding_coin = coin::withdraw(&staking_module, metadata, amount);
|
|
711
|
+
fungible_asset::deposit(state.unbonding_coin_store, unbonding_coin);
|
|
712
|
+
|
|
713
|
+
index = index + 1;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/// Deposit staking reward, and update `reward_index`
|
|
718
|
+
public entry fun deposit_reward_for_chain(
|
|
719
|
+
chain: &signer,
|
|
720
|
+
metadata: Object<Metadata>,
|
|
721
|
+
validators: vector<String>,
|
|
722
|
+
reward_amounts: vector<u64>
|
|
723
|
+
) acquires ModuleStore {
|
|
724
|
+
check_chain_permission(chain);
|
|
725
|
+
|
|
726
|
+
assert!(
|
|
727
|
+
vector::length(&validators) == vector::length(&reward_amounts),
|
|
728
|
+
error::invalid_argument(ELENGTH_MISMATCH)
|
|
729
|
+
);
|
|
730
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
731
|
+
let staking_module = create_signer(@relayer);
|
|
732
|
+
let reward_metadata = reward_metadata();
|
|
733
|
+
|
|
734
|
+
let index = 0;
|
|
735
|
+
while (index < vector::length(&validators)) {
|
|
736
|
+
let validator = *vector::borrow(&validators, index);
|
|
737
|
+
let reward_amount = *vector::borrow(&reward_amounts, index);
|
|
738
|
+
let reward = coin::withdraw(
|
|
739
|
+
&staking_module,
|
|
740
|
+
reward_metadata,
|
|
741
|
+
reward_amount
|
|
742
|
+
);
|
|
743
|
+
|
|
744
|
+
let state =
|
|
745
|
+
load_staking_state_mut(
|
|
746
|
+
&mut module_store.staking_states,
|
|
747
|
+
metadata,
|
|
748
|
+
validator
|
|
749
|
+
);
|
|
750
|
+
state.reward_index = bigdecimal::add(
|
|
751
|
+
state.reward_index,
|
|
752
|
+
bigdecimal::rev(
|
|
753
|
+
bigdecimal::div_by_u64(state.total_share, reward_amount)
|
|
754
|
+
)
|
|
755
|
+
);
|
|
756
|
+
|
|
757
|
+
fungible_asset::deposit(state.reward_coin_store, reward);
|
|
758
|
+
|
|
759
|
+
index = index + 1;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
// User operations
|
|
764
|
+
|
|
765
|
+
/// Check the DelegationStore is already exist
|
|
766
|
+
public fun is_account_registered(account_addr: address): bool {
|
|
767
|
+
exists<DelegationStore>(account_addr)
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
/// Register an account delegation store
|
|
771
|
+
public entry fun register(account: &signer) {
|
|
772
|
+
let account_addr = signer::address_of(account);
|
|
773
|
+
assert!(
|
|
774
|
+
!is_account_registered(account_addr),
|
|
775
|
+
error::already_exists(EDELEGATION_STORE_ALREADY_EXISTS)
|
|
776
|
+
);
|
|
777
|
+
|
|
778
|
+
let delegation_store = DelegationStore {
|
|
779
|
+
delegations: table::new<Object<Metadata>, Table<String, Delegation>>(),
|
|
780
|
+
unbondings: table::new<Object<Metadata>, Table<UnbondingKey, Unbonding>>()
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
move_to(account, delegation_store);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/// Delegate coin to a validator and deposit reward to signer.
|
|
787
|
+
public entry fun delegate_script(
|
|
788
|
+
account: &signer,
|
|
789
|
+
metadata: Object<Metadata>,
|
|
790
|
+
validator: String,
|
|
791
|
+
amount: u64
|
|
792
|
+
) acquires DelegationStore, ModuleStore {
|
|
793
|
+
let account_addr = signer::address_of(account);
|
|
794
|
+
if (!is_account_registered(account_addr)) {
|
|
795
|
+
register(account);
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
let coin = coin::withdraw(account, metadata, amount);
|
|
799
|
+
let delegation = delegate(validator, coin);
|
|
800
|
+
|
|
801
|
+
let reward = deposit_delegation(account_addr, delegation);
|
|
802
|
+
|
|
803
|
+
event::emit(
|
|
804
|
+
RewardEvent {
|
|
805
|
+
account: account_addr,
|
|
806
|
+
metadata,
|
|
807
|
+
amount: fungible_asset::amount(&reward)
|
|
808
|
+
}
|
|
809
|
+
);
|
|
810
|
+
|
|
811
|
+
coin::deposit(account_addr, reward);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/// Delegate a fa to a validator.
|
|
815
|
+
public fun delegate(validator: String, fa: FungibleAsset): Delegation acquires ModuleStore {
|
|
816
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
817
|
+
let metadata = fungible_asset::asset_metadata(&fa);
|
|
818
|
+
|
|
819
|
+
assert!(
|
|
820
|
+
table::contains(&module_store.staking_states, metadata),
|
|
821
|
+
error::not_found(ESTAKING_STATE_NOT_EXISTS)
|
|
822
|
+
);
|
|
823
|
+
let states = table::borrow_mut(&mut module_store.staking_states, metadata);
|
|
824
|
+
|
|
825
|
+
if (!table::contains(states, validator)) {
|
|
826
|
+
let reward_coin_store_ref = &object::create_object(@initia_std, false);
|
|
827
|
+
let unbonding_coin_store_ref = &object::create_object(@initia_std, false);
|
|
828
|
+
|
|
829
|
+
let reward_coin_store_address =
|
|
830
|
+
object::address_from_constructor_ref(reward_coin_store_ref);
|
|
831
|
+
let reward_coin_store =
|
|
832
|
+
primary_fungible_store::create_primary_store(
|
|
833
|
+
reward_coin_store_address, reward_metadata()
|
|
834
|
+
);
|
|
835
|
+
|
|
836
|
+
let unbonding_coin_store_address =
|
|
837
|
+
object::address_from_constructor_ref(unbonding_coin_store_ref);
|
|
838
|
+
let unbonding_coin_store =
|
|
839
|
+
primary_fungible_store::create_primary_store(
|
|
840
|
+
unbonding_coin_store_address, metadata
|
|
841
|
+
);
|
|
842
|
+
|
|
843
|
+
table::add(
|
|
844
|
+
states,
|
|
845
|
+
validator,
|
|
846
|
+
StakingState {
|
|
847
|
+
metadata,
|
|
848
|
+
validator,
|
|
849
|
+
total_share: bigdecimal::zero(),
|
|
850
|
+
unbonding_share: bigdecimal::zero(),
|
|
851
|
+
reward_index: bigdecimal::zero(),
|
|
852
|
+
reward_coin_store_ref: object::generate_extend_ref(
|
|
853
|
+
reward_coin_store_ref
|
|
854
|
+
),
|
|
855
|
+
unbonding_coin_store_ref: object::generate_extend_ref(
|
|
856
|
+
unbonding_coin_store_ref
|
|
857
|
+
),
|
|
858
|
+
reward_coin_store,
|
|
859
|
+
unbonding_coin_store
|
|
860
|
+
}
|
|
861
|
+
)
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
let share_diff =
|
|
865
|
+
delegate_internal(
|
|
866
|
+
*string::bytes(&validator),
|
|
867
|
+
&metadata,
|
|
868
|
+
fungible_asset::amount(&fa)
|
|
869
|
+
);
|
|
870
|
+
let state =
|
|
871
|
+
load_staking_state_mut(
|
|
872
|
+
&mut module_store.staking_states,
|
|
873
|
+
metadata,
|
|
874
|
+
validator
|
|
875
|
+
);
|
|
876
|
+
state.total_share = bigdecimal::add(state.total_share, share_diff);
|
|
877
|
+
|
|
878
|
+
// deposit to relayer
|
|
879
|
+
// relayer is module address, so we need to use sudo_deposit
|
|
880
|
+
coin::sudo_deposit(@relayer, fa);
|
|
881
|
+
|
|
882
|
+
Delegation {
|
|
883
|
+
metadata,
|
|
884
|
+
validator,
|
|
885
|
+
share: share_diff,
|
|
886
|
+
reward_index: state.reward_index
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/// Undelegate coin from a validator and deposit reward to signer.
|
|
891
|
+
/// unbonding amount can be slightly different with input amount due to round error.
|
|
892
|
+
public entry fun undelegate_script(
|
|
893
|
+
account: &signer,
|
|
894
|
+
metadata: Object<Metadata>,
|
|
895
|
+
validator: String,
|
|
896
|
+
amount: u64
|
|
897
|
+
) acquires DelegationStore, ModuleStore {
|
|
898
|
+
|
|
899
|
+
let account_addr = signer::address_of(account);
|
|
900
|
+
|
|
901
|
+
assert!(
|
|
902
|
+
is_account_registered(account_addr),
|
|
903
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
904
|
+
);
|
|
905
|
+
|
|
906
|
+
let share = amount_to_share(*string::bytes(&validator), &metadata, amount);
|
|
907
|
+
|
|
908
|
+
let delegation = withdraw_delegation(account, metadata, validator, share);
|
|
909
|
+
let (reward, unbonding) = undelegate(delegation);
|
|
910
|
+
|
|
911
|
+
event::emit(
|
|
912
|
+
RewardEvent {
|
|
913
|
+
account: account_addr,
|
|
914
|
+
metadata,
|
|
915
|
+
amount: fungible_asset::amount(&reward)
|
|
916
|
+
}
|
|
917
|
+
);
|
|
918
|
+
|
|
919
|
+
coin::deposit(account_addr, reward);
|
|
920
|
+
deposit_unbonding(account_addr, unbonding);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
public fun undelegate(delegation: Delegation): (FungibleAsset, Unbonding) acquires ModuleStore {
|
|
924
|
+
let share = delegation.share;
|
|
925
|
+
let validator = delegation.validator;
|
|
926
|
+
let metadata = delegation.metadata;
|
|
927
|
+
|
|
928
|
+
let (unbonding_amount, release_time) =
|
|
929
|
+
undelegate_internal(*string::bytes(&validator), &metadata, &share);
|
|
930
|
+
let reward = destroy_delegation_and_extract_reward(delegation);
|
|
931
|
+
|
|
932
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
933
|
+
let state =
|
|
934
|
+
load_staking_state_mut(
|
|
935
|
+
&mut module_store.staking_states,
|
|
936
|
+
metadata,
|
|
937
|
+
validator
|
|
938
|
+
);
|
|
939
|
+
|
|
940
|
+
assert!(
|
|
941
|
+
bigdecimal::ge(state.total_share, share),
|
|
942
|
+
error::invalid_state(EINSUFFICIENT_UNBONDING_DELEGATION_TOTAL_SHARE)
|
|
943
|
+
);
|
|
944
|
+
state.total_share = bigdecimal::sub(state.total_share, share);
|
|
945
|
+
|
|
946
|
+
let unbonding_share =
|
|
947
|
+
unbonding_share_from_amount(metadata, validator, unbonding_amount);
|
|
948
|
+
let unbonding = Unbonding { metadata, validator, unbonding_share, release_time };
|
|
949
|
+
|
|
950
|
+
(reward, unbonding)
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/// Claim `unbonding_coin` from expired unbonding.
|
|
954
|
+
public entry fun claim_unbonding_script(
|
|
955
|
+
account: &signer,
|
|
956
|
+
metadata: Object<Metadata>,
|
|
957
|
+
validator: String,
|
|
958
|
+
release_time: u64
|
|
959
|
+
) acquires DelegationStore, ModuleStore {
|
|
960
|
+
let account_addr = signer::address_of(account);
|
|
961
|
+
|
|
962
|
+
assert!(
|
|
963
|
+
is_account_registered(account_addr),
|
|
964
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
965
|
+
);
|
|
966
|
+
|
|
967
|
+
// withdraw unbonding all
|
|
968
|
+
let unbonding_info = get_unbonding(
|
|
969
|
+
account_addr,
|
|
970
|
+
metadata,
|
|
971
|
+
validator,
|
|
972
|
+
release_time
|
|
973
|
+
);
|
|
974
|
+
let unbonding =
|
|
975
|
+
withdraw_unbonding(
|
|
976
|
+
account,
|
|
977
|
+
metadata,
|
|
978
|
+
validator,
|
|
979
|
+
release_time,
|
|
980
|
+
unbonding_info.unbonding_amount
|
|
981
|
+
);
|
|
982
|
+
let unbonding_coin = claim_unbonding(unbonding);
|
|
983
|
+
coin::deposit(account_addr, unbonding_coin)
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
public entry fun claim_reward_script(
|
|
987
|
+
account: &signer, metadata: Object<Metadata>, validator: String
|
|
988
|
+
) acquires DelegationStore, ModuleStore {
|
|
989
|
+
let account_addr = signer::address_of(account);
|
|
990
|
+
|
|
991
|
+
assert!(
|
|
992
|
+
is_account_registered(account_addr),
|
|
993
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
994
|
+
);
|
|
995
|
+
|
|
996
|
+
let delegation_store = borrow_global_mut<DelegationStore>(account_addr);
|
|
997
|
+
let delegation =
|
|
998
|
+
load_delegation_mut(
|
|
999
|
+
&mut delegation_store.delegations,
|
|
1000
|
+
metadata,
|
|
1001
|
+
validator
|
|
1002
|
+
);
|
|
1003
|
+
let reward = claim_reward(delegation);
|
|
1004
|
+
|
|
1005
|
+
event::emit(
|
|
1006
|
+
RewardEvent {
|
|
1007
|
+
account: account_addr,
|
|
1008
|
+
metadata,
|
|
1009
|
+
amount: fungible_asset::amount(&reward)
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1012
|
+
|
|
1013
|
+
coin::deposit(account_addr, reward);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/// Claim staking reward from the specified validator.
|
|
1017
|
+
public fun claim_reward(delegation: &mut Delegation): FungibleAsset acquires ModuleStore {
|
|
1018
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
1019
|
+
|
|
1020
|
+
let metadata = delegation.metadata;
|
|
1021
|
+
let validator = delegation.validator;
|
|
1022
|
+
let state = load_staking_state(
|
|
1023
|
+
&module_store.staking_states,
|
|
1024
|
+
metadata,
|
|
1025
|
+
validator
|
|
1026
|
+
);
|
|
1027
|
+
|
|
1028
|
+
let reward_amount = calculate_reward(delegation, state);
|
|
1029
|
+
let reward =
|
|
1030
|
+
if (reward_amount == 0) {
|
|
1031
|
+
fungible_asset::zero(reward_metadata())
|
|
1032
|
+
} else {
|
|
1033
|
+
let reward_coin_store_signer =
|
|
1034
|
+
&object::generate_signer_for_extending(
|
|
1035
|
+
&state.reward_coin_store_ref
|
|
1036
|
+
);
|
|
1037
|
+
fungible_asset::withdraw(
|
|
1038
|
+
reward_coin_store_signer,
|
|
1039
|
+
state.reward_coin_store,
|
|
1040
|
+
reward_amount
|
|
1041
|
+
)
|
|
1042
|
+
};
|
|
1043
|
+
|
|
1044
|
+
delegation.reward_index = state.reward_index;
|
|
1045
|
+
|
|
1046
|
+
reward
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/// Calculate unclaimed reward
|
|
1050
|
+
fun calculate_reward(delegation: &Delegation, state: &StakingState): u64 {
|
|
1051
|
+
assert!(
|
|
1052
|
+
delegation.metadata == state.metadata,
|
|
1053
|
+
error::invalid_argument(EMETADATA_MISMATCH)
|
|
1054
|
+
);
|
|
1055
|
+
|
|
1056
|
+
let index_diff = bigdecimal::sub(state.reward_index, delegation.reward_index);
|
|
1057
|
+
bigdecimal::truncate_u64(bigdecimal::mul(index_diff, delegation.share))
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/// For delegation object
|
|
1061
|
+
|
|
1062
|
+
/// return empty delegation resource
|
|
1063
|
+
public fun empty_delegation(
|
|
1064
|
+
metadata: Object<Metadata>, validator: String
|
|
1065
|
+
): Delegation {
|
|
1066
|
+
Delegation {
|
|
1067
|
+
metadata,
|
|
1068
|
+
validator,
|
|
1069
|
+
share: bigdecimal::zero(),
|
|
1070
|
+
reward_index: bigdecimal::zero()
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/// Get `metadata` from `Delegation`
|
|
1075
|
+
public fun get_metadata_from_delegation(delegation: &Delegation): Object<Metadata> {
|
|
1076
|
+
delegation.metadata
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/// Get `validator` from `Delegation`
|
|
1080
|
+
public fun get_validator_from_delegation(delegation: &Delegation): String {
|
|
1081
|
+
delegation.validator
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/// Get `share` from `Delegation`
|
|
1085
|
+
public fun get_share_from_delegation(delegation: &Delegation): BigDecimal {
|
|
1086
|
+
delegation.share
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/// Destroy empty delegation
|
|
1090
|
+
public fun destroy_empty_delegation(delegation: Delegation) {
|
|
1091
|
+
assert!(
|
|
1092
|
+
bigdecimal::is_zero(delegation.share),
|
|
1093
|
+
error::invalid_argument(ENOT_EMPTY)
|
|
1094
|
+
);
|
|
1095
|
+
let Delegation { metadata: _, validator: _, share: _, reward_index: _ } =
|
|
1096
|
+
delegation;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/// Deposit the delegation into recipient's account.
|
|
1100
|
+
public fun deposit_delegation(
|
|
1101
|
+
account_addr: address, delegation: Delegation
|
|
1102
|
+
): FungibleAsset acquires DelegationStore, ModuleStore {
|
|
1103
|
+
assert!(
|
|
1104
|
+
is_account_registered(account_addr),
|
|
1105
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
1106
|
+
);
|
|
1107
|
+
|
|
1108
|
+
let metadata = delegation.metadata;
|
|
1109
|
+
let validator = delegation.validator;
|
|
1110
|
+
|
|
1111
|
+
let delegation_store = borrow_global_mut<DelegationStore>(account_addr);
|
|
1112
|
+
if (!table::contains(&delegation_store.delegations, metadata)) {
|
|
1113
|
+
table::add(
|
|
1114
|
+
&mut delegation_store.delegations,
|
|
1115
|
+
metadata,
|
|
1116
|
+
table::new()
|
|
1117
|
+
);
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
let delegations = table::borrow_mut(&mut delegation_store.delegations, metadata);
|
|
1121
|
+
if (!table::contains(delegations, validator)) {
|
|
1122
|
+
table::add(
|
|
1123
|
+
delegations,
|
|
1124
|
+
validator,
|
|
1125
|
+
empty_delegation(delegation.metadata, delegation.validator)
|
|
1126
|
+
);
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
event::emit(
|
|
1130
|
+
DelegationDepositEvent {
|
|
1131
|
+
account: account_addr,
|
|
1132
|
+
metadata: delegation.metadata,
|
|
1133
|
+
share: delegation.share,
|
|
1134
|
+
validator: delegation.validator
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
|
|
1138
|
+
let dst_delegation =
|
|
1139
|
+
load_delegation_mut(
|
|
1140
|
+
&mut delegation_store.delegations,
|
|
1141
|
+
metadata,
|
|
1142
|
+
validator
|
|
1143
|
+
);
|
|
1144
|
+
|
|
1145
|
+
merge_delegation(dst_delegation, delegation)
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/// Withdraw specified `share` from delegation.
|
|
1149
|
+
public fun withdraw_delegation(
|
|
1150
|
+
account: &signer,
|
|
1151
|
+
metadata: Object<Metadata>,
|
|
1152
|
+
validator: String,
|
|
1153
|
+
share: BigDecimal
|
|
1154
|
+
): Delegation acquires DelegationStore {
|
|
1155
|
+
let account_addr = signer::address_of(account);
|
|
1156
|
+
|
|
1157
|
+
assert!(
|
|
1158
|
+
is_account_registered(account_addr),
|
|
1159
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
1160
|
+
);
|
|
1161
|
+
|
|
1162
|
+
let delegation_store = borrow_global_mut<DelegationStore>(account_addr);
|
|
1163
|
+
let delegation =
|
|
1164
|
+
load_delegation_mut(
|
|
1165
|
+
&mut delegation_store.delegations,
|
|
1166
|
+
metadata,
|
|
1167
|
+
validator
|
|
1168
|
+
);
|
|
1169
|
+
|
|
1170
|
+
event::emit(
|
|
1171
|
+
DelegationWithdrawEvent { account: account_addr, metadata, share, validator }
|
|
1172
|
+
);
|
|
1173
|
+
|
|
1174
|
+
// If withdraw all, remove delegation
|
|
1175
|
+
if (delegation.share == share) {
|
|
1176
|
+
let delegations =
|
|
1177
|
+
table::borrow_mut(&mut delegation_store.delegations, metadata);
|
|
1178
|
+
table::remove(delegations, validator)
|
|
1179
|
+
// Else extract
|
|
1180
|
+
} else {
|
|
1181
|
+
extract_delegation(delegation, share)
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/// Extracts specified share of delegatiion from the passed-in `delegation`.
|
|
1186
|
+
public fun extract_delegation(
|
|
1187
|
+
delegation: &mut Delegation, share: BigDecimal
|
|
1188
|
+
): Delegation {
|
|
1189
|
+
assert!(
|
|
1190
|
+
bigdecimal::ge(delegation.share, share),
|
|
1191
|
+
error::invalid_argument(EINSUFFICIENT_AMOUNT)
|
|
1192
|
+
);
|
|
1193
|
+
|
|
1194
|
+
// Total share is invariant and reward_indexes are same btw given and new one so no need to update `reward_index`.
|
|
1195
|
+
delegation.share = bigdecimal::sub(delegation.share, share);
|
|
1196
|
+
Delegation {
|
|
1197
|
+
metadata: delegation.metadata,
|
|
1198
|
+
validator: delegation.validator,
|
|
1199
|
+
reward_index: delegation.reward_index,
|
|
1200
|
+
share
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/// "Merges" the two given delegations. The delegation passed in as `dst_delegation` will have a value equal
|
|
1205
|
+
/// to the sum of the two shares (`dst_delegation` and `source_delegation`).
|
|
1206
|
+
public fun merge_delegation(
|
|
1207
|
+
dst_delegation: &mut Delegation, source_delegation: Delegation
|
|
1208
|
+
): FungibleAsset acquires ModuleStore {
|
|
1209
|
+
assert!(
|
|
1210
|
+
dst_delegation.metadata == source_delegation.metadata,
|
|
1211
|
+
error::invalid_argument(EMETADATA_MISMATCH)
|
|
1212
|
+
);
|
|
1213
|
+
assert!(
|
|
1214
|
+
dst_delegation.validator == source_delegation.validator,
|
|
1215
|
+
error::invalid_argument(EVALIDATOR_MISMATCH)
|
|
1216
|
+
);
|
|
1217
|
+
|
|
1218
|
+
let reward = claim_reward(dst_delegation);
|
|
1219
|
+
|
|
1220
|
+
dst_delegation.share = bigdecimal::add(
|
|
1221
|
+
dst_delegation.share, source_delegation.share
|
|
1222
|
+
);
|
|
1223
|
+
let source_reward = destroy_delegation_and_extract_reward(source_delegation);
|
|
1224
|
+
|
|
1225
|
+
fungible_asset::merge(&mut reward, source_reward);
|
|
1226
|
+
|
|
1227
|
+
reward
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
/// Destroy delegation and extract reward from delegation
|
|
1231
|
+
fun destroy_delegation_and_extract_reward(
|
|
1232
|
+
delegation: Delegation
|
|
1233
|
+
): FungibleAsset acquires ModuleStore {
|
|
1234
|
+
let metadata = delegation.metadata;
|
|
1235
|
+
let validator = delegation.validator;
|
|
1236
|
+
|
|
1237
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
1238
|
+
let state = load_staking_state(
|
|
1239
|
+
&module_store.staking_states,
|
|
1240
|
+
metadata,
|
|
1241
|
+
validator
|
|
1242
|
+
);
|
|
1243
|
+
|
|
1244
|
+
let reward_amount = calculate_reward(&delegation, state);
|
|
1245
|
+
let reward =
|
|
1246
|
+
if (reward_amount == 0) {
|
|
1247
|
+
fungible_asset::zero(reward_metadata())
|
|
1248
|
+
} else {
|
|
1249
|
+
let reward_coin_store_signer =
|
|
1250
|
+
&object::generate_signer_for_extending(
|
|
1251
|
+
&state.reward_coin_store_ref
|
|
1252
|
+
);
|
|
1253
|
+
fungible_asset::withdraw(
|
|
1254
|
+
reward_coin_store_signer,
|
|
1255
|
+
state.reward_coin_store,
|
|
1256
|
+
reward_amount
|
|
1257
|
+
)
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
let Delegation { metadata: _, share: _, validator: _, reward_index: _ } =
|
|
1261
|
+
delegation;
|
|
1262
|
+
|
|
1263
|
+
reward
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/// For unbonding object
|
|
1267
|
+
///
|
|
1268
|
+
|
|
1269
|
+
fun unbonding_share_from_amount(
|
|
1270
|
+
metadata: Object<Metadata>, validator: String, unbonding_amount: u64
|
|
1271
|
+
): BigDecimal acquires ModuleStore {
|
|
1272
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
1273
|
+
let state = load_staking_state(
|
|
1274
|
+
&module_store.staking_states,
|
|
1275
|
+
metadata,
|
|
1276
|
+
validator
|
|
1277
|
+
);
|
|
1278
|
+
|
|
1279
|
+
let share_amount_ratio = unbonding_share_amount_ratio(state);
|
|
1280
|
+
bigdecimal::mul(
|
|
1281
|
+
share_amount_ratio, bigdecimal::from_ratio_u64(unbonding_amount, 1)
|
|
1282
|
+
)
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
fun unbonding_amount_from_share(
|
|
1286
|
+
metadata: Object<Metadata>, validator: String, unbonding_share: BigDecimal
|
|
1287
|
+
): u64 acquires ModuleStore {
|
|
1288
|
+
let module_store = borrow_global<ModuleStore>(@initia_std);
|
|
1289
|
+
let state = load_staking_state(
|
|
1290
|
+
&module_store.staking_states,
|
|
1291
|
+
metadata,
|
|
1292
|
+
validator
|
|
1293
|
+
);
|
|
1294
|
+
|
|
1295
|
+
let amount_share_ratio = bigdecimal::rev(unbonding_share_amount_ratio(state));
|
|
1296
|
+
bigdecimal::truncate_u64(bigdecimal::mul(amount_share_ratio, unbonding_share))
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
fun unbonding_share_amount_ratio(state: &StakingState): BigDecimal {
|
|
1300
|
+
let total_unbonding_amount = fungible_asset::balance(state.unbonding_coin_store);
|
|
1301
|
+
let share_amount_ratio =
|
|
1302
|
+
if (total_unbonding_amount == 0) {
|
|
1303
|
+
bigdecimal::one()
|
|
1304
|
+
} else {
|
|
1305
|
+
bigdecimal::div_by_u64(state.unbonding_share, total_unbonding_amount)
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
if (bigdecimal::lt(share_amount_ratio, bigdecimal::one())) {
|
|
1309
|
+
// cap total unbonding amount to total share to prevent poissible attack like depositing huge amount of unbonding coin
|
|
1310
|
+
// directly to the validator's unbonding_coin_store.
|
|
1311
|
+
bigdecimal::one()
|
|
1312
|
+
} else {
|
|
1313
|
+
share_amount_ratio
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/// return empty unbonding resource
|
|
1318
|
+
public fun empty_unbonding(
|
|
1319
|
+
metadata: Object<Metadata>, validator: String, release_time: u64
|
|
1320
|
+
): Unbonding {
|
|
1321
|
+
Unbonding {
|
|
1322
|
+
metadata,
|
|
1323
|
+
validator,
|
|
1324
|
+
unbonding_share: bigdecimal::zero(),
|
|
1325
|
+
release_time
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/// Get `metadata` from `Unbonding`
|
|
1330
|
+
public fun get_metadata_from_unbonding(unbonding: &Unbonding): Object<Metadata> {
|
|
1331
|
+
unbonding.metadata
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
/// Get `validator` from `Unbonding`
|
|
1335
|
+
public fun get_validator_from_unbonding(unbonding: &Unbonding): String {
|
|
1336
|
+
unbonding.validator
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/// Get `release_time` from `Unbonding`
|
|
1340
|
+
public fun get_release_time_from_unbonding(unbonding: &Unbonding): u64 {
|
|
1341
|
+
unbonding.release_time
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/// Get `unbonding_share` from `Unbonding`
|
|
1345
|
+
public fun get_unbonding_share_from_unbonding(unbonding: &Unbonding): BigDecimal {
|
|
1346
|
+
unbonding.unbonding_share
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/// Get `unbonding_amount` from `Unbonding`
|
|
1350
|
+
public fun get_unbonding_amount_from_unbonding(unbonding: &Unbonding): u64 acquires ModuleStore {
|
|
1351
|
+
unbonding_amount_from_share(
|
|
1352
|
+
unbonding.metadata,
|
|
1353
|
+
unbonding.validator,
|
|
1354
|
+
unbonding.unbonding_share
|
|
1355
|
+
)
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
/// Destroy empty unbonding
|
|
1359
|
+
public fun destroy_empty_unbonding(unbonding: Unbonding) {
|
|
1360
|
+
assert!(
|
|
1361
|
+
bigdecimal::is_zero(unbonding.unbonding_share),
|
|
1362
|
+
error::invalid_argument(ENOT_EMPTY)
|
|
1363
|
+
);
|
|
1364
|
+
let Unbonding { metadata: _, validator: _, unbonding_share: _, release_time: _ } =
|
|
1365
|
+
unbonding;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/// Deposit the unbonding into recipient's account.
|
|
1369
|
+
public fun deposit_unbonding(
|
|
1370
|
+
account_addr: address, unbonding: Unbonding
|
|
1371
|
+
) acquires DelegationStore {
|
|
1372
|
+
assert!(
|
|
1373
|
+
is_account_registered(account_addr),
|
|
1374
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
1375
|
+
);
|
|
1376
|
+
|
|
1377
|
+
let metadata = unbonding.metadata;
|
|
1378
|
+
let validator = unbonding.validator;
|
|
1379
|
+
let release_time = unbonding.release_time;
|
|
1380
|
+
|
|
1381
|
+
let key = UnbondingKey { validator, release_time };
|
|
1382
|
+
|
|
1383
|
+
let delegation_store = borrow_global_mut<DelegationStore>(account_addr);
|
|
1384
|
+
if (!table::contains(&delegation_store.unbondings, metadata)) {
|
|
1385
|
+
table::add(
|
|
1386
|
+
&mut delegation_store.unbondings,
|
|
1387
|
+
metadata,
|
|
1388
|
+
table::new()
|
|
1389
|
+
);
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
let unbondings = table::borrow_mut(&mut delegation_store.unbondings, metadata);
|
|
1393
|
+
if (!table::contains(unbondings, key)) {
|
|
1394
|
+
table::add(
|
|
1395
|
+
unbondings,
|
|
1396
|
+
key,
|
|
1397
|
+
empty_unbonding(metadata, validator, release_time)
|
|
1398
|
+
);
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
event::emit(
|
|
1402
|
+
UnbondingDepositEvent {
|
|
1403
|
+
account: account_addr,
|
|
1404
|
+
metadata,
|
|
1405
|
+
validator,
|
|
1406
|
+
share: unbonding.unbonding_share,
|
|
1407
|
+
release_time
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
|
|
1411
|
+
let dst_unbonding = table::borrow_mut(unbondings, key);
|
|
1412
|
+
merge_unbonding(dst_unbonding, unbonding);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
/// Withdraw specified `amount` of unbonding_amount from the unbonding.
|
|
1416
|
+
public fun withdraw_unbonding(
|
|
1417
|
+
account: &signer,
|
|
1418
|
+
metadata: Object<Metadata>,
|
|
1419
|
+
validator: String,
|
|
1420
|
+
release_time: u64,
|
|
1421
|
+
amount: u64
|
|
1422
|
+
): Unbonding acquires DelegationStore, ModuleStore {
|
|
1423
|
+
let account_addr = signer::address_of(account);
|
|
1424
|
+
|
|
1425
|
+
assert!(
|
|
1426
|
+
is_account_registered(account_addr),
|
|
1427
|
+
error::not_found(EDELEGATION_STORE_NOT_EXISTS)
|
|
1428
|
+
);
|
|
1429
|
+
|
|
1430
|
+
let delegation_store = borrow_global_mut<DelegationStore>(account_addr);
|
|
1431
|
+
let unbonding =
|
|
1432
|
+
load_unbonding_mut(
|
|
1433
|
+
&mut delegation_store.unbondings,
|
|
1434
|
+
metadata,
|
|
1435
|
+
validator,
|
|
1436
|
+
release_time
|
|
1437
|
+
);
|
|
1438
|
+
|
|
1439
|
+
event::emit(
|
|
1440
|
+
UnbondingWithdrawEvent {
|
|
1441
|
+
account: account_addr,
|
|
1442
|
+
metadata,
|
|
1443
|
+
validator,
|
|
1444
|
+
share: unbonding.unbonding_share,
|
|
1445
|
+
release_time: unbonding.release_time
|
|
1446
|
+
}
|
|
1447
|
+
);
|
|
1448
|
+
|
|
1449
|
+
let share = unbonding_share_from_amount(metadata, validator, amount);
|
|
1450
|
+
if (unbonding.unbonding_share == share) {
|
|
1451
|
+
// If withdraw all, remove unbonding
|
|
1452
|
+
let unbondings = table::borrow_mut(
|
|
1453
|
+
&mut delegation_store.unbondings, metadata
|
|
1454
|
+
);
|
|
1455
|
+
|
|
1456
|
+
table::remove(
|
|
1457
|
+
unbondings,
|
|
1458
|
+
UnbondingKey { validator, release_time }
|
|
1459
|
+
)
|
|
1460
|
+
} else {
|
|
1461
|
+
// Else extract
|
|
1462
|
+
extract_unbonding(unbonding, share)
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/// Extracts specified amount of unbonding from the passed-in `unbonding`.
|
|
1467
|
+
public fun extract_unbonding(
|
|
1468
|
+
unbonding: &mut Unbonding, share: BigDecimal
|
|
1469
|
+
): Unbonding {
|
|
1470
|
+
assert!(
|
|
1471
|
+
bigdecimal::ge(unbonding.unbonding_share, share),
|
|
1472
|
+
error::invalid_argument(EINSUFFICIENT_AMOUNT)
|
|
1473
|
+
);
|
|
1474
|
+
|
|
1475
|
+
unbonding.unbonding_share = bigdecimal::sub(unbonding.unbonding_share, share);
|
|
1476
|
+
Unbonding {
|
|
1477
|
+
metadata: unbonding.metadata,
|
|
1478
|
+
validator: unbonding.validator,
|
|
1479
|
+
unbonding_share: share,
|
|
1480
|
+
release_time: unbonding.release_time
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
/// Merge the two given unbondings. The unbonding_coin of the `source_unbonding`
|
|
1485
|
+
/// will be merged into the unbonding_coin of the `dst_unbonding`.
|
|
1486
|
+
/// `release_time` of the `source_unbonding` must be sooner than or equal to the one of `dst_unbonding`
|
|
1487
|
+
public fun merge_unbonding(
|
|
1488
|
+
dst_unbonding: &mut Unbonding, source_unbonding: Unbonding
|
|
1489
|
+
) {
|
|
1490
|
+
assert!(
|
|
1491
|
+
dst_unbonding.metadata == source_unbonding.metadata,
|
|
1492
|
+
error::invalid_argument(EMETADATA_MISMATCH)
|
|
1493
|
+
);
|
|
1494
|
+
assert!(
|
|
1495
|
+
dst_unbonding.validator == source_unbonding.validator,
|
|
1496
|
+
error::invalid_argument(EVALIDATOR_MISMATCH)
|
|
1497
|
+
);
|
|
1498
|
+
assert!(
|
|
1499
|
+
dst_unbonding.release_time >= source_unbonding.release_time,
|
|
1500
|
+
error::invalid_argument(ERELEASE_TIME)
|
|
1501
|
+
);
|
|
1502
|
+
|
|
1503
|
+
dst_unbonding.unbonding_share = bigdecimal::add(
|
|
1504
|
+
dst_unbonding.unbonding_share, source_unbonding.unbonding_share
|
|
1505
|
+
);
|
|
1506
|
+
let Unbonding { metadata: _, validator: _, unbonding_share: _, release_time: _ } =
|
|
1507
|
+
source_unbonding;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/// Claim `unbonding_coin` from expired unbonding.
|
|
1511
|
+
public fun claim_unbonding(unbonding: Unbonding): FungibleAsset acquires ModuleStore {
|
|
1512
|
+
let (_, timestamp) = block::get_block_info();
|
|
1513
|
+
assert!(
|
|
1514
|
+
unbonding.release_time <= timestamp,
|
|
1515
|
+
error::invalid_state(ENOT_RELEASED)
|
|
1516
|
+
);
|
|
1517
|
+
|
|
1518
|
+
let unbonding_amount = get_unbonding_amount_from_unbonding(&unbonding);
|
|
1519
|
+
let module_store = borrow_global_mut<ModuleStore>(@initia_std);
|
|
1520
|
+
let metadata = unbonding.metadata;
|
|
1521
|
+
let validator = unbonding.validator;
|
|
1522
|
+
|
|
1523
|
+
// extract coin
|
|
1524
|
+
let state =
|
|
1525
|
+
load_staking_state_mut(
|
|
1526
|
+
&mut module_store.staking_states,
|
|
1527
|
+
metadata,
|
|
1528
|
+
validator
|
|
1529
|
+
);
|
|
1530
|
+
let unbonding_coin =
|
|
1531
|
+
if (unbonding_amount == 0) {
|
|
1532
|
+
fungible_asset::zero(metadata)
|
|
1533
|
+
} else {
|
|
1534
|
+
let unbonding_coin_store_signer =
|
|
1535
|
+
&object::generate_signer_for_extending(
|
|
1536
|
+
&state.unbonding_coin_store_ref
|
|
1537
|
+
);
|
|
1538
|
+
fungible_asset::withdraw(
|
|
1539
|
+
unbonding_coin_store_signer,
|
|
1540
|
+
state.unbonding_coin_store,
|
|
1541
|
+
unbonding_amount
|
|
1542
|
+
)
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
// decrease share
|
|
1546
|
+
state.unbonding_share = bigdecimal::sub(
|
|
1547
|
+
state.unbonding_share, unbonding.unbonding_share
|
|
1548
|
+
);
|
|
1549
|
+
|
|
1550
|
+
// destroy empty
|
|
1551
|
+
let Unbonding { metadata: _, validator: _, unbonding_share: _, release_time: _ } =
|
|
1552
|
+
unbonding;
|
|
1553
|
+
|
|
1554
|
+
unbonding_coin
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// Native functions
|
|
1558
|
+
|
|
1559
|
+
native fun delegate_internal(
|
|
1560
|
+
validator: vector<u8>, metadata: &Object<Metadata>, amount: u64
|
|
1561
|
+
): BigDecimal /* share amount */;
|
|
1562
|
+
|
|
1563
|
+
native fun undelegate_internal(
|
|
1564
|
+
validator: vector<u8>, metadata: &Object<Metadata>, share: &BigDecimal
|
|
1565
|
+
): (u64 /* unbonding amount */, u64 /* unbond timestamp */);
|
|
1566
|
+
|
|
1567
|
+
native public fun share_to_amount(
|
|
1568
|
+
validator: vector<u8>, metadata: &Object<Metadata>, share: &BigDecimal
|
|
1569
|
+
): u64 /* delegation amount */;
|
|
1570
|
+
|
|
1571
|
+
native public fun amount_to_share(
|
|
1572
|
+
validator: vector<u8>, metadata: &Object<Metadata>, amount: u64
|
|
1573
|
+
): BigDecimal /* share amount */;
|
|
1574
|
+
|
|
1575
|
+
#[test_only]
|
|
1576
|
+
native public fun set_staking_share_ratio(
|
|
1577
|
+
validator: vector<u8>,
|
|
1578
|
+
metadata: &Object<Metadata>,
|
|
1579
|
+
share: &BigDecimal,
|
|
1580
|
+
amount: u64
|
|
1581
|
+
);
|
|
1582
|
+
|
|
1583
|
+
#[test_only]
|
|
1584
|
+
const STAKING_SYMBOL: vector<u8> = b"ustake";
|
|
1585
|
+
|
|
1586
|
+
#[test_only]
|
|
1587
|
+
public fun staking_metadata_for_test(): Object<Metadata> {
|
|
1588
|
+
coin::metadata(@initia_std, string::utf8(STAKING_SYMBOL))
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
#[test_only]
|
|
1592
|
+
public fun deposit_reward_for_test(
|
|
1593
|
+
chain: &signer,
|
|
1594
|
+
metadata: Object<Metadata>,
|
|
1595
|
+
validators: vector<String>,
|
|
1596
|
+
amounts: vector<u64>
|
|
1597
|
+
) acquires ModuleStore {
|
|
1598
|
+
deposit_reward_for_chain(chain, metadata, validators, amounts);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
#[test_only]
|
|
1602
|
+
use std::block::set_block_info;
|
|
1603
|
+
|
|
1604
|
+
#[test_only]
|
|
1605
|
+
public fun init_module_for_test() {
|
|
1606
|
+
init_module(&initia_std::account::create_signer_for_test(@initia_std));
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
#[test_only]
|
|
1610
|
+
public fun test_setup() acquires ModuleStore {
|
|
1611
|
+
init_module_for_test();
|
|
1612
|
+
let chain = &initia_std::account::create_signer_for_test(@initia_std);
|
|
1613
|
+
let chain_addr = @initia_std;
|
|
1614
|
+
|
|
1615
|
+
primary_fungible_store::init_module_for_test();
|
|
1616
|
+
|
|
1617
|
+
// initialize staking coin
|
|
1618
|
+
let (mint_cap, _burn_cap, _freeze_cap) =
|
|
1619
|
+
coin::initialize(
|
|
1620
|
+
chain,
|
|
1621
|
+
option::none(),
|
|
1622
|
+
string::utf8(b"Staking Coin"),
|
|
1623
|
+
string::utf8(STAKING_SYMBOL),
|
|
1624
|
+
6,
|
|
1625
|
+
string::utf8(b""),
|
|
1626
|
+
string::utf8(b"")
|
|
1627
|
+
);
|
|
1628
|
+
|
|
1629
|
+
coin::mint_to(&mint_cap, chain_addr, 100000000000000);
|
|
1630
|
+
|
|
1631
|
+
// initialize reward coin
|
|
1632
|
+
let (mint_cap, _burn_cap, _freeze_cap) =
|
|
1633
|
+
coin::initialize(
|
|
1634
|
+
chain,
|
|
1635
|
+
option::none(),
|
|
1636
|
+
string::utf8(b"Reward Coin"),
|
|
1637
|
+
string::utf8(REWARD_SYMBOL),
|
|
1638
|
+
6,
|
|
1639
|
+
string::utf8(b""),
|
|
1640
|
+
string::utf8(b"")
|
|
1641
|
+
);
|
|
1642
|
+
|
|
1643
|
+
coin::mint_to(&mint_cap, chain_addr, 100000000000000);
|
|
1644
|
+
|
|
1645
|
+
initialize_for_chain(chain, staking_metadata_for_test());
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
#[test_only]
|
|
1649
|
+
public fun fund_stake_coin(
|
|
1650
|
+
chain: &signer, receiver: address, amount: u64
|
|
1651
|
+
) {
|
|
1652
|
+
coin::deposit(
|
|
1653
|
+
receiver,
|
|
1654
|
+
coin::withdraw(chain, staking_metadata_for_test(), amount)
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
#[test_only]
|
|
1659
|
+
public fun fund_reward_coin(
|
|
1660
|
+
chain: &signer, receiver: address, amount: u64
|
|
1661
|
+
) {
|
|
1662
|
+
coin::deposit(
|
|
1663
|
+
receiver,
|
|
1664
|
+
coin::withdraw(chain, reward_metadata(), amount)
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
#[test(chain = @0x1, user1 = @0x1234, user2 = @0x4321)]
|
|
1669
|
+
fun end_to_end(
|
|
1670
|
+
chain: &signer, user1: &signer, user2: &signer
|
|
1671
|
+
) acquires DelegationStore, ModuleStore {
|
|
1672
|
+
test_setup();
|
|
1673
|
+
|
|
1674
|
+
let user1_addr = signer::address_of(user1);
|
|
1675
|
+
let user2_addr = signer::address_of(user2);
|
|
1676
|
+
let validator = string::utf8(b"validator");
|
|
1677
|
+
|
|
1678
|
+
fund_stake_coin(chain, user1_addr, 1000000000);
|
|
1679
|
+
set_block_info(100, 10000);
|
|
1680
|
+
|
|
1681
|
+
register(user1);
|
|
1682
|
+
register(user2);
|
|
1683
|
+
|
|
1684
|
+
let metadata = staking_metadata_for_test();
|
|
1685
|
+
let reward_metadata = reward_metadata();
|
|
1686
|
+
|
|
1687
|
+
set_staking_share_ratio(
|
|
1688
|
+
*string::bytes(&validator),
|
|
1689
|
+
&metadata,
|
|
1690
|
+
&bigdecimal::one(),
|
|
1691
|
+
1
|
|
1692
|
+
);
|
|
1693
|
+
|
|
1694
|
+
delegate_script(user1, metadata, validator, 10000000);
|
|
1695
|
+
|
|
1696
|
+
assert!(
|
|
1697
|
+
coin::balance(user1_addr, metadata) == 990000000,
|
|
1698
|
+
0
|
|
1699
|
+
);
|
|
1700
|
+
|
|
1701
|
+
let delegation = get_delegation(user1_addr, metadata, validator);
|
|
1702
|
+
assert!(delegation.validator == validator, 1);
|
|
1703
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 10000000, 2);
|
|
1704
|
+
assert!(delegation.unclaimed_reward == 0, 3);
|
|
1705
|
+
|
|
1706
|
+
fund_reward_coin(chain, @relayer, 1000000);
|
|
1707
|
+
deposit_reward_for_chain(
|
|
1708
|
+
chain,
|
|
1709
|
+
metadata,
|
|
1710
|
+
vector[validator],
|
|
1711
|
+
vector[1000000]
|
|
1712
|
+
);
|
|
1713
|
+
|
|
1714
|
+
let delegation = get_delegation(user1_addr, metadata, validator);
|
|
1715
|
+
assert!(delegation.unclaimed_reward == 1000000, 4);
|
|
1716
|
+
|
|
1717
|
+
let withdrawn_delegation =
|
|
1718
|
+
withdraw_delegation(
|
|
1719
|
+
user1,
|
|
1720
|
+
metadata,
|
|
1721
|
+
validator,
|
|
1722
|
+
bigdecimal::from_ratio_u64(5000000, 1)
|
|
1723
|
+
);
|
|
1724
|
+
let reward = deposit_delegation(user2_addr, withdrawn_delegation);
|
|
1725
|
+
assert!(fungible_asset::amount(&reward) == 500000, 5);
|
|
1726
|
+
coin::deposit(user1_addr, reward);
|
|
1727
|
+
|
|
1728
|
+
let delegation = get_delegation(user1_addr, metadata, validator);
|
|
1729
|
+
assert!(delegation.unclaimed_reward == 500000, 6);
|
|
1730
|
+
|
|
1731
|
+
claim_reward_script(user1, metadata, validator);
|
|
1732
|
+
assert!(
|
|
1733
|
+
coin::balance(user1_addr, reward_metadata) == 1000000,
|
|
1734
|
+
8
|
|
1735
|
+
);
|
|
1736
|
+
let delegation = get_delegation(user1_addr, metadata, validator);
|
|
1737
|
+
assert!(delegation.unclaimed_reward == 0, 8);
|
|
1738
|
+
|
|
1739
|
+
fund_reward_coin(chain, @relayer, 1000000);
|
|
1740
|
+
deposit_reward_for_chain(
|
|
1741
|
+
chain,
|
|
1742
|
+
metadata,
|
|
1743
|
+
vector[validator],
|
|
1744
|
+
vector[1000000]
|
|
1745
|
+
);
|
|
1746
|
+
let delegation = get_delegation(user1_addr, metadata, validator);
|
|
1747
|
+
assert!(delegation.unclaimed_reward == 500000, 9);
|
|
1748
|
+
|
|
1749
|
+
undelegate_script(user1, metadata, validator, 5000000);
|
|
1750
|
+
assert!(
|
|
1751
|
+
coin::balance(user1_addr, reward_metadata) == 1500000,
|
|
1752
|
+
10
|
|
1753
|
+
);
|
|
1754
|
+
|
|
1755
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
1756
|
+
deposit_unbonding_coin_for_chain(
|
|
1757
|
+
chain,
|
|
1758
|
+
metadata,
|
|
1759
|
+
vector[validator],
|
|
1760
|
+
vector[5000000]
|
|
1761
|
+
);
|
|
1762
|
+
|
|
1763
|
+
let unbondings =
|
|
1764
|
+
get_unbondings(
|
|
1765
|
+
user1_addr,
|
|
1766
|
+
metadata,
|
|
1767
|
+
option::none(),
|
|
1768
|
+
option::none(),
|
|
1769
|
+
1
|
|
1770
|
+
);
|
|
1771
|
+
let unbonding = vector::borrow(&unbondings, 0);
|
|
1772
|
+
|
|
1773
|
+
let withdrawn_unbonding =
|
|
1774
|
+
withdraw_unbonding(
|
|
1775
|
+
user1,
|
|
1776
|
+
metadata,
|
|
1777
|
+
validator,
|
|
1778
|
+
unbonding.release_time,
|
|
1779
|
+
2500000
|
|
1780
|
+
);
|
|
1781
|
+
|
|
1782
|
+
deposit_unbonding(user2_addr, withdrawn_unbonding);
|
|
1783
|
+
|
|
1784
|
+
let unbonding =
|
|
1785
|
+
get_unbonding(
|
|
1786
|
+
user1_addr,
|
|
1787
|
+
metadata,
|
|
1788
|
+
validator,
|
|
1789
|
+
unbonding.release_time
|
|
1790
|
+
);
|
|
1791
|
+
assert!(unbonding.unbonding_amount == 2500000, 11);
|
|
1792
|
+
let unbonding =
|
|
1793
|
+
get_unbonding(
|
|
1794
|
+
user2_addr,
|
|
1795
|
+
metadata,
|
|
1796
|
+
validator,
|
|
1797
|
+
unbonding.release_time
|
|
1798
|
+
);
|
|
1799
|
+
assert!(unbonding.unbonding_amount == 2500000, 12);
|
|
1800
|
+
|
|
1801
|
+
set_block_info(100, 8640000);
|
|
1802
|
+
|
|
1803
|
+
claim_unbonding_script(
|
|
1804
|
+
user1,
|
|
1805
|
+
metadata,
|
|
1806
|
+
validator,
|
|
1807
|
+
unbonding.release_time
|
|
1808
|
+
);
|
|
1809
|
+
assert!(
|
|
1810
|
+
coin::balance(user1_addr, metadata) == 992500000,
|
|
1811
|
+
13
|
|
1812
|
+
);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
#[test(chain = @0x1, user = @0x1234)]
|
|
1816
|
+
public fun test_delegate2(chain: &signer, user: &signer) acquires DelegationStore, ModuleStore {
|
|
1817
|
+
test_setup();
|
|
1818
|
+
|
|
1819
|
+
let user_addr = signer::address_of(user);
|
|
1820
|
+
let validator = string::utf8(b"validator");
|
|
1821
|
+
|
|
1822
|
+
fund_stake_coin(chain, user_addr, 1000000);
|
|
1823
|
+
set_block_info(100, 10000);
|
|
1824
|
+
|
|
1825
|
+
register(user);
|
|
1826
|
+
|
|
1827
|
+
let metadata = staking_metadata_for_test();
|
|
1828
|
+
let reward_metadata = reward_metadata();
|
|
1829
|
+
|
|
1830
|
+
set_staking_share_ratio(
|
|
1831
|
+
*string::bytes(&validator),
|
|
1832
|
+
&metadata,
|
|
1833
|
+
&bigdecimal::from_u64(3),
|
|
1834
|
+
2
|
|
1835
|
+
);
|
|
1836
|
+
|
|
1837
|
+
// Delegate with entry function
|
|
1838
|
+
delegate_script(user, metadata, validator, 100000);
|
|
1839
|
+
|
|
1840
|
+
let delegation = get_delegation(user_addr, metadata, validator);
|
|
1841
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 150000, 0);
|
|
1842
|
+
assert!(delegation.validator == validator, 1);
|
|
1843
|
+
assert!(coin::balance(user_addr, metadata) == 900000, 2);
|
|
1844
|
+
|
|
1845
|
+
// withdraw delegation
|
|
1846
|
+
let delegation0 =
|
|
1847
|
+
withdraw_delegation(
|
|
1848
|
+
user,
|
|
1849
|
+
metadata,
|
|
1850
|
+
validator,
|
|
1851
|
+
bigdecimal::from_ratio_u64(50000, 1)
|
|
1852
|
+
);
|
|
1853
|
+
let delegation = get_delegation(user_addr, metadata, validator);
|
|
1854
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 100000, 3);
|
|
1855
|
+
|
|
1856
|
+
// withdraw all of rest delegation
|
|
1857
|
+
let delegation1 =
|
|
1858
|
+
withdraw_delegation(
|
|
1859
|
+
user,
|
|
1860
|
+
metadata,
|
|
1861
|
+
validator,
|
|
1862
|
+
bigdecimal::from_ratio_u64(50000, 1)
|
|
1863
|
+
);
|
|
1864
|
+
let delegations = get_delegations(user_addr, metadata, option::none(), 1);
|
|
1865
|
+
assert!(vector::length(&delegations) == 1, 4);
|
|
1866
|
+
assert!(
|
|
1867
|
+
bigdecimal::truncate_u64(vector::borrow(&delegations, 0).share) == 50000, 4
|
|
1868
|
+
);
|
|
1869
|
+
|
|
1870
|
+
fund_reward_coin(chain, @relayer, 100000);
|
|
1871
|
+
deposit_reward_for_chain(
|
|
1872
|
+
chain,
|
|
1873
|
+
metadata,
|
|
1874
|
+
vector[validator],
|
|
1875
|
+
vector[100000]
|
|
1876
|
+
);
|
|
1877
|
+
|
|
1878
|
+
// deposit delegation
|
|
1879
|
+
let reward = deposit_delegation(user_addr, delegation0);
|
|
1880
|
+
assert!(fungible_asset::amount(&reward) == 66666, 5);
|
|
1881
|
+
|
|
1882
|
+
let delegation = get_delegation(user_addr, metadata, validator);
|
|
1883
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 100000, 6);
|
|
1884
|
+
assert!(delegation.validator == validator, 7);
|
|
1885
|
+
|
|
1886
|
+
coin::deposit(user_addr, reward);
|
|
1887
|
+
|
|
1888
|
+
// extract delegation
|
|
1889
|
+
let delegation2 =
|
|
1890
|
+
extract_delegation(&mut delegation1, bigdecimal::from_ratio_u64(10000, 1));
|
|
1891
|
+
assert!(bigdecimal::truncate_u64(delegation1.share) == 40000, 8);
|
|
1892
|
+
assert!(bigdecimal::truncate_u64(delegation2.share) == 10000, 9);
|
|
1893
|
+
|
|
1894
|
+
// merge delegation
|
|
1895
|
+
let reward = merge_delegation(&mut delegation1, delegation2);
|
|
1896
|
+
assert!(fungible_asset::amount(&reward) == 33332, 13);
|
|
1897
|
+
assert!(bigdecimal::truncate_u64(delegation1.share) == 50000, 14);
|
|
1898
|
+
coin::deposit(user_addr, reward);
|
|
1899
|
+
|
|
1900
|
+
// delegate
|
|
1901
|
+
let coin = coin::withdraw(user, metadata, 100000);
|
|
1902
|
+
let delegation3 = delegate(validator, coin);
|
|
1903
|
+
assert!(bigdecimal::truncate_u64(delegation3.share) == 150000, 12);
|
|
1904
|
+
let reward = merge_delegation(&mut delegation1, delegation3);
|
|
1905
|
+
fungible_asset::destroy_zero(reward);
|
|
1906
|
+
|
|
1907
|
+
let reward = deposit_delegation(user_addr, delegation1);
|
|
1908
|
+
assert!(fungible_asset::amount(&reward) == 0, 15);
|
|
1909
|
+
fungible_asset::destroy_zero(reward);
|
|
1910
|
+
|
|
1911
|
+
// 1000000 (mint) - 100000 (delegate_script) - 100000 (delegate)
|
|
1912
|
+
// 99998 (rewards)
|
|
1913
|
+
assert!(
|
|
1914
|
+
coin::balance(user_addr, metadata) == 800000,
|
|
1915
|
+
16
|
|
1916
|
+
);
|
|
1917
|
+
assert!(
|
|
1918
|
+
coin::balance(user_addr, reward_metadata) == 99998,
|
|
1919
|
+
17
|
|
1920
|
+
);
|
|
1921
|
+
|
|
1922
|
+
let delegation = get_delegation(user_addr, metadata, validator);
|
|
1923
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 300000, 6);
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
#[test(chain = @0x1, user = @0x1234)]
|
|
1927
|
+
public fun test_undelegate(chain: &signer, user: &signer) acquires DelegationStore, ModuleStore {
|
|
1928
|
+
test_setup();
|
|
1929
|
+
|
|
1930
|
+
let user_addr = signer::address_of(user);
|
|
1931
|
+
let validator = string::utf8(b"validator");
|
|
1932
|
+
|
|
1933
|
+
fund_stake_coin(chain, user_addr, 1000000);
|
|
1934
|
+
set_block_info(100, 10000);
|
|
1935
|
+
|
|
1936
|
+
register(user);
|
|
1937
|
+
|
|
1938
|
+
let metadata = staking_metadata_for_test();
|
|
1939
|
+
let reward_metadata = reward_metadata();
|
|
1940
|
+
|
|
1941
|
+
set_staking_share_ratio(
|
|
1942
|
+
*string::bytes(&validator),
|
|
1943
|
+
&metadata,
|
|
1944
|
+
&bigdecimal::from_u64(1),
|
|
1945
|
+
1
|
|
1946
|
+
);
|
|
1947
|
+
|
|
1948
|
+
delegate_script(user, metadata, validator, 100000);
|
|
1949
|
+
|
|
1950
|
+
fund_reward_coin(chain, @relayer, 100000);
|
|
1951
|
+
deposit_reward_for_chain(
|
|
1952
|
+
chain,
|
|
1953
|
+
metadata,
|
|
1954
|
+
vector[validator],
|
|
1955
|
+
vector[100000]
|
|
1956
|
+
);
|
|
1957
|
+
|
|
1958
|
+
// undelegate with script
|
|
1959
|
+
undelegate_script(user, metadata, validator, 10000);
|
|
1960
|
+
|
|
1961
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
1962
|
+
deposit_unbonding_coin_for_chain(
|
|
1963
|
+
chain,
|
|
1964
|
+
metadata,
|
|
1965
|
+
vector[validator],
|
|
1966
|
+
vector[10000]
|
|
1967
|
+
);
|
|
1968
|
+
|
|
1969
|
+
let delegation = get_delegation(user_addr, metadata, validator);
|
|
1970
|
+
assert!(bigdecimal::truncate_u64(delegation.share) == 90000, 0);
|
|
1971
|
+
|
|
1972
|
+
let unbondings =
|
|
1973
|
+
get_unbondings(
|
|
1974
|
+
user_addr,
|
|
1975
|
+
metadata,
|
|
1976
|
+
option::none(),
|
|
1977
|
+
option::none(),
|
|
1978
|
+
1
|
|
1979
|
+
);
|
|
1980
|
+
let unbonding = vector::borrow(&unbondings, 0);
|
|
1981
|
+
let release_time = unbonding.release_time;
|
|
1982
|
+
assert!(unbonding.unbonding_amount == 10000, 1);
|
|
1983
|
+
assert!(coin::balance(user_addr, metadata) == 900000, 2);
|
|
1984
|
+
assert!(
|
|
1985
|
+
coin::balance(user_addr, reward_metadata) == 10000,
|
|
1986
|
+
3
|
|
1987
|
+
);
|
|
1988
|
+
|
|
1989
|
+
// distribute reward
|
|
1990
|
+
fund_reward_coin(chain, @relayer, 90000);
|
|
1991
|
+
deposit_reward_for_chain(
|
|
1992
|
+
chain,
|
|
1993
|
+
metadata,
|
|
1994
|
+
vector[validator],
|
|
1995
|
+
vector[90000]
|
|
1996
|
+
);
|
|
1997
|
+
|
|
1998
|
+
// undelegate
|
|
1999
|
+
let delegation =
|
|
2000
|
+
withdraw_delegation(
|
|
2001
|
+
user,
|
|
2002
|
+
metadata,
|
|
2003
|
+
validator,
|
|
2004
|
+
bigdecimal::from_ratio_u64(10000, 1)
|
|
2005
|
+
);
|
|
2006
|
+
let (reward, unbonding0) = undelegate(delegation);
|
|
2007
|
+
assert!(fungible_asset::amount(&reward) == 20000, 4);
|
|
2008
|
+
assert!(bigdecimal::truncate_u64(unbonding0.unbonding_share) == 10000, 5);
|
|
2009
|
+
|
|
2010
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
2011
|
+
deposit_unbonding_coin_for_chain(
|
|
2012
|
+
chain,
|
|
2013
|
+
metadata,
|
|
2014
|
+
vector[validator],
|
|
2015
|
+
vector[10000]
|
|
2016
|
+
);
|
|
2017
|
+
|
|
2018
|
+
coin::deposit(user_addr, reward);
|
|
2019
|
+
assert!(
|
|
2020
|
+
coin::balance(user_addr, reward_metadata) == 30000,
|
|
2021
|
+
3
|
|
2022
|
+
);
|
|
2023
|
+
|
|
2024
|
+
// extract unbonding
|
|
2025
|
+
let unbonding1 =
|
|
2026
|
+
extract_unbonding(&mut unbonding0, bigdecimal::from_ratio_u64(5000, 1));
|
|
2027
|
+
assert!(bigdecimal::truncate_u64(unbonding0.unbonding_share) == 5000, 7);
|
|
2028
|
+
assert!(bigdecimal::truncate_u64(unbonding1.unbonding_share) == 5000, 8);
|
|
2029
|
+
|
|
2030
|
+
// merge unbonding
|
|
2031
|
+
merge_unbonding(&mut unbonding0, unbonding1);
|
|
2032
|
+
assert!(bigdecimal::truncate_u64(unbonding0.unbonding_share) == 10000, 9);
|
|
2033
|
+
|
|
2034
|
+
// deposit unbonding
|
|
2035
|
+
deposit_unbonding(user_addr, unbonding0);
|
|
2036
|
+
let unbonding = get_unbonding(user_addr, metadata, validator, release_time);
|
|
2037
|
+
assert!(unbonding.unbonding_amount == 20000, 10);
|
|
2038
|
+
|
|
2039
|
+
// withdraw unbonding
|
|
2040
|
+
let unbonding = withdraw_unbonding(user, metadata, validator, release_time, 10000);
|
|
2041
|
+
assert!(bigdecimal::truncate_u64(unbonding.unbonding_share) == 10000, 11);
|
|
2042
|
+
|
|
2043
|
+
// claim unbonding
|
|
2044
|
+
set_block_info(200, release_time);
|
|
2045
|
+
let coin = claim_unbonding(unbonding);
|
|
2046
|
+
assert!(fungible_asset::amount(&coin) == 10000, 12);
|
|
2047
|
+
coin::deposit(user_addr, coin);
|
|
2048
|
+
|
|
2049
|
+
// claim unbonding with script
|
|
2050
|
+
claim_unbonding_script(user, metadata, validator, release_time);
|
|
2051
|
+
assert!(
|
|
2052
|
+
coin::balance(user_addr, metadata) == 920000,
|
|
2053
|
+
13
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
#[test(chain = @0x1, user1 = @0x1234, user2 = @0x4321)]
|
|
2058
|
+
fun test_claim_reward(
|
|
2059
|
+
chain: &signer, user1: &signer, user2: &signer
|
|
2060
|
+
) acquires DelegationStore, ModuleStore {
|
|
2061
|
+
test_setup();
|
|
2062
|
+
|
|
2063
|
+
let user1_addr = signer::address_of(user1);
|
|
2064
|
+
let user2_addr = signer::address_of(user2);
|
|
2065
|
+
|
|
2066
|
+
let validator = string::utf8(b"validator");
|
|
2067
|
+
|
|
2068
|
+
fund_stake_coin(chain, user1_addr, 1000000);
|
|
2069
|
+
fund_stake_coin(chain, user2_addr, 1000000);
|
|
2070
|
+
|
|
2071
|
+
set_block_info(100, 10000);
|
|
2072
|
+
|
|
2073
|
+
register(user1);
|
|
2074
|
+
register(user2);
|
|
2075
|
+
|
|
2076
|
+
let metadata = staking_metadata_for_test();
|
|
2077
|
+
let reward_metadata = reward_metadata();
|
|
2078
|
+
|
|
2079
|
+
set_staking_share_ratio(
|
|
2080
|
+
*string::bytes(&validator),
|
|
2081
|
+
&metadata,
|
|
2082
|
+
&bigdecimal::from_u64(1),
|
|
2083
|
+
1
|
|
2084
|
+
);
|
|
2085
|
+
|
|
2086
|
+
delegate_script(
|
|
2087
|
+
user1,
|
|
2088
|
+
metadata,
|
|
2089
|
+
string::utf8(b"validator"),
|
|
2090
|
+
1000000
|
|
2091
|
+
);
|
|
2092
|
+
|
|
2093
|
+
fund_reward_coin(chain, @relayer, 100000);
|
|
2094
|
+
deposit_reward_for_chain(
|
|
2095
|
+
chain,
|
|
2096
|
+
metadata,
|
|
2097
|
+
vector[validator],
|
|
2098
|
+
vector[100000]
|
|
2099
|
+
);
|
|
2100
|
+
|
|
2101
|
+
// claim reward by script
|
|
2102
|
+
claim_reward_script(user1, metadata, validator);
|
|
2103
|
+
assert!(
|
|
2104
|
+
coin::balance(user1_addr, reward_metadata) == 100000,
|
|
2105
|
+
0
|
|
2106
|
+
);
|
|
2107
|
+
|
|
2108
|
+
fund_reward_coin(chain, @relayer, 100000);
|
|
2109
|
+
deposit_reward_for_chain(
|
|
2110
|
+
chain,
|
|
2111
|
+
metadata,
|
|
2112
|
+
vector[validator],
|
|
2113
|
+
vector[100000]
|
|
2114
|
+
);
|
|
2115
|
+
|
|
2116
|
+
// claim reward
|
|
2117
|
+
let delegation =
|
|
2118
|
+
withdraw_delegation(
|
|
2119
|
+
user1,
|
|
2120
|
+
metadata,
|
|
2121
|
+
validator,
|
|
2122
|
+
bigdecimal::from_ratio_u64(1000000, 1)
|
|
2123
|
+
);
|
|
2124
|
+
let reward = claim_reward(&mut delegation);
|
|
2125
|
+
assert!(fungible_asset::amount(&reward) == 100000, 1);
|
|
2126
|
+
coin::deposit(user1_addr, reward);
|
|
2127
|
+
|
|
2128
|
+
let reward = deposit_delegation(user1_addr, delegation);
|
|
2129
|
+
assert!(fungible_asset::amount(&reward) == 0, 2);
|
|
2130
|
+
fungible_asset::destroy_zero(reward);
|
|
2131
|
+
|
|
2132
|
+
assert!(
|
|
2133
|
+
coin::balance(user1_addr, reward_metadata) == 200000,
|
|
2134
|
+
3
|
|
2135
|
+
);
|
|
2136
|
+
|
|
2137
|
+
delegate_script(
|
|
2138
|
+
user2,
|
|
2139
|
+
metadata,
|
|
2140
|
+
string::utf8(b"validator"),
|
|
2141
|
+
1000000
|
|
2142
|
+
);
|
|
2143
|
+
|
|
2144
|
+
fund_reward_coin(chain, @relayer, 100000);
|
|
2145
|
+
deposit_reward_for_chain(
|
|
2146
|
+
chain,
|
|
2147
|
+
metadata,
|
|
2148
|
+
vector[validator],
|
|
2149
|
+
vector[100000]
|
|
2150
|
+
);
|
|
2151
|
+
claim_reward_script(user1, metadata, validator);
|
|
2152
|
+
assert!(
|
|
2153
|
+
coin::balance(user1_addr, reward_metadata) == 250000,
|
|
2154
|
+
4
|
|
2155
|
+
);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
#[test]
|
|
2159
|
+
#[expected_failure(abort_code = 0x10007, location = Self)]
|
|
2160
|
+
public fun test_staking_destroy_not_empty_delegation() acquires ModuleStore {
|
|
2161
|
+
test_setup();
|
|
2162
|
+
|
|
2163
|
+
let delegation = Delegation {
|
|
2164
|
+
metadata: staking_metadata_for_test(),
|
|
2165
|
+
validator: string::utf8(b"validator"),
|
|
2166
|
+
reward_index: bigdecimal::zero(),
|
|
2167
|
+
share: bigdecimal::from_ratio_u64(100, 1)
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
destroy_empty_delegation(delegation);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
#[test]
|
|
2174
|
+
#[expected_failure(abort_code = 0x10007, location = Self)]
|
|
2175
|
+
public fun test_staking_destroy_not_empty_unbonding() acquires ModuleStore {
|
|
2176
|
+
test_setup();
|
|
2177
|
+
|
|
2178
|
+
let unbonding = Unbonding {
|
|
2179
|
+
metadata: staking_metadata_for_test(),
|
|
2180
|
+
validator: string::utf8(b"validator"),
|
|
2181
|
+
unbonding_share: bigdecimal::from_ratio_u64(100, 1),
|
|
2182
|
+
release_time: 1234
|
|
2183
|
+
};
|
|
2184
|
+
|
|
2185
|
+
destroy_empty_unbonding(unbonding);
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
#[test]
|
|
2189
|
+
#[expected_failure(abort_code = 0x10008, location = Self)]
|
|
2190
|
+
public fun test_staking_merge_delegation_validator_mistmatch() acquires ModuleStore {
|
|
2191
|
+
test_setup();
|
|
2192
|
+
|
|
2193
|
+
let delegation1 = Delegation {
|
|
2194
|
+
metadata: staking_metadata_for_test(),
|
|
2195
|
+
validator: string::utf8(b"validator1"),
|
|
2196
|
+
reward_index: bigdecimal::zero(),
|
|
2197
|
+
share: bigdecimal::from_ratio_u64(100, 1)
|
|
2198
|
+
};
|
|
2199
|
+
|
|
2200
|
+
let delegation2 = Delegation {
|
|
2201
|
+
metadata: staking_metadata_for_test(),
|
|
2202
|
+
validator: string::utf8(b"validator2"),
|
|
2203
|
+
reward_index: bigdecimal::zero(),
|
|
2204
|
+
share: bigdecimal::from_ratio_u64(100, 1)
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
let reward = merge_delegation(&mut delegation1, delegation2);
|
|
2208
|
+
let Delegation { metadata: _, share: _, validator: _, reward_index: _ } =
|
|
2209
|
+
delegation1;
|
|
2210
|
+
fungible_asset::destroy_zero(reward);
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
#[test]
|
|
2214
|
+
#[expected_failure(abort_code = 0x10009, location = Self)]
|
|
2215
|
+
public fun test_staking_merge_unbonding_release_time() acquires ModuleStore {
|
|
2216
|
+
test_setup();
|
|
2217
|
+
|
|
2218
|
+
let validator = string::utf8(b"validator");
|
|
2219
|
+
let unbonding1 = Unbonding {
|
|
2220
|
+
metadata: staking_metadata_for_test(),
|
|
2221
|
+
validator,
|
|
2222
|
+
unbonding_share: bigdecimal::from_ratio_u64(100, 1),
|
|
2223
|
+
release_time: 1000
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2226
|
+
let unbonding2 = Unbonding {
|
|
2227
|
+
metadata: staking_metadata_for_test(),
|
|
2228
|
+
validator,
|
|
2229
|
+
unbonding_share: bigdecimal::from_ratio_u64(100, 1),
|
|
2230
|
+
release_time: 1234
|
|
2231
|
+
};
|
|
2232
|
+
|
|
2233
|
+
merge_unbonding(&mut unbonding1, unbonding2);
|
|
2234
|
+
let Unbonding { metadata: _, validator: _, unbonding_share, release_time: _ } =
|
|
2235
|
+
unbonding1;
|
|
2236
|
+
|
|
2237
|
+
assert!(bigdecimal::truncate_u64(unbonding_share) == 200, 1);
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
#[test(chain = @0x1, user = @0x1234)]
|
|
2241
|
+
#[expected_failure(abort_code = 0x3000A, location = Self)]
|
|
2242
|
+
public fun test_staking_claim_not_released_unbonding(
|
|
2243
|
+
chain: &signer, user: &signer
|
|
2244
|
+
) acquires ModuleStore, DelegationStore {
|
|
2245
|
+
test_setup();
|
|
2246
|
+
|
|
2247
|
+
let user_addr = signer::address_of(user);
|
|
2248
|
+
let validator = string::utf8(b"validator");
|
|
2249
|
+
|
|
2250
|
+
fund_stake_coin(chain, user_addr, 100);
|
|
2251
|
+
|
|
2252
|
+
register(user);
|
|
2253
|
+
|
|
2254
|
+
let metadata = staking_metadata_for_test();
|
|
2255
|
+
set_staking_share_ratio(
|
|
2256
|
+
*string::bytes(&validator),
|
|
2257
|
+
&metadata,
|
|
2258
|
+
&bigdecimal::from_u64(1),
|
|
2259
|
+
1
|
|
2260
|
+
);
|
|
2261
|
+
|
|
2262
|
+
// dummy delegation to create global states
|
|
2263
|
+
delegate_script(user, metadata, validator, 100);
|
|
2264
|
+
|
|
2265
|
+
fund_stake_coin(chain, @relayer, 100);
|
|
2266
|
+
deposit_unbonding_coin_for_chain(
|
|
2267
|
+
chain,
|
|
2268
|
+
metadata,
|
|
2269
|
+
vector[validator],
|
|
2270
|
+
vector[100]
|
|
2271
|
+
);
|
|
2272
|
+
|
|
2273
|
+
set_block_info(100, 100);
|
|
2274
|
+
|
|
2275
|
+
let unbonding = Unbonding {
|
|
2276
|
+
metadata,
|
|
2277
|
+
validator,
|
|
2278
|
+
unbonding_share: bigdecimal::from_ratio_u64(100, 1),
|
|
2279
|
+
release_time: 1000
|
|
2280
|
+
};
|
|
2281
|
+
|
|
2282
|
+
let coin = claim_unbonding(unbonding);
|
|
2283
|
+
assert!(fungible_asset::amount(&coin) == 100, 1);
|
|
2284
|
+
|
|
2285
|
+
coin::deposit(@relayer, coin);
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
#[test(chain = @0x1, user = @0x1234)]
|
|
2289
|
+
public fun test_staking_query_entry_functions(
|
|
2290
|
+
chain: &signer, user: &signer
|
|
2291
|
+
) acquires DelegationStore, ModuleStore {
|
|
2292
|
+
test_setup();
|
|
2293
|
+
|
|
2294
|
+
let user_addr = signer::address_of(user);
|
|
2295
|
+
let metadata = staking_metadata_for_test();
|
|
2296
|
+
let validator1 = string::utf8(b"validator1");
|
|
2297
|
+
let validator2 = string::utf8(b"validator2");
|
|
2298
|
+
|
|
2299
|
+
fund_stake_coin(chain, user_addr, 1000000);
|
|
2300
|
+
|
|
2301
|
+
set_block_info(100, 10000);
|
|
2302
|
+
|
|
2303
|
+
register(user);
|
|
2304
|
+
|
|
2305
|
+
set_staking_share_ratio(
|
|
2306
|
+
*string::bytes(&validator1),
|
|
2307
|
+
&metadata,
|
|
2308
|
+
&bigdecimal::from_u64(1),
|
|
2309
|
+
1
|
|
2310
|
+
);
|
|
2311
|
+
set_staking_share_ratio(
|
|
2312
|
+
*string::bytes(&validator2),
|
|
2313
|
+
&metadata,
|
|
2314
|
+
&bigdecimal::from_u64(1),
|
|
2315
|
+
1
|
|
2316
|
+
);
|
|
2317
|
+
|
|
2318
|
+
delegate_script(user, metadata, validator1, 100000);
|
|
2319
|
+
delegate_script(user, metadata, validator2, 100000);
|
|
2320
|
+
|
|
2321
|
+
undelegate_script(user, metadata, validator1, 10000);
|
|
2322
|
+
undelegate_script(user, metadata, validator2, 10000);
|
|
2323
|
+
|
|
2324
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
2325
|
+
deposit_unbonding_coin_for_chain(
|
|
2326
|
+
chain,
|
|
2327
|
+
metadata,
|
|
2328
|
+
vector[validator1, validator2],
|
|
2329
|
+
vector[10000, 10000]
|
|
2330
|
+
);
|
|
2331
|
+
|
|
2332
|
+
// update block info
|
|
2333
|
+
set_block_info(200, 20000);
|
|
2334
|
+
|
|
2335
|
+
undelegate_script(user, metadata, validator1, 10000);
|
|
2336
|
+
|
|
2337
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
2338
|
+
deposit_unbonding_coin_for_chain(
|
|
2339
|
+
chain,
|
|
2340
|
+
metadata,
|
|
2341
|
+
vector[validator1],
|
|
2342
|
+
vector[10000]
|
|
2343
|
+
);
|
|
2344
|
+
|
|
2345
|
+
let delegation = get_delegation(user_addr, metadata, validator1);
|
|
2346
|
+
assert!(
|
|
2347
|
+
delegation
|
|
2348
|
+
== DelegationResponse {
|
|
2349
|
+
metadata,
|
|
2350
|
+
validator: validator1,
|
|
2351
|
+
share: bigdecimal::from_ratio_u64(80000, 1),
|
|
2352
|
+
unclaimed_reward: 0
|
|
2353
|
+
},
|
|
2354
|
+
0
|
|
2355
|
+
);
|
|
2356
|
+
|
|
2357
|
+
let delegations = get_delegations(user_addr, metadata, option::none(), 10);
|
|
2358
|
+
assert!(
|
|
2359
|
+
delegations
|
|
2360
|
+
== vector[
|
|
2361
|
+
DelegationResponse {
|
|
2362
|
+
metadata,
|
|
2363
|
+
validator: validator2,
|
|
2364
|
+
share: bigdecimal::from_ratio_u64(90000, 1),
|
|
2365
|
+
unclaimed_reward: 0
|
|
2366
|
+
},
|
|
2367
|
+
DelegationResponse {
|
|
2368
|
+
metadata,
|
|
2369
|
+
validator: validator1,
|
|
2370
|
+
share: bigdecimal::from_ratio_u64(80000, 1),
|
|
2371
|
+
unclaimed_reward: 0
|
|
2372
|
+
}
|
|
2373
|
+
],
|
|
2374
|
+
1
|
|
2375
|
+
);
|
|
2376
|
+
|
|
2377
|
+
let delegations = get_delegations(
|
|
2378
|
+
user_addr,
|
|
2379
|
+
metadata,
|
|
2380
|
+
option::some(validator2),
|
|
2381
|
+
10
|
|
2382
|
+
);
|
|
2383
|
+
assert!(
|
|
2384
|
+
delegations
|
|
2385
|
+
== vector[
|
|
2386
|
+
DelegationResponse {
|
|
2387
|
+
metadata,
|
|
2388
|
+
validator: validator1,
|
|
2389
|
+
share: bigdecimal::from_ratio_u64(80000, 1),
|
|
2390
|
+
unclaimed_reward: 0
|
|
2391
|
+
}
|
|
2392
|
+
],
|
|
2393
|
+
2
|
|
2394
|
+
);
|
|
2395
|
+
|
|
2396
|
+
let unbonding = get_unbonding(
|
|
2397
|
+
user_addr,
|
|
2398
|
+
metadata,
|
|
2399
|
+
validator1,
|
|
2400
|
+
10000 + 7 * 24 * 60 * 60
|
|
2401
|
+
);
|
|
2402
|
+
assert!(
|
|
2403
|
+
unbonding
|
|
2404
|
+
== UnbondingResponse {
|
|
2405
|
+
metadata,
|
|
2406
|
+
validator: validator1,
|
|
2407
|
+
unbonding_amount: 10000,
|
|
2408
|
+
release_time: 10000 + 7 * 24 * 60 * 60
|
|
2409
|
+
},
|
|
2410
|
+
3
|
|
2411
|
+
);
|
|
2412
|
+
|
|
2413
|
+
let unbondings =
|
|
2414
|
+
get_unbondings(
|
|
2415
|
+
user_addr,
|
|
2416
|
+
metadata,
|
|
2417
|
+
option::none(),
|
|
2418
|
+
option::none(),
|
|
2419
|
+
10
|
|
2420
|
+
);
|
|
2421
|
+
assert!(
|
|
2422
|
+
unbondings
|
|
2423
|
+
== vector[
|
|
2424
|
+
UnbondingResponse {
|
|
2425
|
+
metadata,
|
|
2426
|
+
validator: validator2,
|
|
2427
|
+
unbonding_amount: 10000,
|
|
2428
|
+
release_time: 10000 + 7 * 24 * 60 * 60
|
|
2429
|
+
},
|
|
2430
|
+
UnbondingResponse {
|
|
2431
|
+
metadata,
|
|
2432
|
+
validator: validator1,
|
|
2433
|
+
unbonding_amount: 10000,
|
|
2434
|
+
release_time: 20000 + 7 * 24 * 60 * 60
|
|
2435
|
+
},
|
|
2436
|
+
UnbondingResponse {
|
|
2437
|
+
metadata,
|
|
2438
|
+
validator: validator1,
|
|
2439
|
+
unbonding_amount: 10000,
|
|
2440
|
+
release_time: 10000 + 7 * 24 * 60 * 60
|
|
2441
|
+
}
|
|
2442
|
+
],
|
|
2443
|
+
4
|
|
2444
|
+
);
|
|
2445
|
+
|
|
2446
|
+
let unbondings =
|
|
2447
|
+
get_unbondings(
|
|
2448
|
+
user_addr,
|
|
2449
|
+
metadata,
|
|
2450
|
+
option::some(validator1),
|
|
2451
|
+
option::some(20000 + 7 * 24 * 60 * 60),
|
|
2452
|
+
10
|
|
2453
|
+
);
|
|
2454
|
+
assert!(
|
|
2455
|
+
unbondings
|
|
2456
|
+
== vector[
|
|
2457
|
+
UnbondingResponse {
|
|
2458
|
+
metadata,
|
|
2459
|
+
validator: validator1,
|
|
2460
|
+
unbonding_amount: 10000,
|
|
2461
|
+
release_time: 10000 + 7 * 24 * 60 * 60
|
|
2462
|
+
}
|
|
2463
|
+
],
|
|
2464
|
+
5
|
|
2465
|
+
);
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
#[test]
|
|
2469
|
+
public fun test_staking_share_to_amount() acquires ModuleStore {
|
|
2470
|
+
test_setup();
|
|
2471
|
+
|
|
2472
|
+
let metadata = staking_metadata_for_test();
|
|
2473
|
+
let validator = vector::singleton(1u8);
|
|
2474
|
+
set_staking_share_ratio(
|
|
2475
|
+
validator,
|
|
2476
|
+
&metadata,
|
|
2477
|
+
&bigdecimal::from_u64(100),
|
|
2478
|
+
50u64
|
|
2479
|
+
);
|
|
2480
|
+
|
|
2481
|
+
let amount =
|
|
2482
|
+
share_to_amount(
|
|
2483
|
+
vector::singleton(1u8),
|
|
2484
|
+
&metadata,
|
|
2485
|
+
&bigdecimal::from_ratio_u64(2, 1)
|
|
2486
|
+
);
|
|
2487
|
+
assert!(amount == 1u64, 0);
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
#[test]
|
|
2491
|
+
public fun test_staking_amount_to_share() acquires ModuleStore {
|
|
2492
|
+
test_setup();
|
|
2493
|
+
|
|
2494
|
+
let metadata = staking_metadata_for_test();
|
|
2495
|
+
let validator = vector::singleton(1u8);
|
|
2496
|
+
set_staking_share_ratio(
|
|
2497
|
+
validator,
|
|
2498
|
+
&metadata,
|
|
2499
|
+
&bigdecimal::from_u64(100),
|
|
2500
|
+
50u64
|
|
2501
|
+
);
|
|
2502
|
+
|
|
2503
|
+
let share = amount_to_share(validator, &metadata, 1);
|
|
2504
|
+
assert!(bigdecimal::truncate_u64(share) == 2u64, 0);
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
#[test(chain = @0x1, user = @0x1234)]
|
|
2508
|
+
public fun test_staking_slash_unbonding(
|
|
2509
|
+
chain: &signer, user: &signer
|
|
2510
|
+
) acquires DelegationStore, ModuleStore {
|
|
2511
|
+
test_setup();
|
|
2512
|
+
|
|
2513
|
+
let user_addr = signer::address_of(user);
|
|
2514
|
+
let validator = string::utf8(b"validator");
|
|
2515
|
+
|
|
2516
|
+
let metadata = staking_metadata_for_test();
|
|
2517
|
+
|
|
2518
|
+
fund_stake_coin(chain, user_addr, 1000000);
|
|
2519
|
+
|
|
2520
|
+
set_block_info(100, 10000);
|
|
2521
|
+
set_staking_share_ratio(
|
|
2522
|
+
*string::bytes(&validator),
|
|
2523
|
+
&metadata,
|
|
2524
|
+
&bigdecimal::from_u64(1),
|
|
2525
|
+
1
|
|
2526
|
+
);
|
|
2527
|
+
|
|
2528
|
+
register(user);
|
|
2529
|
+
delegate_script(user, metadata, validator, 100000);
|
|
2530
|
+
undelegate_script(user, metadata, validator, 10000);
|
|
2531
|
+
|
|
2532
|
+
// undelegate trigger `deposit_unbonding_coin_for_chain`
|
|
2533
|
+
deposit_unbonding_coin_for_chain(
|
|
2534
|
+
chain,
|
|
2535
|
+
metadata,
|
|
2536
|
+
vector[validator],
|
|
2537
|
+
vector[10000]
|
|
2538
|
+
);
|
|
2539
|
+
slash_unbonding_for_chain(
|
|
2540
|
+
chain,
|
|
2541
|
+
metadata,
|
|
2542
|
+
validator,
|
|
2543
|
+
bigdecimal::from_ratio_u64(1, 10)
|
|
2544
|
+
); // 10%
|
|
2545
|
+
|
|
2546
|
+
let unbonding_response =
|
|
2547
|
+
get_unbonding(
|
|
2548
|
+
user_addr,
|
|
2549
|
+
metadata,
|
|
2550
|
+
validator,
|
|
2551
|
+
10000 + 7 * 24 * 60 * 60
|
|
2552
|
+
);
|
|
2553
|
+
assert!(unbonding_response.unbonding_amount == 9000, 1);
|
|
2554
|
+
}
|
|
2555
|
+
}
|